Skip to content

hextra shortcodes - #113

Merged
leecalcote merged 1 commit into
masterfrom
hextra
Apr 2, 2026
Merged

hextra shortcodes#113
leecalcote merged 1 commit into
masterfrom
hextra

Conversation

@simihablo

@simihablo simihablo commented Apr 2, 2026

Copy link
Copy Markdown

New shortcakes from hextra

Signed-off-by: Lee Calcote <lee.calcote@layer5.io>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Adds an (currently draft) content page showcasing Hextra shortcodes and updates local tooling/configuration to support rendering and development.

Changes:

  • Enables Goldmark raw HTML rendering in hugo.yaml and suppresses the related warning log.
  • Updates go.mod to use a local replace for academy-theme and bumps the referenced version.
  • Adds a draft “Hextra Shortcodes Examples” page plus a .claude Hugo dev launch configuration.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 5 comments.

File Description
hugo.yaml Enables Goldmark unsafe rendering (raw HTML) and suppresses the raw-HTML warning log.
go.mod Switches academy-theme to a local filesystem replace (and updates version reference).
content/hextra-shortcodes-examples/index.md New draft page exercising Hextra shortcodes (includes some raw HTML notes).
.claude/launch.json Adds a Hugo dev launch configuration for local preview.

💡 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

Copilot AI Apr 2, 2026

Copy link

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 v0.4.2 => ../academy-theme directive is now active, which will break builds for anyone who doesn’t have a sibling ../academy-theme directory (including CI and downstream users). If this is only for local theme development, keep it commented out or move it to a developer-only workflow (e.g., documented local instructions, a separate go.work, or an uncommitted override).

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.
Comment thread hugo.yaml
Comment on lines +4 to +9
ignoreLogs: ['warning-goldmark-raw-html']

markup:
goldmark:
renderer:
unsafe: true

Copilot AI Apr 2, 2026

Copy link

Choose a reason for hiding this comment

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

goldmark.renderer.unsafe: true enables rendering of raw HTML in Markdown (and ignoreLogs suppresses related warnings). This widens the XSS/content-injection surface if untrusted or externally-sourced Markdown ever enters the build. If the goal is only to support a few styled notes in the shortcode example page, prefer replacing those raw <p> blocks with Markdown/shortcodes or confine unsafe to a dev-only config (e.g., environment-specific config override) rather than enabling it globally.

Suggested change
ignoreLogs: ['warning-goldmark-raw-html']
markup:
goldmark:
renderer:
unsafe: true
markup:
goldmark:
renderer:

Copilot uses AI. Check for mistakes.
Comment on lines +8 to +12
This page exercises every shortcode ported from the [Hextra](https://imfing.github.io/hextra/docs/guide/shortcodes/) Hugo theme. All shortcodes are invoked with the `hextra/` prefix.

{{< alert type="note" title="Test Page: Not for Production" >}}
This page will not be published in the production version of the site. It is only visible during local preview and serves as a rendering test for the Hextra shortcodes.
{{< /alert >}}

Copilot AI Apr 2, 2026

Copy link

Choose a reason for hiding this comment

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

The text says “All shortcodes are invoked with the hextra/ prefix”, but this page immediately uses the non-namespaced alert shortcode. Either adjust the wording to clarify that alert comes from the Academy theme (and Hextra shortcodes are namespaced), or switch the notice to a hextra/* equivalent to keep the claim accurate.

Copilot uses AI. Check for mistakes.
Comment on lines +236 to +239
```

<p class="text-body-secondary"><em>Supply a valid PDF path in the shortcode above to test rendering.</em></p>

Copilot AI Apr 2, 2026

Copy link

Choose a reason for hiding this comment

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

This raw HTML block (<p class="text-body-secondary">…) requires enabling Goldmark unsafe rendering to display as intended. To avoid needing global markup.goldmark.renderer.unsafe: true, consider rewriting these notes in pure Markdown (italics/blockquote) or using an existing shortcode/component for secondary text styling.

Copilot uses AI. Check for mistakes.
Comment thread .claude/launch.json
Comment on lines +6 to +10
"runtimeExecutable": "/usr/local/bin/hugo",
"runtimeArgs": ["server", "-D", "--port", "1314"],
"port": 1314,
"env": {
"PATH": "/usr/local/go/bin:/usr/local/bin:/usr/bin:/bin"

Copilot AI Apr 2, 2026

Copy link

Choose a reason for hiding this comment

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

This launch config hardcodes macOS/Homebrew-style paths (/usr/local/bin/hugo and a full PATH override). That makes the config non-portable (Linux, Windows, Apple Silicon/Homebrew in /opt/homebrew, etc.) and can also inadvertently hide the user’s existing PATH entries. Prefer using runtimeExecutable: "hugo" and omitting the env.PATH override (or appending to ${env:PATH}) so it works across environments.

Suggested change
"runtimeExecutable": "/usr/local/bin/hugo",
"runtimeArgs": ["server", "-D", "--port", "1314"],
"port": 1314,
"env": {
"PATH": "/usr/local/go/bin:/usr/local/bin:/usr/bin:/bin"
"runtimeExecutable": "hugo",
"runtimeArgs": ["server", "-D", "--port", "1314"],
"port": 1314,
"env": {
"PATH": "${env:PATH}:/usr/local/go/bin"

Copilot uses AI. Check for mistakes.
@leecalcote
leecalcote merged commit a1288dd into master Apr 2, 2026
6 checks passed
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