Skip to content

docs(site): add a favicon so link cards show a thumbnail - #89

Merged
luoxuanzao merged 2 commits into
mainfrom
docs/favicon
Sep 30, 2026
Merged

luoxuanzao merged 2 commits into
mainfrom
docs/favicon

Conversation

@luoxuanzao

@luoxuanzao luoxuanzao commented Sep 29, 2026 •

Copy link
Copy Markdown
Member

Summary

  • The site emitted no favicon at all, so browser tabs show the blank default icon.
  • Syncs the plugin icon src/assets/qoder-icon.svg into the site as static/img/favicon.svg, same pipeline as the other shared assets.
  • The synced copy is transformed: currentColor is replaced by classes plus a prefers-color-scheme block (black mark on light browser chrome, white on dark). A favicon has no surrounding text color to inherit, so plain currentColor would pin it to black and vanish on dark tabs; this mirrors how the plugin icon follows the vault theme.
  • Injects <link rel="icon" type="image/svg+xml" href="/Qoderian/img/favicon.svg"> via headTags. themeConfig.favicon was tried first and produced no output in the built HTML; headTags matches how the sibling site does it. The href is absolute because headTags hrefs are emitted verbatim and a relative one 404s under /docs/.

Test plan

  • npm run build succeeds for en and zh-Hans
  • Built HTML of both locales contains the absolute icon link; built img/favicon.svg carries the media query and no currentColor
  • Rendered the mark at 16/32/64 px on light and dark backgrounds to check legibility
  • After deploy, open the site and toggle the OS appearance to confirm the tab icon flips

luoxuanzao and others added 2 commits September 30, 2026 00:42
Chat apps such as DingTalk render the site icon as the link card
thumbnail; the site emitted no favicon at all, so cards showed an
empty slot while sibling sites on the same domain showed theirs.

Co-authored-by: QoderAI (Qwen 3.8 Max) <[email protected]>
A favicon has no surrounding text color for currentColor to inherit,
so the synced icon now carries a prefers-color-scheme block: black
mark on light browser chrome, white on dark, mirroring how the plugin
icon picks up the vault theme.

Co-authored-by: QoderAI (Qwen 3.8 Max) <[email protected]>
@luoxuanzao
luoxuanzao merged commit ed423ae into main Sep 30, 2026
10 checks passed
@luoxuanzao
luoxuanzao deleted the docs/favicon branch September 30, 2026 00:03
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.

1 participant