From 90deea94088c15861bec979ed355217b5efabdff Mon Sep 17 00:00:00 2001 From: James Jiang Date: Tue, 28 Jul 2026 15:56:12 +1000 Subject: [PATCH] docs: shortcode reference post MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit One page documenting every shortcode the theme ships — syntax, params, and a live rendered example each. Complements hello-world's kitchen-sink demo with something scannable when you just need the call signature. Co-Authored-By: Claude Sonnet 5 Claude-Session: https://claude.ai/code/session_01K5qPo8jfbbrvWKrWQyZ8iK --- exampleSite/content/posts/shortcodes.md | 205 ++++++++++++++++++++++++ 1 file changed, 205 insertions(+) create mode 100644 exampleSite/content/posts/shortcodes.md diff --git a/exampleSite/content/posts/shortcodes.md b/exampleSite/content/posts/shortcodes.md new file mode 100644 index 0000000..6778563 --- /dev/null +++ b/exampleSite/content/posts/shortcodes.md @@ -0,0 +1,205 @@ ++++ +title = "Shortcode reference" +date = 2026-07-28 +draft = false +topics = ["Reference"] ++++ + +Every shortcode the **basic** theme ships, with syntax and a live example. +Most take either positional or named params — never both mixed in the same +call (a Hugo restriction, not this theme's). + +## Repo & package cards + +`github`, `gitlab`, `huggingface`, `npm`, `crates`, `pypi` all render the same +`.repo-card` component. Each fetches live metadata from the relevant API at +build time and falls back to a bare link card if the fetch fails — pass the +override params to skip the network call entirely. + +### github + +``` +{{}} +{{}} +``` + +{{< github "gohugoio/hugo" >}} + +### gitlab + +``` +{{}} +{{}} +``` + +{{< gitlab "gitlab-org/gitlab" >}} + +### huggingface + +``` +{{}} +{{}} +{{}} +``` + +{{< huggingface "bert-base-uncased" >}} + +### npm + +``` +{{}} +{{}} +``` + +{{< npm "left-pad" >}} + +### crates + +``` +{{}} +{{}} +``` + +{{< crates "serde" >}} + +### pypi + +``` +{{}} +{{}} +``` + +{{< pypi "requests" >}} + +## Code & content embeds + +### code + +Imports a local file or a remote URL instead of pasting code inline, so it +never drifts out of sync with the source. Optional `lines="12-34"` (1-indexed, +inclusive) and `lang=` (guessed from the extension otherwise). + +``` +{{}} +{{}} +{{}} +``` + +{{< code file="assets/js/console.js" lines="1-8" >}} + +### gist + +Hugo's built-in `gist` shortcode was removed in v0.156. This one fetches the +gist via the GitHub API and renders it with the theme's own Chroma +highlighting instead of GitHub's unstyled `