Skip to content

fix(layer): emit absolute sitemap URLs from configured site.url - #1422

Open
TerrorSquad wants to merge 1 commit into
nuxt-content:mainfrom
TerrorSquad:fix/sitemap-absolute-loc
Open

fix(layer): emit absolute sitemap URLs from configured site.url#1422
TerrorSquad wants to merge 1 commit into
nuxt-content:mainfrom
TerrorSquad:fix/sitemap-absolute-loc

Conversation

@TerrorSquad

@TerrorSquad TerrorSquad commented Aug 10, 2026

Copy link
Copy Markdown

Problem

/sitemap.xml gets its base URL from inferSiteURL(), which only reads env vars. A site.url set in nuxt.config is ignored, so it falls back to '' and every entry comes out relative:

<loc>/docs/getting-started/introduction</loc>

The sitemap spec requires absolute URLs, so search engines reject these. Nothing warns at build time.

Reproduction

Set site: { url: 'https://example.com' } in nuxt.config, no env vars, then nuxt build and fetch /sitemap.xml.

Fix

Expose the resolved site.url on runtimeConfig.public.site, the same way mcp.route is already exposed, and read it in the route. inferSiteURL() stays as the fallback so env-var deploys are unaffected.

Verified

Setup Result
site.url in config absolute URLs
env var only unchanged
trailing slash in url no double slash

pnpm lint and pnpm typecheck pass.

Note

pnpm install fails on a clean checkout: packageManager pins pnpm@11.13.0, which shipped a broken binary. Not related to this PR, happy to file separately.

@vercel

vercel Bot commented Aug 10, 2026

Copy link
Copy Markdown

@TerrorSquad is attempting to deploy a commit to the NuxtLabs Team on Vercel.

A member of the Team first needs to authorize it.

@TerrorSquad
TerrorSquad force-pushed the fix/sitemap-absolute-loc branch from c9651e2 to 80c6a19 Compare August 10, 2026 21:58
@TerrorSquad
TerrorSquad force-pushed the fix/sitemap-absolute-loc branch from 80c6a19 to e618756 Compare August 10, 2026 22:25
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.

1 participant