Skip to content

docs: render emoji shortcodes on the documentation site - #141

Merged
allen0099 merged 1 commit into
masterfrom
docs/render-emoji-shortcodes
Sep 25, 2026
Merged

allen0099 merged 1 commit into
masterfrom
docs/render-emoji-shortcodes

Conversation

@allen0099

Copy link
Copy Markdown
Owner

Problem

The Cache-Control directive tables in docs/HTTP_CACHING.md and docs/README.zh-TW.md mark support with :white_check_mark: and :x:. GitHub renders these shortcodes, but the documentation site printed them as literal text, because pymdownx.emoji was not enabled in zensical.toml.

Change

Enable pymdownx.emoji with Zensical's twemoji index and the pymdownx.emoji.to_alt generator. Shortcodes become the Unicode characters (✅ / ❌), so the site matches GitHub.

I tried the to_svg generator first and did not keep it: it emits an <img> for every emoji loaded from cdn.jsdelivr.net, which adds a third-party request for two symbols.

The Markdown sources are unchanged, so GitHub rendering is unaffected.

Verification

  • zensical build --strict passes.
  • I diffed the built site before and after this change, ignoring the search index and sitemap. Only HTTP_CACHING/ and README.zh-TW/ differ, and every difference is a shortcode turned into ✅/❌. Colon-delimited text such as cache:user:* is left alone.
  • The built pages contain no cdn.jsdelivr.net reference and no remaining literal :white_check_mark: text.

The Cache-Control directive tables use ✅ and ❌, which
GitHub renders but the site printed as literal text because pymdownx.emoji
was not enabled. Enable it with the Unicode output, so no images are loaded
from a CDN.
@allen0099
allen0099 merged commit c4d39cf into master Sep 25, 2026
2 checks passed
@allen0099
allen0099 deleted the docs/render-emoji-shortcodes branch September 26, 2026 11:49
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