fix(imported-docs): load config and keep imported page structure - #56
Merged
Conversation
The importedDocs section was never read by the config loader, so pushedDocsDir, pullSources and s3Sources were always empty and the plugin could not be enabled from appsettings.json at all. Imported pages also bypassed the conventions discovered pages follow: ComputeUrl flattened every source subdirectory onto destinationPath via Path.GetFileName, emitted a leading slash that no other page has, and never collapsed index.md onto its directory. Front matter went through a hand-rolled line splitter that dropped list values and ignored nav_title/page_title/tag_title, and S3 pages were created without an OutputPath. Imported pages now route through ContentDiscovery.UrlFor and FrontMatter.Split, so nesting, index collapsing, slugify.urls and full YAML front matter behave the same as for local docs.
… nav RelativePath drives the navigation tree, the .pages lookup and the internal link map, but imported pages kept their source-relative path while only Url was rewritten. A source subdirectory therefore surfaced as its own top-level nav section instead of nesting under destinationPath, and an imported index.md was dropped from the nav entirely. RelativePath is now derived from the same combined path as Url, so a .pages file in the corresponding directory of the host docs tree titles and orders the imported section.
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.
The importedDocs section was never read by the config loader, so pushedDocsDir, pullSources and s3Sources were always empty and the plugin could not be enabled from appsettings.json at all.
Imported pages also bypassed the conventions discovered pages follow: ComputeUrl flattened every source subdirectory onto destinationPath via Path.GetFileName, emitted a leading slash that no other page has, and never collapsed index.md onto its directory. Front matter went through a hand-rolled line splitter that dropped list values and ignored nav_title/page_title/tag_title, and S3 pages were created without an OutputPath.
Imported pages now route through ContentDiscovery.UrlFor and FrontMatter.Split, so nesting, index collapsing, slugify.urls and full YAML front matter behave the same as for local docs.
What & why
Type of change
Checklist
dotnet format Netdocs.slnx --verify-no-changespassesdotnet build Netdocs.slnx -c Releasesucceedsdotnet test Netdocs.slnx -c Releasepassesdocs-site/docs/**if behavior changedNotes for reviewers