nuxt-modules / sitemap

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

help: no links added to my sitemap #337

Closed FlorientPlouvin closed 1 month ago

FlorientPlouvin commented 1 month ago

📚 What are you trying to do?

I have just installed the module in my application with Nuxt Seo. When I launch it I get a url: sitemap_index.xml But it doesn't return any of my static pages. "This XML Sitemap contains 0 URLs. " Yet I have about ten static pages.

🔍 What have you tried?

I defined the information for my site using an environment variable, and tried to put it directly into nuxt.config.ts. I tried to build the project also I tried to add information in the nuxt.config as in the example :

nitro: {
    prerender: {
      crawlLinks: true,
      routes: ["/", "sitemap.xml"],
    },
  },

I've tried setting the strictNuxtContentPaths value to true but it doesn't change anything

ℹī¸ Additional context

You will find my /__sitemap__/debug.json?sitemap=sitemap_index.xmlbelow


  "nitroOrigin": "http://0.0.0.0:3000/",
  "sitemaps": {
    "index": {
      "sitemapName": "index",
      "_route": "sitemap_index.xml",
      "sitemaps": [],
      "include": [],
      "exclude": [],
      "sources": []
    }
  },
  "runtimeConfig": {
    "isI18nMapped": true,
    "sitemapName": "sitemap.xml",
    "isMultiSitemap": true,
    "excludeAppSources": [],
    "cacheMaxAgeSeconds": 0,
    "autoLastmod": false,
    "defaultSitemapsChunkSize": 1000,
    "sortEntries": true,
    "debug": false,
    "discoverImages": true,
    "discoverVideos": true,
    "sitemapsPathPrefix": "/__sitemap__/",
    "isNuxtContentDocumentDriven": true,
    "xsl": "/__sitemap__/style.xsl",
    "xslTips": true,
    "xslColumns": [
      {
        "label": "URL",
        "width": "50%"
      },
      {
        "label": "Images",
        "width": "25%",
        "select": "count(image:image)"
      },
      {
        "label": "Last Updated",
        "width": "25%",
        "select": "concat(substring(sitemap:lastmod,0,11),concat(' ', substring(sitemap:lastmod,12,5)),concat(' ', substring(sitemap:lastmod,20,6)))"
      }
    ],
    "credits": true,
    "version": "6.0.0-beta.1",
    "autoI18n": {
      "differentDomains": false,
      "defaultLocale": "",
      "locales": [],
      "strategy": "prefix"
    }
  },
  "globalSources": [
    {
      "timeTakenMs": 0,
      "context": {
        "name": "sitemap:urls",
        "description": "Set with the `sitemap.urls` config."
      },
      "urls": [],
      "sourceType": "user"
    },
    {
      "timeTakenMs": 0,
      "context": {
        "name": "nuxt:pages",
        "description": "Generated from your static page files.",
        "tips": [
          "Can be disabled with `{ excludeAppSources: ['nuxt:pages'] }`."
        ]
      },
      "urls": [
        {
          "loc": "/account/accountValidation"
        },
        {
          "loc": "/account/auctions"
        },
        {
          "loc": "/account/bills"
        },
        {
          "loc": "/account/favourites"
        },
        {
          "loc": "/account/login"
        },
        {
          "loc": "/account/myAccount"
        },
        {
          "loc": "/account/step-3"
        },
        {
          "loc": "/account/step-4"
        },
        {
          "loc": "/"
        },
        {
          "loc": "/register"
        },
        {
          "loc": "/resetPassword/error"
        },
        {
          "loc": "/resetPassword"
        },
        {
          "loc": "/sitemap.xml"
        },
        {
          "loc": "/index-sitemap.xml"
        }
      ],
      "sourceType": "app"
    },
    {
      "timeTakenMs": 0,
      "context": {
        "name": "nuxt:route-rules",
        "description": "Generated from your route rules config.",
        "tips": [
          "Can be disabled with `{ excludeAppSources: ['nuxt:route-rules'] }`."
        ]
      },
      "urls": [
        "/account/login"
      ],
      "sourceType": "app"
    },
    {
      "timeTakenMs": 0,
      "context": {
        "name": "nuxt:prerender",
        "description": "Generated at build time when prerendering.",
        "tips": [
          "Can be disabled with `{ excludeAppSources: ['nuxt:prerender'] }`."
        ]
      },
      "urls": [
        "/"
      ],
      "sourceType": "app"
    }
  ]
}
FlorientPlouvin commented 1 month ago

I've just found that the problem was that I hadn't configured any locales with nuxt i18n.