fix: skip the navigation script tag during schema generation - #128
Merged
Conversation
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
Contributor
There was a problem hiding this comment.
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 inlayouts/_default/baseof.htmlbehindnot .Site.Params.schemaGenerationMode. - Improve the actionable
errorfguidance whennavigationoutput 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
force-pushed
the
fix/schema-generation-navigation-guard
branch
from
August 20, 2026 12:58
bed98a8 to
9e51712
Compare
kelvinmanley
approved these changes
Aug 20, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
Guards the navigation script tag in
baseof.htmlwithschemaGenerationMode, the same discriminatorsingle.html,list.htmland the schema generator already use.Why is this change needed?
v0.24.0 (#127) made the
navigationoutput format mandatory, with a harderrorfwhen the home page doesn't emit it.make frontmatterlayersdependencies.config.yml, which setsoutputs.home: [FrontmatterSchema]. Hugo replaces a kind's output list rather than merging it, soNavigationis gone, pages still render throughbaseof.html, and the build dies. Brokemake frontmatterin all 12 modules with adependencies.config.yml(CI: tech-factbook-docs run32368806014; 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.
errorfstays 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
replacefor this branch, then in a module with adependencies.config.yml:Both gates pass on
tech-factbook-docs,span-handbook-docs, andpresidium-docs-opensource.🤖 Generated with Claude Code