A CLI for publishing standard.site documents to ATProto sequoia.pub

fix: inject document URI into the generated post path, not a same-named index #197

Merged stevedylan.dev
targeting main from fix/issue62
Merged opened by and assigned to stevedylan.dev
targeting main from fix/issue62

Closes #62

  • sequoia inject matched HTML files against a flat slug map and took the first hit, so a Zola article with slug = "blog" under content/blog/2024-12-17-blog/ tagged the section index blog/index.html as well as the real article at blog/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 URL publish computes) > 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 when pathPrefix doesn't describe the output.
  • A file claimed equally well by two posts is now skipped with a warning instead of receiving an arbitrary URI. pathTemplate sites skip the pathPrefix rank (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-run writes nothing, and a second site with non-bundle pages, pagination, taxonomies, and colliding filenames produces output identical to before the change.
Commits 1

fix: closes #62