Repository navigation
fix: label auto versions like Docusaurus, resolve blog routes in prefixed versions, run every test - #93
Merged
Conversation
…refixed versions - versions: 'auto' labels the current docs 'Next' and every other version by its name unless versions.<name>.label is set, matching plugin-content-docs getVersionLabel. - Blog posts match blog routes regardless of the version's route prefix, so an explicit versions array with no root version links the blog's real /blog/... routes. - Add tests/test-versions-edges.js for both cases. - Wire every test in tests/ into npm test. Fix test-individual-markdown- generation (lost its `result` bindings), test-draft-filtering (Docusaurus reads draft: "true" as a draft), and tests that never failed or reimplemented lib logic (double-slash-url, numbered-prefixes, path-bounds-checking, description-extraction, route-resolution-helpers, path-transformation-ignore, ignore-path-with-draft); run test-pattern-matching in a temp site instead of test-docs/. - Delete test-array-bounds-checking, test-description-truncation and test-refactored-route-helpers: they test local copies of lib helpers whose real behavior other wired tests cover.
Docusaurus validates draft as a Joi boolean with conversion, which reads the string true case-insensitively ("TRUE", "True"). Match that.
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.
versions: 'auto', the current docs are labeledNext, as Docusaurus labels them (getVersionLabelin@docusaurus/plugin-content-docs), unlessversions.current.labelis set.versionsarray where no version writes to the root, blog posts in the first version linked to file-based URLs because the version's route prefix filtered out blog routes. Blog files now match blog routes in every version.draft: "TRUE"page (any letter case) is a draft, matching Docusaurus's boolean conversion.tests/runs undernpm test(85, up from 65).test-individual-markdown-generation.jswas broken by the lint cleanup in chore: add oxlint and oxfmt, fix findings, format the repo #81, which removed tworesultbindings it still used. Other unwired tests were fixed to call the real lib and fail on mismatches, and three tests that only checked copies of the source logic were removed.tests/test-versions-edges.jscovers the label and blog cases. Real Docusaurus builds of a versioned site with anfrlocale have 0 broken links across five version configurations. The docs site output is unchanged apart from the edited sentence inmulti-version.md.