Skip to content

fix: skip the navigation script tag during schema generation - #128

Merged
Zalaras merged 1 commit into
mainfrom
fix/schema-generation-navigation-guard
Aug 20, 2026
Merged

fix: skip the navigation script tag during schema generation#128
Zalaras merged 1 commit into
mainfrom
fix/schema-generation-navigation-guard

Conversation

@Zalaras

@Zalaras Zalaras commented Aug 20, 2026

Copy link
Copy Markdown
Contributor

What does this PR do?

Guards the navigation script tag in baseof.html with schemaGenerationMode, the same discriminator single.html, list.html and the schema generator already use.

Why is this change needed?

v0.24.0 (#127) made the navigation output format mandatory, with a hard errorf when the home page doesn't emit it. make frontmatter layers dependencies.config.yml, which sets outputs.home: [FrontmatterSchema]. Hugo replaces a kind's output list rather than merging it, so Navigation is gone, pages still render through baseof.html, and the build dies. Broke make frontmatter in all 12 modules with a dependencies.config.yml (CI: tech-factbook-docs run 32368806014; deploy was skipped, production unaffected).

Fixed in the theme rather than the 12 modules so schema generation doesn't render a nav tree it discards. errorf stays an error: the blob is now the only path to a sidebar, so a warning would deploy a nav-less docset silently.

How to test

Add a local replace for this branch, then in a module with a dependencies.config.yml:

rm -rf public && hugo --ignoreCache --gc --config config.yml,dependencies.config.yml  # was exit 1
rm -rf public && hugo --printPathWarnings

Both gates pass on tech-factbook-docs, span-handbook-docs, and presidium-docs-opensource.

🤖 Generated with Claude Code

@Zalaras
Zalaras requested a review from a team as a code owner August 20, 2026 12:52
@Zalaras
Zalaras requested a review from asalvi0 August 20, 2026 12:52
@Zalaras Zalaras self-assigned this Aug 20, 2026
@Zalaras
Zalaras requested review from Gerrit-van-Niekerk, NicholasDunham, aLR8, dev-pieter, robyn-thomas and yandisakat and a lite review from Copilot and removed request for NicholasDunham, aLR8, asalvi0 and robyn-thomas August 20, 2026 12:52

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

This PR fixes make frontmatter builds by skipping inclusion of the navigation.js blob script tag when running in schemaGenerationMode, avoiding a hard failure when schema generation replaces outputs.home with only FrontmatterSchema.

Changes:

  • Guard the navigation output format lookup and <script> tag in layouts/_default/baseof.html behind not .Site.Params.schemaGenerationMode.
  • Improve the actionable errorf guidance when navigation output is missing outside schema generation.
  • Add a changelog entry documenting the fix and its impact on frontmatter schema generation builds.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
layouts/_default/baseof.html Skips nav script injection during schema generation while preserving the hard failure in normal renders.
CHANGELOG.md Documents the schema-generation navigation guard fix.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

v0.24.0 made the navigation output format mandatory, erroring in the
scripts block when the home page does not emit navigation.js. Schema
generation layers dependencies.config.yml, which replaces outputs.home
with FrontmatterSchema alone - Hugo replaces a kind's output list rather
than merging it - so the error fired on every page and killed
`make frontmatter` in all 12 consuming modules.

Guard the block with schemaGenerationMode, the same discriminator
single.html, list.html and the schema generator already use. Real builds
keep the hard error, since the blob is now the only path to a sidebar and
a missing one means every page ships without navigation.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@Zalaras
Zalaras force-pushed the fix/schema-generation-navigation-guard branch from bed98a8 to 9e51712 Compare August 20, 2026 12:58
@Zalaras
Zalaras merged commit 2dff77d into main Aug 20, 2026
2 checks passed
@Zalaras
Zalaras deleted the fix/schema-generation-navigation-guard branch August 20, 2026 13:03
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.

3 participants