Repository navigation
fix(migrate): keep MkDocs nav to the nav block - #285
Merged
Merged
Conversation
parseMkDocsNav read to the end of mkdocs.yml, so every item under plugins: and markdown_extensions: became a sidebar entry. index.md pages were linked as index/ (not generated, 404), and quoted titles and paths kept their quotes. Stop at the next top-level key, map index.md to its folder ('/' for the root) and drop the quotes. The N-9 check now expects the Home path '/' instead of index/.
Member
|
Merged and available in v0.10.1. This properly bounds Thank you @jayhemnani9910 for the clean fix and test coverage! |
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.
Description
docmd migrate --mkdocsbuilds a broken sidebar from a typicalmkdocs.yml:Before:
index/and Overview toguide/index/.docmd builddoes not generate those pages (index.md is served at its folder), so both links 404.search,tags,admonitionandtocshow up as sidebar entries:parseMkDocsNavreads to the end of the file, so every- itemunderplugins:andmarkdown_extensions:is added.'Change Log'keeps its quotes in the title (and a quoted file keeps them in the path).After: Home
/, Overviewguide/, Setupguide/setup/,Change Log→changelog/, nothing else. The nav now stops at the next top-level key,index.mdmaps to its folder (/for the root), and one level of matching quotes is removed.The N-9 check in
migrate.test.jslooked forindexin the generated nav, which matched the oldindex/path; it now expects the Home path/.Type of change
Checklist:
Added a case to
tests/cli-contracts/migrate.test.jswith the config above; it fails without the change.node tests/runner.js: 1419 passed; the one failure (Dev --host flag, ENOSPC on file watchers) fails the same way on main here.pnpm lint: no errors. Migrated and built the example above: the sidebar links resolve.