Skip to content

Stop shipping default favicons; generate from a single source image - #2652

Closed
chalin wants to merge 1 commit into
docsy:mainfrom
chalin:chalin-m24-theme-no-default-favicons-2026-0612
Closed

chalin wants to merge 1 commit into
docsy:mainfrom
chalin:chalin-m24-theme-no-default-favicons-2026-0612

Conversation

@chalin

@chalin chalin commented Jun 13, 2026 •

Copy link
Copy Markdown
Collaborator

The theme no longer ships its own favicon files. Instead, Docsy generates the favicons from a single site-provided source image and publishes them at the site root, where browsers and other clients probe for them by analytics across Docsy sites show the bulk of favicon requests (and 404s) are root-path requests (/favicon.ico, /apple-touch-icon.png, /favicon-16x16.png, /favicon-32x32.png) that a /favicons/-based layout never satisfies.convention

What changed

  • Removes the 18 bundled favicon files from theme/static/favicons, so the theme no longer imposes its own branding on downstream sites.
  • Rewrites _partials/favicons.html to:
    • Generate PNG favicons (and a 180180 apple-touch-icon) from one source image via Resize ... CatmullRom.
    • Publish them at the site root with conventional names (/favicon.ico, /favicon-16x16., /apple-touch-icon.png) via resources.Copy, so blind root probes resolve.png,
    • Publish /apple-touch-icon-precomposed.png by default (legacy iOS blind-probes that name; analytics show it as a top uncovered 404); sites can opt out via params.td.favicons.no_apple_precomposed.
    • Publish optional favicon.svg / favicon.ico variants as-is.
    • Warn once (suppressible via ignoreLogs: ['docsy-no-favicons']) when a site provides no favicons.

Configuration

Sites supply a square source image (default favicon.png) under assets/, at the root or in favicons/. Optional overrides under params.td.favicons (defaults shown):

params:
  td:
    favicons:
    path: favicon.* # base path of your icon files; the extension is ignored
    sizes: [16, 32, 48] # PNG sizes generated from the source image
    no_apple_precomposed: false # set true to skip apple-touch-icon-precomposed.png

Breaking change

Favicon files now live under assets/ rather than static/, because Hugo's resource pipeline (resources.Get) only sees assets/. Sites that previously dropped favicons in static/favicons/ will need to move them and supply a square source image. This is noted for the 0.16.0 release notes.

@chalin chalin added this to the 0.16.0 milestone Jun 13, 2026
@chalin
chalin force-pushed the chalin-m24-theme-no-default-favicons-2026-0612 branch from 00fd0cd to e277423 Compare June 13, 2026 01:52
@chalin
chalin marked this pull request as draft June 13, 2026 02:00
@chalin
chalin force-pushed the chalin-m24-theme-no-default-favicons-2026-0612 branch from e277423 to b0d6547 Compare June 13, 2026 02:30
@chalin chalin changed the title Stop shipping default favicons from the theme Stop shipping default favicons; generate from a single source image Jun 13, 2026
@chalin
chalin force-pushed the chalin-m24-theme-no-default-favicons-2026-0612 branch 3 times, most recently from aba0763 to be18154 Compare June 13, 2026 03:07
- Fixes docsy#2595
- Contributes to docsy#2357
- Removes the 18 bundled favicon files from `theme/static/favicons`, so the theme no longer imposes its own branding on sites
- Rewrites `_partials/favicons.html` to generate favicons from a site-provided source image, resized via Hugo's image pipeline, and publish them at the site root (`/favicon.ico`, `/favicon-NxN.png`, `/apple-touch-icon.png`) where browsers and other clients probe for them by convention
- Publishes `/apple-touch-icon-precomposed.png` by default for legacy iOS, which blind-probes that name; sites can opt out via `params.td.favicons.no_apple_precomposed`
- Publishes optional `.svg`/`.ico` variants as-is, also at the site root
- Resolves favicon files from `assets/`, at the root or under `favicons/`, configurable via `params.td.favicons` (`path`, `sizes`, `no_apple_precomposed`)
- Warns once (suppressible via `docsy-no-favicons`) when a site provides no favicons
- Adds a source favicon for docsy.dev under `assets/favicons`
- Documents the new approach and default configuration in the user guide
- Note: favicon overrides now live in `assets/` rather than `static/`, since Hugo's resource pipeline only sees `assets/`
@chalin

chalin commented Jun 14, 2026

Copy link
Copy Markdown
Collaborator Author

Superseded by #2654, which takes a simpler smart pass-through approach (discover and link conventionally named static/ favicons) instead of in-Hugo generation. Closing in favor of that PR.

@chalin chalin closed this Jun 14, 2026
@chalin
chalin deleted the chalin-m24-theme-no-default-favicons-2026-0612 branch July 29, 2026 13:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Theme should not have default favicons

1 participant