Skip to content

nuxt: Sitemap enrichment - #5546

Merged
Yndira-E merged 3 commits into
mainfrom
zj-sitemap
Aug 12, 2026
Merged

nuxt: Sitemap enrichment#5546
Yndira-E merged 3 commits into
mainfrom
zj-sitemap

Conversation

@ZJvandeWeg

Copy link
Copy Markdown
Member

No description provided.

Comment thread nuxt/lib/git-lastmod.mjs
@netlify

netlify Bot commented Aug 8, 2026

Copy link
Copy Markdown

Deploy Preview for flowforge-website ready!

Name Link
🔨 Latest commit 2fe9f54
🔍 Latest deploy log https://app.netlify.com/projects/flowforge-website/deploys/6a77b1b683053400082d26da
😎 Deploy Preview https://deploy-preview-5546--flowforge-website.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
1 paths audited
Performance: 65 (🟢 up 2 from production)
Accessibility: 96 (no change from production)
Best Practices: 100 (no change from production)
SEO: 92 (no change from production)
PWA: -
View the detailed breakdown and full score reports

To edit notification comments on pull requests, go to your Netlify project configuration.

@netlify

netlify Bot commented Aug 8, 2026

Copy link
Copy Markdown

Deploy Preview for flowforge-website ready!

Name Link
🔨 Latest commit 5b96916
🔍 Latest deploy log https://app.netlify.com/projects/flowforge-website/deploys/6a7b9d52b2a6a000091519d2
😎 Deploy Preview https://deploy-preview-5546--flowforge-website.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
1 paths audited
Performance: 73 (🟢 up 12 from production)
Accessibility: 96 (no change from production)
Best Practices: 100 (no change from production)
SEO: 85 (no change from production)
PWA: -
View the detailed breakdown and full score reports

To edit notification comments on pull requests, go to your Netlify project configuration.

Comment thread nuxt/lib/git-lastmod.mjs
Comment thread nuxt/server/api/__sitemap__/content-urls.get.ts Outdated
@Yndira-E

Copy link
Copy Markdown
Contributor

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 [sitemap] git log failed warning in the build logs, but there is this warning in the functions log:

WARN [sitemap] git log failed in /var/task, lastmod will be omitted: spawnSync git ENOENT

I did some digging with Claude and this is the diagnosis:

content-urls.get.ts gets bundled into the deployed server function (not just run at prerender time), and /var/task (the Function's sandbox) has no git binary at all. So right now, lastmod for handbook/blog/ebooks/whitepapers silently never resolves whenever this route is served from the live function rather than baked into a static file at build — only docs gets a real date, because updated is computed once during docs-sync (also via git log, see docs-sync.mjs:117) and written into frontmatter, so no runtime git call is needed for it.

This reminded me that we have a field for this on the blog too, but unlike the docs, this one is set manually:

blog already has a lastUpdated frontmatter field (content.config.ts:117) that the blog page itself uses for its "Updated" date and JSON-LD dateModified (pages/blog/[...slug].vue:142-143) — but the blog entry in CONTENT_SOURCES here doesn't reference it at all, so an author-provided update date gets silently dropped in favor of the git-only path instead of preferring lastUpdated (with git as a fallback, same as the page does with page.lastUpdated || page.date).

Would it make sense to compute lastmod the same way docs does, resolve it once at build/sync time and store it, rather than depending on git being available wherever this route ends up running?

Or, would forcing /sitemap.xml itself into the prerender crawl (routeRules: { '/sitemap.xml': { prerender: true } }) fix this, since right now it looks like the whole sitemap route is being regenerated dynamically per-request rather than baked at build time (where git is available)?

ZJvandeWeg added a commit that referenced this pull request Aug 11, 2026
…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.
ZJvandeWeg added a commit that referenced this pull request Aug 11, 2026
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.
@Yndira-E
Yndira-E merged commit c40bde1 into main Aug 12, 2026
7 checks passed
@Yndira-E
Yndira-E deleted the zj-sitemap branch August 12, 2026 08:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants