Fix zh-Hans front matter delimiter so four Chinese pages stop rendering as raw source - #476
Open
eastagiletracker wants to merge 1 commit into
Conversation
…as source Four Chinese pages open with a ```markdown fence where the front matter delimiter should be, and close with a matching fence at EOF, so Docusaurus wraps the whole document in a code block instead of parsing it. On the two pages the build routes today the title falls back to the source filename, sidebar_position is dropped and the meta description is lost.
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.
This PR proposes fixing the four
zh-Hansdocumentation pages whose front matter opens with a triple-backtickmarkdownfence instead of---, so Docusaurus parses them as pages again instead of wrapping each whole document in a code block. We include this PR work along with a full history of your repo at https://eastagiletracker.com/projects/379. You can sign in with your GitHub ID to claim ownership of the project.What is broken
Four files under
i18n/zh-Hans/docusaurus-plugin-content-docs/current/begin with a triple-backtickmarkdownfence on line 1, where the YAML front-matter delimiter---belongs, and close with the matching fence at end of file. Docusaurus therefore never parses any front matter:sidebar_positionis dropped, the page title falls back to the source filename, thedescriptionmeta tag is lost, and the whole document is rendered inside a singlelanguage-markdowncode block.Two of the four are routed by the build today, and both are live on docs.codegpt.co right now:
Both pages render
<h1>unit_testing</h1>and<h1>generate_unit_test</h1>— the source filename, in English — followed by the entire translation as a syntax-highlighted code block, and the first one serves nodescriptionmeta tag at all. The other two files,tutorial-features/vision.mdandtutorial-features/stackoverflow.md, carry the identical defect but have no English source page, so the build does not route them yet; they are fixed here as well so the same breakage does not reappear when those pages come back.The change
Line 1 of each file becomes
---, and the trailing fence that wrapped the document is removed. Nothing else is touched — 4 lines changed, 4 lines removed, no translated text edited, no other locale affected.How it was verified
Reproduced on a clean clone of
mainata08f6dc, before any edit:Then on the same tree with this change applied:
npm run buildexits 0 both before and after, emits the same 256 pages, and prints a byte-identical set of broken-link warnings, so the pre-existing ones are untouched and nothing new goes red. Alongside the titles, both pages emit theirdescriptionmeta tag again, their bodies render as documentation rather than as a code block, and the Chinese sidebar entry changes fromunit_testingto单元测试withsidebar_position: 8honoured, which restores the same ordering the English page uses.How this was managed
We imported this repository's issues and pull requests into a live board and used it to run this fix: the work is tracked as its own story on the board, alongside the 453 stories imported from your issues and pull requests.
If you'd rather not receive contributions like this, reply
no-more-prson this pull request and we won't open any further ones on your repositories.Lawrence W. Sinclair
CEO / East Agile
linkedin.com/in/lwsinclair/
eastagile.com