Skip to content

Add shortcodes (repo cards, code import, mailto, more) + image zoom - #6

Merged
jjsnack merged 3 commits into
mainfrom
feat/shortcodes-and-image-zoom
Jul 28, 2026
Merged

Add shortcodes (repo cards, code import, mailto, more) + image zoom#6
jjsnack merged 3 commits into
mainfrom
feat/shortcodes-and-image-zoom

Conversation

@jjsnack

@jjsnack jjsnack commented Jul 28, 2026

Copy link
Copy Markdown
Owner

Summary

  • New shortcodes: 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).
  • Images: no border, click-to-zoom via a pure-CSS :target lightbox (no JS).
  • Themed goldmark's native footnote markup (no shortcode needed).
  • All demoed in exampleSite/content/posts/hello-world.md.

Test plan

  • pnpm build clean
  • Verified live API data in built HTML for github/gitlab/huggingface/npm/crates/pypi/bluesky/gist
  • Verified mailto link decodes to correct mailto: href in-browser (no plaintext address in source)
  • Verified image zoom lightbox opens/closes in-browser

🤖 Generated with Claude Code

https://claude.ai/code/session_01K5qPo8jfbbrvWKrWQyZ8iK

jjsnack and others added 3 commits July 28, 2026 15:05
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
@jjsnack
jjsnack merged commit 8955ef5 into main Jul 28, 2026
1 check passed
@jjsnack
jjsnack deleted the feat/shortcodes-and-image-zoom branch July 28, 2026 05:38
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