feat: fix wrong path prefixes when using multiple docsDirs - #67
feat: fix wrong path prefixes when using multiple docsDirs#67puehringer wants to merge 1 commit into
Conversation
) Each file now resolves its own docsDir section for URL prefixing, route matching, and output paths, instead of reusing the first section's path everywhere. Same-named files across sections no longer collide on the same route. blogDir/blogRouteBasePath options replace the hardcoded 'blog' routeBasePath (defaults unchanged). Co-authored-by: Michael Pühringer <puehringer@users.noreply.github.com>
|
Merged onto main in 7e29899 (squash, conflict resolution against #61/#62/#63 done on my side — README section retargeted into docs/configuration.md). Your multi-docsDir fixes are live: per-section URL prefixing, per-section route scoping (no more same-name collisions), and the blogDir/blogRouteBasePath options. Thank you — solid diagnosis of the first-section collapse. |
|
Merged as 7e29899 (squash-merged onto main with attribution to @puehringer) — the fork declined maintainer pushes, so the branch's content was landed manually after resolving conflicts with the recent README split and absolute-slug fixes. The per-file section resolution, section-scoped routes, and blogDir/blogRouteBasePath options are all live on main, covered by the test suite, and documented in docs/configuration.md. Thanks for the thorough fix! |
Summary
Fixes multiple bugs where
docsDirconfigured as an array of sections only worked correctly for the first section. Root cause: the plugin collapsed multi-section config down to a singledocsDirstring internally and reused it everywhere instead of resolving each file's own section.routeBasePath, only the first section had its path correctly stripped from generated URLs; every other section leaked its raw directory into the output.-2suffixed duplicate in the wrong section.routeBasePathwas hardcoded - the plugin assumed the blog always lives atblog, breaking output whenpresets.blog.routeBasePathis customized. AddedblogDir/blogRouteBasePathoptions (defaulting to the previous behavior) to make this configurable.Testing
Added regression tests covering all three scenarios; verified they fail on the pre-fix code and pass after. Existing test suites still pass - no behavior change for single-section (string
docsDir) configs.