fix(docs): stop sitemap listing the homepage twice - #2899
Conversation
The sitemap template hard-coded the homepage, then looped over `pages` and used `page.is_homepage` to skip it. The site builds with zensical, a Rust engine that does not define `is_homepage`, `is_link`, `abs_url`, `build_date_utc`, or `update_date`. Those names were undefined, so the guard never matched and the homepage was emitted a second time. The live sitemap was 361 bytes with two `<url>` entries, both `https://inference.roboflow.com/`. Guard on the page URL against `config.site_url` instead, which zensical does define. Also drop the `|e` filter, which double-escaped `/` as `/` inside `<loc>`. Verified with `zensical build --clean`: the sitemap is valid XML with a single URL. One URL is correct today, because `pages` holds only nav pages and the nav is `index.md` plus external links. Every other path serves a `noindex` redirect to docs.roboflow.com. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
|
👋 Thanks for the pull request! Here is how automated Claude review works here, so you spend credits (and reviewer time) wisely. 🚦 This PR is marked Ready for review, so automated Claude review will run — and every pass spends real credits. Warning 💸 The Claude reviewer bills in credits, not vibesAutomated review spins up a real agent that reads real code and spends real credits on every pass. It is glad to help — but it is not a rubber duck, a linter you poke in a loop, or a substitute for reading the contributing guide. Treat it like an expensive senior reviewer whose time you booked, and show up prepared. Draft when unsure, Ready when you mean it:
However you get there, arrive prepared:
Reviews are not free. A draft costs nothing to review; a Ready PR is a promise that it is worth reviewing.
|
|
🤖 Claude review started at commit New commits are not auto-reviewed. Add the |
|
Skills: none dispatched — No dedicated surface skill covers Scope: single Jinja2 template Traced the fix: guarding the loop on Reviewed at HEAD: 68219e9 |
|
😎 PR passes the vibe-check and trust-me-bro verification. |
Already deployed/live, minor SEO fix
Problem
https://inference.roboflow.com/sitemap.xmlis 361 bytes and has two<url>entries. Both are the same URL:Cause
theme/sitemap.xmlhard-coded the homepage first, then looped overpagesand usedpage.is_homepageto skip it.The site builds with
zensical build --clean(see.github/workflows/docs.yml). Zensical is a compiled Rust engine and does not define the MkDocs page fields the template relied on:is_homepage,is_link,abs_url,build_date_utc,update_date. All were undefined, sonot page.is_homepagewas always true and the homepage was emitted a second time. The same undefined names are why no<lastmod>was ever written.Fix
Guard on the page URL against
config.site_url, which zensical does define, instead ofis_homepage. Also drop the|efilter, which double-escaped/as/inside<loc>.Verification
zensical build --cleannow produces valid XML with a single URL and clean escaping:One URL is the correct result today.
pagesholds only nav pages, and the nav inmkdocs.ymlisindex.mdplus external links to docs.roboflow.com. I checked the live site:/install/,/workflows/about/, and/api/return 200 but serve anoindexmeta-refresh to docs.roboflow.com, so the homepage is the only indexable page.Out of scope
Those old paths redirect with meta-refresh, not HTTP 301. Google gives meta-refresh less weight and passes less link equity. If the old URLs still have backlinks, real 301s at the CDN would keep more of that value. Worth a separate look.
🤖 Generated with Claude Code