build: preserve handlebars placeholders in code snippets#284
Merged
Conversation
GitHub Pages renders the markdown via Jekyll/Liquid, which uses the
same {{ ... }} / {% ... %} syntax that several tutorial code snippets
need to display verbatim (e.g. {{appTitle}} and {{appDescription}} in
manifest.json examples). Without escaping, Liquid replaces them with
empty strings on the published page.
Wrap fenced code blocks and inline code spans with {% raw %} ... {% endraw %}
in rewriteLinks() before writing the README.md files to dist/. Inline
spans are only wrapped when they actually contain {{ or {% to keep the
output minimal. The downloadable source copies under dist/<tutorial>/steps
are not touched, so the unzipped projects keep the original UI5 i18n
placeholders intact.
Contributor
Author
|
@jnsttl - once you reviewed the change it will be merged |
jnsttl
approved these changes
Jun 1, 2026
jnsttl
approved these changes
Jun 1, 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.
Problem
The published READMEs under
dist/<tutorial>/build/<step>/README.mdare rendered by GitHub Pages via Jekyll/Liquid. Liquid uses the same{{ ... }}/{% ... %}syntax that several tutorial code snippets need to display verbatim — most notably the UI5 i18n placeholders{{appTitle}}and{{appDescription}}inmanifest.jsonexamples (e.g. walkthrough/steps/10). Without escaping, Liquid silently replaces them with empty strings on the published page.Fix
Add an
escapeCodeBlockshelper in tools/builder/prepare-gh-pages.js and call it fromrewriteLinks()before each README is written todist/:~~~) get a surrounding `{% raw %}` / `{% endraw %}` pair.{{or{%, to keep the output minimal.The downloadable source copies under
dist/<tutorial>/steps/(which are zipped and offered for download) are not touched, so unzipped tutorial projects keep their original UI5 i18n placeholders intact.Verification
After running
npm run build:{{appTitle}}) is now wrapped in{% raw %}/{% endraw %}.