fix(build): restore CDS Shiki highlighting on the HANA publish path (#1657) - #1661
Merged
Conversation
…1657) Hugo maps ```cds to the Chroma SQL lexer as a placeholder (Chroma has no CDS lexer), which flags CDS braces as illegal -> red <span class=err>{. scripts/highlight-cds.ts (Shiki + community cds.tmLanguage.json) is meant to replace those blocks, but rebuild-content.yml builds Hugo directly (not build:all) and never ran it after it was dropped from the path pre-#591, so every content rebuild republished the Chroma-SQL fallback to HANA. - rebuild-content.yml: add 'Highlight CDS code blocks (Shiki)' step after the Hugo build, in all modes. - rebuild-content-qa.yml: same, pointed at hugo/public-qa. - highlight-cds.ts: accept --dir/HIGHLIGHT_DIR (default hugo/public) so the QA publishDir is supported; fail the run if the data-lang=cds marker is present but zero blocks matched (guards against silent markup drift). Live PROD fix requires a full rebuild run once merged.
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.
Fixes #1657 — CDS code blocks render with braces highlighted as illegal characters.
Root cause
Hugo's
render-codeblock.htmlmaps```cds→ the Chroma SQL lexer as a placeholder (Chroma ships no CDS lexer) and tags the wrapperdata-lang=cds. The SQL lexer flags CDS braces as illegal →<span class=err>{(the red braces in the issue screenshot).scripts/highlight-cds.ts(Shiki + the communitycds.tmLanguage.jsongrammar) is supposed to replace those blocks with correct CDS highlighting in a post-build pass.That pass runs in
build:all(local +deploy.yml), so a local build is correct. Butrebuild-content.yml— the canonical DEV/PROD content publish path — builds Hugo directly (/tmp/hugo --source hugo --minify), notbuild:all, and never runsbuild:highlight. It was dropped from this path pre-#591 (see the comment incontent-drift-check.yml). So every content rebuild republished the Chroma-SQL fallback straight to HANA.Evidence: live
cap-status-transition-flows= 0shiki, 15class=err, 3data-lang=cdsblocks; the locally-built page (viabuild:all) = 298shiki, 0language-sql, blocks correct. Same failure class as the island-manifest / vendor / explore / joule steps previously retrofitted into this workflow.Changes
rebuild-content.yml: addHighlight CDS code blocks (Shiki)step after the Hugo build, runs in all modes (slug-targeted included).rebuild-content-qa.yml: same, pointed athugo/public-qa(the QApublishDir).scripts/highlight-cds.ts: accept--dir/HIGHLIGHT_DIR(defaulthugo/public) so the QA dir is supported; fail the run if thedata-lang=cdsmarker is present but zero blocks matched — guards against silent markup drift regressing this again.Verification
<pre class="shiki …">with braces as normal punctuation (noclass=err, nolanguage-sql).Post-merge action required
This corrects the pipeline; it does not retroactively fix already-published HANA content. Once merged, trigger a full rebuild to republish with highlighting: