nuxt-modules / sitemap

Powerfully flexible XML Sitemaps that integrate seamlessly, for Nuxt.
https://nuxtseo.com/sitemap
309 stars 28 forks source link

Manual Sitemap chunking not working #145

Closed modbender closed 10 months ago

modbender commented 11 months ago

Describe the bug

The below is my config in nuxt.config.ts

  sitemap: {
    // manually chunk into multiple sitemaps
    sitemaps: {
      posts: {
        include: ["/p/**"],
        // give blog posts slightly higher priority (this is optional)
        defaults: { priority: 0.9 },
        exclude: ["/tag/**", "/author/**"],
      },
      tags: {
        include: ["/tag/**"],
        exclude: ["/p/**", "/author/**"],
      },
      authors: {
        include: ["/author/**"],
        exclude: ["/p/**", "/tag/**"],
      },
      pages: {
        exclude: ["/p/**", "/tag/**", "/author/**"],
      },
    },
  },

You can see the actual deployment, every single sitemap has exactly same 66 URL's
https://nuxt-nova.netlify.app/sitemap_index.xml

Reproduction

General

System / Nuxt Info

------------------------------
- Operating System: Linux
- Node Version:     v18.17.1
- Nuxt Version:     3.7.4
- CLI Version:      3.9.0
- Nitro Version:    2.6.3
- Package Manager:  yarn@1.22.19
- Builder:          -
- User Config:      runtimeConfig, routeRules, css, modules, devtools, nitro, googleFonts, strapi, content, image, sitemap, colorMode, disqus
- Runtime Modules:  @nuxtjs/strapi@1.9.3, @nuxtseo/module@2.0.0-beta.15, @nuxtjs/google-fonts@3.0.2, @nuxtjs/color-mode@3.3.0, @nuxt/image-edge@1.0.0-rc.3-28277678.46975fe, @nuxt/content@2.8.2, @vueuse/nuxt@10.5.0, nuxt-disqus@1.0.1, nuxt-icon@0.5.0
- Build Modules:    -
------------------------------

package.json
{
  "private": true,
  "scripts": {
    "build": "nuxt build",
    "dev": "nuxt dev",
    "generate": "nuxt generate",
    "preview": "nuxt preview",
    "start": "nuxt start"
  },
  "devDependencies": {
    "@nuxt/content": "2.8.2",
    "@nuxt/devtools": "0.8.5",
    "@nuxt/image-edge": "^1.0.0-rc.3-28277678.46975fe",
    "@nuxtjs/color-mode": "3.3.0",
    "@nuxtjs/google-fonts": "^3.0.2",
    "@nuxtjs/strapi": "1.9.3",
    "@nuxtseo/module": "2.0.0-beta.15",
    "@types/node": "20.8.3",
    "nuxt": "3.7.4",
    "nuxt-disqus": "1.0.1",
    "nuxt-icon": "0.5.0",
    "sass": "1.69.0"
  },
  "dependencies": {
    "@nuxtjs/google-adsense": "3.0.0",
    "@popperjs/core": "2.11.8",
    "@vueuse/nuxt": "10.5.0",
    "bootstrap": "5.3.2"
  },
  "resolutions": {
    "nuxt-link-checker": "^2.1.9",
    "nuxt-og-image": "^2.1.1",
    "nuxt-schema-org": "^3.0.1",
    "nuxt-seo-experiments": "^3.1.1",
    "nuxt-seo-ui": "^0.3.6",
    "nuxt-simple-robots": "^3.1.1",
    "nuxt-simple-sitemap": "^3.4.0",
    "nuxt-site-config": "^1.4.0"
  }
}
modbender commented 11 months ago

Sorry if the link given was not working, I was testing out @vite-pwa/nuxt and it seems to redirect sitemap and robots to homepage even though the pages are generated in the directory.

In Inspector > Application you have to unregister Service Workers and Hard reload and empty cache to fix it.

harlan-zw commented 10 months ago

With the v4 release the logic has changed around these and the usage should be a lot clearer.

Here is the relevant news docs.

I'll close for now but feel free to make a new issue if you still have issues.