nuxt: Sitemap enrichment - #5546
Conversation
✅ Deploy Preview for flowforge-website ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
✅ Deploy Preview for flowforge-website ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
I checked https://deploy-preview-5546--flowforge-website.netlify.app/sitemap.xml and the "last updated" column only shows dates for the docs. There's no
I did some digging with Claude and this is the diagnosis:
This reminded me that we have a field for this on the blog too, but unlike the docs, this one is set manually:
Would it make sense to compute Or, would forcing |
…onstant Addresses Yndira's review comment on PR #5546 - site.url was already defined in nuxt.config.ts, so this route's hardcoded copy was a second source of truth for the same value.
Addresses #5546 (comment) /sitemap.xml wasn't in the explicit nitro.prerender.routes list, and @nuxtjs/sitemap only self-registers a route for static baking when isNuxtGenerate() is true - which checks nitro.static/preset "static", not the hybrid netlify preset this site uses. So /sitemap.xml was being served live by the deployed function instead, where /var/task has no git binary, silently dropping every git-derived lastmod (handbook, changelog, blog, ebooks, whitepapers). Explicitly prerendering it bakes it at build time instead, inside the git checkout, same as the other generated feed routes already in that list (/blog/index.xml etc). Also make blog prefer its own `lastUpdated` frontmatter field over the git-derived date, matching what the blog page itself already shows as "Updated" - so an editorial update date isn't silently overridden by whatever last touched the file for unrelated reasons.
Enriches the docs/handbook/changelog/blog/ebooks/whitepapers sitemap entries with git-derived lastmod and frontmatter images via a new Nitro sitemap source (content-urls.get.ts), since @nuxtjs/sitemap's content onUrl/filter hooks are re-spliced as raw source text with no closure over this module's imports. Also discovered docs/** had no `sitemap` schema field at all, so every /docs/** page was silently absent from sitemap.xml - fixed as part of the same route.
…onstant Addresses Yndira's review comment on PR #5546 - site.url was already defined in nuxt.config.ts, so this route's hardcoded copy was a second source of truth for the same value.
Addresses #5546 (comment) /sitemap.xml wasn't in the explicit nitro.prerender.routes list, and @nuxtjs/sitemap only self-registers a route for static baking when isNuxtGenerate() is true - which checks nitro.static/preset "static", not the hybrid netlify preset this site uses. So /sitemap.xml was being served live by the deployed function instead, where /var/task has no git binary, silently dropping every git-derived lastmod (handbook, changelog, blog, ebooks, whitepapers). Explicitly prerendering it bakes it at build time instead, inside the git checkout, same as the other generated feed routes already in that list (/blog/index.xml etc). Also make blog prefer its own `lastUpdated` frontmatter field over the git-derived date, matching what the blog page itself already shows as "Updated" - so an editorial update date isn't silently overridden by whatever last touched the file for unrelated reasons.

No description provided.