Skip to content

fix: sitemap exclude doesn't take into account base url w/ i18n #479

@hhochart

Description

@hhochart

🐛 The bug

When using the exclude property to remove specific urls, the pages are not excluded because of the app base url

eg:

export default defineNuxtConfig({
  app: {
    baseURL: '/base/',
  },
  sitemap: {
    exclude: ['/about'],
  },
})

This doesn't work in an i18n setup. For it to work you have to do

    exclude: ['/about', '/hr/about'],

🛠️ To reproduce

https://stackblitz.com/edit/nuxt-starter-dedexxzy?file=nuxt.config.ts

🌈 Expected behavior

I'm expecting the url with the baseURL to be excluded

ℹ️ Additional context

you can run `pnpm build && cat .output/public/sitemap/hr-HR.xml to test

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions