Lighting Up GitHub Embeds in My Eleventy Blog
For the longest time, sharing code from GitHub meant screenshotting or pasting raw snippets into Markdown. Both options felt brittle—screenshots hide the text from RSS readers, while copy-pastes drift out of sync the minute the upstream file changes. I wanted the readability of Emgithub, the SEO of server-side rendering, and zero third-party JavaScript.
That mix finally landed this week: a {% github %}
shortcode that fetches code at build time, highlights it, numbers each line, and offers a copy button. All it needs is the GitHub blob URL and an optional style flag for light or dark chrome.