Skip to content

fix(imported-docs): load config and keep imported page structure - #56

Merged
XtremeOwnageDotCom merged 2 commits into
mainfrom
fix/imported-docs-config-and-urls
Sep 2, 2026
Merged

fix(imported-docs): load config and keep imported page structure#56
XtremeOwnageDotCom merged 2 commits into
mainfrom
fix/imported-docs-config-and-urls

Conversation

@XtremeOwnageDotCom

Copy link
Copy Markdown
Contributor

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

  • Bug fix
  • New feature
  • Documentation
  • Refactor / chore

Checklist

  • dotnet format Netdocs.slnx --verify-no-changes passes
  • dotnet build Netdocs.slnx -c Release succeeds
  • dotnet test Netdocs.slnx -c Release passes
  • Added/updated tests for the change
  • Updated docs under docs-site/docs/** if behavior changed

Notes for reviewers

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.
@XtremeOwnageDotCom
XtremeOwnageDotCom merged commit a4a4438 into main Sep 2, 2026
1 check passed
@XtremeOwnageDotCom
XtremeOwnageDotCom deleted the fix/imported-docs-config-and-urls branch September 2, 2026 19:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant