Skip to content

Consolidate hextra shortcodes docs into formatting examples#115

Merged
leecalcote merged 2 commits intomasterfrom
work/fervent-grothendieck
Apr 2, 2026
Merged

Consolidate hextra shortcodes docs into formatting examples#115
leecalcote merged 2 commits intomasterfrom
work/fervent-grothendieck

Conversation

@simihablo
Copy link
Copy Markdown

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

  • Moved Hextra shortcodes documentation from content/hextra-shortcodes-examples/index.md to content/content-formatting-examples/index.md
  • Updated content introduction to reflect four shortcode sources (previously three)
  • Organized Hextra shortcodes section with improved structure and clearer parameter tables
  • Added infobox highlighting angle-bracket syntax requirement for Hextra shortcodes
  • Removed dedicated Hextra examples page (now consolidated)

Result

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.

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.
Copilot AI review requested due to automatic review settings April 2, 2026 04:34
@leecalcote leecalcote merged commit 6ea5a19 into master Apr 2, 2026
5 of 6 checks passed
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.mod local 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.

Comment thread go.mod

// 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
Copy link

Copilot AI Apr 2, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
replace github.com/layer5io/academy-theme v0.4.2 => ../academy-theme
// replace github.com/layer5io/academy-theme v0.4.2 => ../academy-theme

Copilot uses AI. Check for mistakes.
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.
Copy link

Copilot AI Apr 2, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
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.

Copilot uses AI. Check for mistakes.
Renders a Jupyter Notebook (`.ipynb`) as code blocks and Markdown cells.

```text
{{%/* hextra/jupyter "notebook.ipynb" */%}}
Copy link

Copilot AI Apr 2, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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).

Suggested change
{{%/* hextra/jupyter "notebook.ipynb" */%}}
{{</* hextra/jupyter "notebook.ipynb" */>}}

Copilot uses AI. Check for mistakes.
Comment thread hugo.yaml
markup:
goldmark:
renderer:
unsafe: true
Copy link

Copilot AI Apr 2, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
unsafe: true
unsafe: false

Copilot uses AI. Check for mistakes.
Comment thread .claude/launch.json
Comment on lines +1 to +11
{
"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"
}
Copy link

Copilot AI Apr 2, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants