Repository navigation
fix(rebuild): propagate deployed CSS hash + real xref titles to HANA pages - #3092
Merged
Merged
Conversation
…pages Two gaps found while verifying the directive-demo fixes on DEV: 1. sync-approuter-css.cjs self-perpetuating stale-hash loop: a CSS-only SOURCE change ships on deploy (build:css rotates the fingerprinted file, which IS served), but every rebuild re-pins the OLD hash it scrapes from still-stale HANA pages — so the new CSS never reaches published pages. Fix: build from source first, and if the approuter already SERVES the source-built hash (200), keep the source build. This propagates the new CSS AND cannot 404 (the deploy shipped that exact file). Falls through to the #2920 sync path unchanged when source is ahead of the deploy (preserves the anti-drift invariant). 2. xref/prereq cards rendered the raw slug instead of the tutorial title on slug-targeted rebuilds — the referenced tutorial's <slug>.md isn't fetched to CACHE_DIR, so catalogBySlug fell back to slug-as-title. Fix: thread tutorials[].title through fetchBuildCatalog → CatalogTutorialMeta, and seed catalogBySlug from the CAP catalog titles (on-disk frontmatter still overrides where cached). The CAP /build/catalog carries a title for EVERY slug. Verified against live DEV: source CSS hash 863da9b0 (console line-wrap fix) is served 200 by the approuter → prefer-source path keeps it. 70/70 directive + catalog tests pass.
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.
Summary
Follow-up to #3091. Verifying the directive-demo fixes on DEV surfaced two rebuild-pipeline gaps that blocked the fixes from reaching HANA-served pages:
1.
sync-approuter-css.cjsself-perpetuating stale-hash loopA CSS-only source change ships on deploy (
build:cssrotates the fingerprinted file, and the new file is served), but the rebuild's CSS-sync step scrapes the served hash from a live page, re-pins Hugo to it, and republishes — and since all pages are HANA-served and stale, it re-pins the old hash forever. The console line-wrap fix (863da9b0…) deployed but every page kept referencing9dbb07c7….Fix: build from source first; if the approuter already serves the source-built hash (200), keep the source build. Propagates the new CSS and cannot 404 (the deploy shipped that exact file). Falls through to the unchanged #2920 sync path when source is ahead of the deploy — preserving the anti-drift invariant that step exists for.
2. xref / prereq cards showed raw slug instead of title
On slug-targeted rebuilds the referenced tutorial's
<slug>.mdisn't fetched toCACHE_DIR, socatalogBySlugfell back to slug-as-title. Fix: threadtutorials[].titlethroughfetchBuildCatalog→CatalogTutorialMeta, and seedcatalogBySlugfrom the CAP/build/catalogtitles (every slug has one). On-disk frontmatter still overrides where cached.Verification
863da9b0…(the fix) is served 200 by the approuter → prefer-source path keeps it.Next
After merge → DEV, a content rebuild for the 4 directive demos will finally land the console-scroll CSS + real xref/prereq titles on DEV. Then DEV→main + PROD.