Consolidate hextra shortcodes docs into formatting examples#115
Consolidate hextra shortcodes docs into formatting examples#115leecalcote merged 2 commits intomasterfrom
Conversation
Signed-off-by: Lee Calcote <lee.calcote@layer5.io>
Merge the separate hextra-shortcodes-examples page into the main content-formatting-examples page, providing a single comprehensive reference for all content formatting and shortcode documentation.
There was a problem hiding this comment.
Pull request overview
Consolidates the Hextra shortcode documentation into the main content formatting examples page, aiming to provide a single reference for shortcode usage.
Changes:
- Adds a new “Hextra Shortcodes” section (with examples and parameter tables) to
content/content-formatting-examples/index.md. - Updates Hugo configuration to allow raw HTML rendering and suppress related warnings.
- Adds local development configuration artifacts/overrides (
go.modlocal replace,.claude/launch.json).
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 5 comments.
| File | Description |
|---|---|
content/content-formatting-examples/index.md |
Consolidates Hextra shortcode documentation and adds extensive usage examples. |
hugo.yaml |
Enables Goldmark unsafe rendering and suppresses raw-HTML warnings to support examples. |
go.mod |
Introduces an active local replace for the theme dependency. |
.claude/launch.json |
Adds a Hugo dev launch configuration (currently machine-specific). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
|
||
| // Uncomment line below when testing changes to the academy theme | ||
| // replace github.com/layer5io/academy-theme v0.1.9 => ../academy-theme | ||
| replace github.com/layer5io/academy-theme v0.4.2 => ../academy-theme |
There was a problem hiding this comment.
The replace github.com/layer5io/academy-theme ... => ../academy-theme directive is active, which will force builds (CI, other contributors) to resolve the theme from a local relative path that usually doesn’t exist. If this is only meant for local testing, it should remain commented out (or moved to a developer-local workflow), and the require should control the actual version.
| replace github.com/layer5io/academy-theme v0.4.2 => ../academy-theme | |
| // replace github.com/layer5io/academy-theme v0.4.2 => ../academy-theme |
| The shortcodes below are ported from the [Hextra Hugo theme](https://imfing.github.io/hextra/docs/guide/shortcodes/) and adapted to work with Bootstrap 5. They are all namespaced under `hextra/` to avoid conflicts with Academy, Docsy, and Hugo built-in shortcodes. | ||
|
|
||
| {{< hextra/callout type="info" >}} | ||
| All Hextra shortcodes use the **angle-bracket** syntax `{{</* */>}}` (not the percent syntax `{{%/* */%}}`). This ensures raw HTML output is preserved correctly. |
There was a problem hiding this comment.
This note states that all Hextra shortcodes must use the angle-bracket form and ties it to “preserving raw HTML,” but later sections show %-delimited examples (e.g., hextra/include, hextra/jupyter). Please make the guidance internally consistent (document any exceptions or update the examples), and consider rewording the rationale: % vs < primarily affects Markdown rendering of shortcode output/inner content, while raw HTML in Markdown is controlled by Goldmark’s renderer.unsafe setting.
| All Hextra shortcodes use the **angle-bracket** syntax `{{</* */>}}` (not the percent syntax `{{%/* */%}}`). This ensures raw HTML output is preserved correctly. | |
| For Hextra shortcodes, prefer the **angle-bracket** form `{{</* */>}}` over the percent form `{{%/* */%}}` when you want the shortcode’s output or inner content to be treated as raw HTML. Both forms are supported; the choice only affects how Hugo’s Markdown renderer processes the shortcode content, while whether raw HTML is allowed at all is controlled separately via Goldmark’s `renderer.unsafe` setting. |
| Renders a Jupyter Notebook (`.ipynb`) as code blocks and Markdown cells. | ||
|
|
||
| ```text | ||
| {{%/* hextra/jupyter "notebook.ipynb" */%}} |
There was a problem hiding this comment.
These examples use the percent-delimited shortcode syntax ({{% ... %}}), which conflicts with the earlier callout that says Hextra shortcodes must use the angle-bracket syntax. Confirm which delimiter is actually required for hextra/include and hextra/jupyter and align the examples + guidance accordingly (or explicitly call these out as exceptions).
| {{%/* hextra/jupyter "notebook.ipynb" */%}} | |
| {{</* hextra/jupyter "notebook.ipynb" */>}} |
| markup: | ||
| goldmark: | ||
| renderer: | ||
| unsafe: true |
There was a problem hiding this comment.
Enabling markup.goldmark.renderer.unsafe: true allows raw HTML in Markdown site-wide, which can introduce XSS risk if any Markdown content is ever sourced from untrusted inputs. If this is only needed for local/example pages, consider scoping it to a development-only config (e.g., config/development/*) or using a safer mechanism for the specific HTML use cases, rather than enabling unsafe rendering globally.
| unsafe: true | |
| unsafe: false |
| { | ||
| "version": "0.0.1", | ||
| "configurations": [ | ||
| { | ||
| "name": "hugo-dev", | ||
| "runtimeExecutable": "/usr/local/bin/hugo", | ||
| "runtimeArgs": ["server", "-D", "--port", "1314"], | ||
| "port": 1314, | ||
| "env": { | ||
| "PATH": "/usr/local/go/bin:/usr/local/bin:/usr/bin:/bin" | ||
| } |
There was a problem hiding this comment.
This launch config hardcodes machine-specific paths (/usr/local/bin/hugo) and overwrites PATH, so it’s unlikely to work across environments. Also, it’s not mentioned in the PR description (which focuses on documentation consolidation), so please confirm it’s intended to be committed; otherwise consider removing it from the repo or adding it to .gitignore / documenting its purpose.
Summary
Merges the dedicated Hextra shortcodes documentation page into the main content formatting examples page, consolidating all shortcode references into a single, comprehensive guide.
Changes
content/hextra-shortcodes-examples/index.mdtocontent/content-formatting-examples/index.mdResult
All content formatting guidance is now in one unified location, making it easier for users to discover and reference shortcodes across Academy Theme, Hextra, Docsy, and Hugo built-in options.