Closes #62
sequoia injectmatched HTML files against a flat slug map and took the first hit, so a Zola article withslug = "blog"undercontent/blog/2024-12-17-blog/tagged the section indexblog/index.htmlas well as the real article atblog/blog/index.html.- Matching now builds ranked candidate routes per post, and each post claims only the files matching its most specific candidate:
pathPrefix+ slug (the canonical URLpublishcomputes) > source section dir + slug's last segment > the slug itself > the slug's last segment anywhere in the tree. - Page bundles (
index.md/_index.md) resolve to their parent directory and the slug replaces the last path segment, matching Zola/Hugo semantics — so the fix holds even whenpathPrefixdoesn't describe the output. - A file claimed equally well by two posts is now skipped with a warning instead of receiving an arbitrary URI.
pathTemplatesites skip thepathPrefixrank (the template can't be resolved from state) and fall through to the lower ranks as before. - Matching moved out of the command handler into pure exported functions (
matchPostsToHtmlFiles,collectPublishedPosts,getHtmlRoute); 13 new tests cover the issue scenario and the fallbacks. - Verified against real Zola 0.22.1 builds: the issue's layout now tags only
blog/blog/index.html, re-runs stay idempotent,--dry-runwrites nothing, and a second site with non-bundle pages, pagination, taxonomies, and colliding filenames produces output identical to before the change.