Repository navigation
refactor: move code includes, front matter edits and page naming out of GreatDocs - #488
Merged
Merged
Conversation
…t of `GreatDocs` Code include expansion, front matter option updates, reserved directory checks and published naming now live in modules outside `GreatDocs`. Page copiers call these operations, and later copying modules can reuse them without depending on the class. Fallback titles and published paths without numeric prefixes now each follow one shared rule wherever the existing copies agreed. The copies that disagree change in the commits that follow. Builds are unchanged: the Quarto project diff against main matches in all 40 cases.
A page without a title in its front matter is titled after its file name. Section and blog pages kept underscores in that title, so `my_file.qmd` showed as "My_File" in a section's sidebar and index cards, while the tags index, custom pages and the user guide showed "My File". Every fallback title now follows the rule the tags index, custom pages and the user guide already used: dashes and underscores become spaces. A section page's title also drops only the final suffix, not every `.qmd` or `.md` in its name. Blog fallback titles are used only to count posts, so only section pages show a changed title. The Quarto project diff against main matches in all 40 cases, and in all 329 cases of the full catalogue: no Gauntlet page relies on the fallback.
Without an `index.qmd`, the User Guide navbar link targets the guide's first page. The link stripped the numeric prefix from that page's file name only. Guide pages are published with prefixes stripped from every path component in auto-discovery mode and with names unchanged in an explicit guide. A first page at `01-basics/02-setup.qmd` was linked as `user-guide/01-basics/setup.qmd` but written to `user-guide/basics/setup.qmd`, and the explicit guide's `01-intro.qmd` was linked as `user-guide/intro.qmd`. Both links led to missing pages. The link now uses the published guide path. The Quarto project diff against main matches in all 40 cases, and in all 329 cases of the full catalogue: no first guide page has a path where the two rules disagree.
A `lines=` value that is neither a line number nor two numbers joined by `-`, such as `lines="a-b"`, raised an error that stopped copying the user guide, section or blog part-way. The build then reported only that the step failed, without naming the page or the include. The include is now replaced by an HTML comment that quotes the value and names the included file, and copying continues. Missing files already produce an HTML comment in this format. The Quarto project diff against main matches in all 40 cases.
…option When setting an option such as `bread-crumbs`, `toc` or `body-classes` in a user guide, blog index or blended homepage, the build split the page at the first two occurrences of `---` anywhere. A front matter value containing `---`, such as `title: A---B`, ended the block early and corrupted the page. The block now ends at the first line that starts with `---`, matching the build's front matter reader. The page's other lines keep their text. Other places that edit front matter by splitting on `---` are unchanged. The Quarto project diff against main matches in all 40 cases. Across the pages in `docs/` and the rendered Gauntlet sites, the old and new edits differ only on one rendered page whose front matter quotes `# ---`.
📚 Preview this PR's docs locallyFetch the just-built site and open it in your browser: # this exact build
great-docs preview --run 41162487593
# or always the latest build for this PR
great-docs preview --pr 488Auth & tips
|
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 moves code-include expansion, front matter option edits and the rules that name published pages and their fallback titles out of
GreatDocsinto a content package that the page copiers share.The naming rules existed as several inline copies that had drifted apart. Section and blog pages without a title kept underscores (
my_file.qmdshowed as "My_File") where the rest of the site showed "My File", and the User Guide navbar link pointed at a missing page when the guide's first page sat in a numbered subdirectory or the guide was listed explicitly. Two other bugs went with the move: a malformedlines=in a code include stopped the guide copy without naming the file, and setting a page option on a page whose front matter value contains---corrupted the page.