fix(docs): fix version regex in assemble-versions.sh#1377
Open
hkad98 wants to merge 2 commits intogooddata:masterfrom
Open
fix(docs): fix version regex in assemble-versions.sh#1377hkad98 wants to merge 2 commits intogooddata:masterfrom
hkad98 wants to merge 2 commits intogooddata:masterfrom
Conversation
…inor dirs The regex '^[0-9]+$' only matched pure integers but version directories are major.minor (e.g. 1.60). This caused the "promote to latest" step to find nothing, breaking the latest symlink. Updated to match the original generate.sh pattern '^[0-9]+\.[0-9]+$'. jira: trivial risk: nonprod
Add partialCached to three hot paths identified via --templateMetrics. head-css.html: SCSS compilation was repeated for all 860+ pages despite identical output. Pass .Site as context so partialCached shares a single cache entry (100% hit rate, was 0%). structureddata.looker.html: iterated ALL site pages to build a title list on every page render, O(n^2) total work. Extract the computation into a cached capital-titles.html partial (84s to 4s). sidebar.html: SVG chevron icon was loaded, minified, and string-replaced inside the recursive nav template (~15k invocations). Extract into cached chevron-svg.html partial (100% hit rate). Verified locally: before/after HTML output is byte-identical (diff -rq). Build time on 864 pages: 18.5s to 13.1s (29% faster). JIRA: trivial risk: nonprod
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
Fix regex in
assemble-versions.shthat finds the highest version directory to promote to/latest. The previous pattern^[0-9]+$only matched pure integers, but version directories aremajor.minor(e.g.1.60). This caused the "promote to latest" step to find nothing, resulting in no/latestdirectory and a broken doc site. Updated to^[0-9]+\.[0-9]+$to match the originalgenerate.shbehavior.Cache three hot Hugo template partials identified via
--templateMetrics, reducing build time by 29% (18.5s to 13.1s on 864 pages):head-css.html: SCSS compilation repeated for all 860+ pages despite identical output. Pass.Siteas context sopartialCachedshares a single cache entry.structureddata.looker.html: iterated all site pages to build a title list on every render (O(n^2)). Extracted into a cachedcapital-titles.htmlpartial (84s to 4scumulative).
sidebar.html: SVG chevron icon loaded, minified, and string-replaced ~15k times inside the recursive nav template. Extracted into a cachedchevron-svg.htmlpartial.