How to exclude the root, without the trailing slash, from the sitemap?

fabsfabs
0
fabsfabs
commented 5 months ago

Hi everyone

a simple question, I hope.
I'm able to exlude the website root from the sitemap adding the '/' route inside the exclude array like so:
Screenshot 2019-06-04 at 09.17.21.png

Otherwise it exclude just the following route: https://www.my-domain.com/
The below route still remains in the sitemap
Screenshot 2019-06-04 at 09.20.30.png

So what is the line I have to wrote to exclude the path without the trailing slash?

Many thanks

0
NicoPennec
1.5k
NicoPennec
commented 4 months ago

The sitemap-module use the basic routes generated by Nuxt, and Nuxt doesn't declare the root path without trailing slash.

After a npm run dev, you can check the generated routes here : .nuxt\router.js

}, { path: "/", component: xyz, name: "index" }, {

Can you give us more details?

  • nuxt version
  • sitemap-module version
  • sitemap config (from your nuxt.config.js)
  • github project to reproduce
0
fabsfabs
0
fabsfabs
commented 4 months ago

Thank you to reply!
Exactly, there isn't in the .nuxt\routes.js, otherwise is printed in the xml file.
Following the info you asked.
Many thanks

1- 2.7.1
2- 1.2.0
3-

  sitemap: {    
    hostname: 'https://acanto.agency/',
    xmlNs: 'xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:xhtml="http://www.w3.org/1999/xhtml',
    path: '/sitemap.xml',
    gzip: true,
    exclude: [
      '/',
      '/aboutus',
      '/services',
      '/casehistory',
      '/all-our-works'
    ],
    routes: routes
  }, 

4- https://github.com/fabsfabs/website

0
Informations
Question โ€ข Unresolved
#c50 - Created 5 months ago