Add shortcodes (repo cards, code import, mailto, more) + image zoom - #6
Merged
Conversation
Add github/gitlab/huggingface shortcodes sharing one .repo-card component, each auto-fetching live stats at build time with manual override and graceful fallback if the API call fails. Add a code shortcode to import a local file or remote URL (line-range + language override) instead of pasting code inline, a gist shortcode (Hugo's built-in was removed in v0.156), and a swatches shortcode for labelled colour chips. Demoed in exampleSite's hello-world post. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01K5qPo8jfbbrvWKrWQyZ8iK
Images now render borderless. Clicking one opens a full-size view via a pure-CSS :target lightbox (no JS) — click the backdrop to close. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01K5qPo8jfbbrvWKrWQyZ8iK
…bluesky - mailto: obfuscated mailto link with optional subject/text. HTML entity-encoding alone doesn't survive Hugo's --minify pass (it decodes entities back to plaintext), so the real link is base64'd into data attributes and assembled by a few lines of inline JS on load — the one shortcode in the theme that needs JS. - admonition, details: themed callout box and native <details> wrapper. - badge: inline pill using the pop palette. - npm, crates, pypi: package cards reusing the .repo-card component, same live-fetch-with-fallback pattern as github/gitlab/huggingface. - bluesky: post card via Bluesky's public AppView API (no auth needed, unlike X/Twitter which requires a developer key for read access — no equivalent tweet shortcode for that reason). - Minimal theming for goldmark's native footnote markup (no shortcode needed, it's already a markdown feature). All demoed in exampleSite's hello-world post. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01K5qPo8jfbbrvWKrWQyZ8iK
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
github/gitlab/huggingface/npm/crates/pypi(package/repo cards, live build-time fetch with fallback),code(import local file or URL, line ranges),gist,bluesky,swatches,admonition,details,badge,mailto(obfuscated, base64+JS since HTML-entity encoding doesn't survive Hugo's--minify).:targetlightbox (no JS).exampleSite/content/posts/hello-world.md.Test plan
pnpm buildcleanmailto:href in-browser (no plaintext address in source)🤖 Generated with Claude Code
https://claude.ai/code/session_01K5qPo8jfbbrvWKrWQyZ8iK