Activities

bpeab

bpeab posted a new question

sitemap-module •

Follow noindex, nofollow

Hello,

I wonder if there's any way so that I can filter the routes and remove the ones where the robots meta tags is set with noindex,nofollow. I tried with the filter property but apparently the routes are not providing the meta object and therefore I don't see anyway I could do that.

Thanks for the help !

rutgerbakker95

rutgerbakker95 posted a new feature request

sitemap-module •

idea Nuxt 2.13.0 compatibility (nuxt static export)

What problem does this feature solve?

It would be nice if the sitemap automatically generate routes in combination with the Nuxt static option

ems1985

ems1985 posted a new bug report

sitemap-module •

bug i18n option only generates <url> for default language

Version

2.3.2

Reproduction link

https://github.com/nuxt-community/sitemap-module/blob/dev/README.md

Steps to reproduce

(Please note that the reproduction link, is just as a link to the docs, because the problem is already shown in the i18n docs example.)

When using the i18n option to generate a sitemap, only one <url> is generated for all language versions. But, according to a Google post (https://support.google.com/webmasters/answer/189077) there should be a <url> created for every page. I know it seems redundant, but I guess thats how it should be.

What is expected ?

 <url>
    <loc>https://example.com/</loc>
    <xhtml:link rel="alternate" hreflang="en" href="https://example.com/"/>
    <xhtml:link rel="alternate" hreflang="es" href="https://example.com/es/"/>
  </url>
 <url>
    <loc>https://example.com/es/</loc>
    <xhtml:link rel="alternate" hreflang="en" href="https://example.com/"/>
    <xhtml:link rel="alternate" hreflang="es" href="https://example.com/es/"/>
  </url>

What is actually happening?

 <url>
    <loc>https://example.com/</loc>
    <xhtml:link rel="alternate" hreflang="en" href="https://example.com/"/>
    <xhtml:link rel="alternate" hreflang="es" href="https://example.com/es/"/>
  </url>
simplenotezy

simplenotezy posted a new bug report

sitemap-module •

bug i18n rel-alternate-hreflang missing for generated routes

Version

2.3.1

Reproduction link

https://thejewelleryroom.com/sitemap.xml

Steps to reproduce

1) Set sitemap configuration like so:

    sitemap: {
        hostname: process.env.BASE_URL,
        gzip: true,
        i18n: {
            defaultLocale: 'en',
            locales: ['en', 'da'],
            routesNameSeparator: '___'
        },

2) Generate the sitemap

3) Inspect the sitemap.xml

What is expected ?

<url><loc>https://thejewelleryroom.com/product/product-name</loc><lastmod>2020-06-14T20:01:44.123Z</lastmod><changefreq>daily</changefreq><priority>1.0</priority> <xhtml:link rel="alternate" hreflang="da" href="https://thejewelleryroom.com/da/produkt/product-name"/> foreach of the different routes</url>

What is actually happening?

<url><loc>https://thejewelleryroom.com/da/produkt/product-name</loc><lastmod>2020-06-14T20:01:44.123Z</lastmod><changefreq>daily</changefreq><priority>1.0</priority></url>

Additional comments?

I'm not sure what I am missing or doing wrong; I believe I've done everything according to the documentation. Sitemap may be viewed here: https://thejewelleryroom.com/sitemap.xml

brumartins

brumartins posted a new bug report

sitemap-module •

bug i18n rel-alternate-hreflang on a website with a base url

Version

2.3.1

Reproduction link

https://github.com/brumartins/nuxt-wiki

Steps to reproduce

Hello! 😃

I'm trying to use the i18n feature to build a multilingual sitemap, and I'm not getting exactly what I would expect. I'm not sure if I'm missing something in the sitemap-module configuration or if it is a bug.

My Nuxt app is hosted on Github Pages and contains a base url /nuxt-wiki (http://brumartins.github.io/nuxt-wiki). The routes in the <loc> tags are correct, but the alternate links are missing the base url.

Here are the steps to generate the sitemap :

$ npm install

# generate static project (for deployment on Github Pages)
# select first command if using Windows, otherwise select the 2nd one
$ npm run generate:gh-pages-win 
$ npm run generate:gh-pages

Open the dist/sitemap.xml file. The sitemap is great, the translated alternate links are taken into account, but the base url is missing for these alternate links.

What is expected ?

I'd expect a sitemap with

<url>
    <loc>http://brumartins.github.io/nuxt-wiki/</loc>
    <xhtml:link rel="alternate" hreflang="fr" href="http://brumartins.github.io/nuxt-wiki/fr"/>
    <xhtml:link rel="alternate" hreflang="en" href="http://brumartins.github.io/nuxt-wiki"/>
</url>

What is actually happening?

But I get this (nuxt-wiki base url is missing on alternate links)

<url>
    <loc>http://brumartins.github.io/nuxt-wiki/</loc>
    <xhtml:link rel="alternate" hreflang="fr" href="http://brumartins.github.io/fr"/>
    <xhtml:link rel="alternate" hreflang="en" href="http://brumartins.github.io/"/>
</url>

Additional comments?

Here is the nuxt configuration (link to full file)

const HOSTNAME = process.env.DEPLOY_ENV === 'GH_PAGES' ? 'http://brumartins.github.io' : 'http://localhost:3000';

export default {
  /* ... */
  sitemap: {
    hostname: HOSTNAME,
    gzip: true,
    i18n: 'en'
  }
}

I tried to add the base url to hostname property in the nuxt.config.js file. The path in the <loc> tag became http://brumartins.github.io/nuxt-wiki/nuxt-wiki/ and nothing changed for the alternate links.

Thank you in advance for your time 😊

simplenotezy

simplenotezy posted a new question

sitemap-module •

Sitemap looks weird

Is sitemap supposed to look like this?

Screenshot 2020-06-13 at 22.41.51.png

It looks kinda weird.

tegola

tegola posted a new question

sitemap-module •

How do I invalidate the cache?

I'm trying to build a sitemap index consisting of a static one (the default one generated by the module) and a dynamic one for each country of the venue list on the db.

However, no matter how much I try or set cacheTime to 0, I can't see the dynamic route list reloading.

Even with the test configuration below, which will should generate a new /test/<timestamp> everytime the /sitemap-test.xml url is requested, the timestamp never changes, and the console only shows 'adding test route' once.

// nuxt.config.js
{
    sitemap() {
        const sitemaps = []

        // Main, escluding /user and /<lang>/user
        sitemaps.push({
            path: '/sitemap-main.xml',
            cacheTime: 0,
            filter({ routes }) {
                return routes.filter(route => !route.path.match(/^(\/[a-z]{2})?\/user/i))
            }
        })

        sitemaps.push({
            path: '/sitemap-test.xml',
            cacheTime: 0,
            exclude: ['/**'],
            routes: () => {
                console.log('adding test route')
                const t = new Date().getTime()

                return [`/test/${t}`]
            }
        })

        return {
            path: '/sitemap.xml',
            sitemaps
        }
    }
}

Is this normal? Am I doing something wrong? I'm not using nuxt generate, just nuxt dev, or nuxt build && nuxt start.

simplenotezy

simplenotezy posted a new feature request

sitemap-module •

idea Support routes from "generate.routes" output

What problem does this feature solve?

Ease-of-use. Would be cool if it generated sitemap on deploy from output already fetched here in my nuxt.config.js generate.routes property, with exception of the "payload" data, so I don't have to repeat my code, and take extra unnessecary resources on the deploy server.

What does the proposed changes look like?

Somehow fetch the generate.routes output and remove payload property and generate sitemap based on this.

hoiheart

hoiheart posted a new feature request

sitemap-module •

idea The hreflang value is not ISO based when used with i18n

What problem does this feature solve?

The hreflang produced by nuxt-i18n is based on the iso attribute.
But sitemap does not produce hreflang based on the iso attribute.
I want to be provided with a hook function or a method of using iso property base.

lautr

lautr posted a new feature request

sitemap-module •

idea allow option to disable usage of publicPath

What problem does this feature solve?

The usage of base.publicPath to use as the host for the sitemap does not make sense when it's also used to set up the CDN for Nuxt Assets, which is its recommended usage.

Therefore it would make sense to disable this feature to allow nuxt/sitemap to regularly decide it's host, or provide a way to access the request to set host manually.

Right now the host name needs to be hard coded which makes it's usage hard for multi domain deployments and tests in feature environments.

BerciTheBeast

BerciTheBeast posted a new feature request

sitemap-module •

idea Enable hostname prepend for video thumbnails

What problem does this feature solve?

Video thumbnail_loc properties are currently not being prepended with hostnames if the URL is not valid.

What does the proposed changes look like?

If the thumbnail_loc is not a valid URL it would be prepended with the hostname, similar to image URLs. It would be nice if this option was toggleable in the config or even per video entry.

BerciTheBeast

BerciTheBeast posted a new feature request

sitemap-module •

idea Enable alias resolution for paths

What problem does this feature solve?

Currently, if you provide an alias in an image path, like @ or ~, the alias is not resolved and carried over to the sitemap xml.

What does the proposed changes look like?

Aliases inside urls and possibly other parameters would resolve to their actual paths.

BerciTheBeast

BerciTheBeast posted a new feature request

sitemap-module •

idea Enable discovery and/or declaration of image or other objects on static pages

What problem does this feature solve?

It would solve needing to have all the declarations in the nuxt config (if declared on static pages) or remove the need for declarations altogether (if discovery).

What does the proposed changes look like?

The proposed change would include a config option that would enable image or other object discovery on static pages, as well as functions that would enable filtering of the found options.

miteyema

miteyema posted a new bug report

sitemap-module •

bug i18n: dynamic routes not having language/locale variant

Version

2.3.0

Reproduction link

https://github.com/miteyema/nuxt-i18n-demo

Steps to reproduce

Add i18n
Add sitemap
Configure both according to doc

What is expected ?

  • the dynamic routes show xhtml:link rel="alternate" for all locales

What is actually happening?

  • the dynamic routes do not show xhtml:link rel="alternate"
altynbek07

altynbek07 posted a new question

sitemap-module •

Exclude i18n routes

Module version
@nuxtjs/[email protected]

Describe the bug
Is there an elegant way to exclude i18n routes?

To Reproduce
Now it works like this for me:
In file nuxt.config.js:

...
modules: [
    ['@nuxtjs/sitemap', {
      exclude: [
        '/cart',
        '/en/cart',
        '/kk/cart',

        '/checkout/**',
        '/en/checkout/**',
        '/kk/checkout/**',
      ],
      ...
    }]
  ],
buildModules: [
    ['nuxt-i18n',
      {
        locales: [
          { code: 'ru', name: "Русский", file: 'ru.js' },
          { code: 'kk', name: "Қазақша", file: 'kk.js' },
          { code: 'en', name: "English", file: 'en.js' }
        ],
        defaultLocale: 'ru',
      }
    ],
    ...
  ],
...

Expected behavior
I would like something like this:
In file nuxt.config.js:

...
modules: [
    ['@nuxtjs/sitemap', {
      exclude: [
        '/cart',
        '/:lang/cart',

        '/checkout/**',
        '/:lang/checkout/**',
      ],
      ...
    }]
  ],
...
tmorehouse

tmorehouse posted a new feature request

sitemap-module •

idea allow `sitemap` to be a function

What problem does this feature solve?

Similar to @nuxtjs/robots module, it would be nice if the sitemaps nuxt.config.js entry would allow for a function rather than just an object.

What does the proposed changes look like?

No changes to existing process, except to allow sitemaps property to be a function

MattIPv4

MattIPv4 posted a new question

sitemap-module •

Generating a sitemap on build/start?

I'm using the standard(?) nuxt build and then nuxt start commands to run my app. I have a rather complex sitemap that takes some time to generate

I've enabled the sitemap caching option, but is there any programmatic way to generate the initial sitemap during build or start so that the first request doesn't have to wait?

Equally, is there any way to schedule a task that will re-generate the sitemap in the background so that no request ever has to wait for the cache to be refreshed if it expires?

medmemara

medmemara posted a new question

sitemap-module •

How to work with build --standalone option?

I'm using nuxt app with AWS lambda.
lambda only allows about 250MB or less, but my app is bigger than.
so, I'm using build with --standalone option to avoid restriction.

sitemap works when I ran this command without the option.

nuxt-ts build && npm run start

otherwise, sitemap doesn't work.

How to make sitemap work with this option?

NicoPennec

NicoPennec resolved the question #c89

sitemap-module •

Main route without trailing slash

No, you can't sorry. Each URL is normalized and the valid URL is with a trailing slash (see https://www.sitemaps.org/protocol.html and https://tools.ietf.org/html/rfc3986#section-6.2.3).

Your web browser and Google see the see these two URLs as equivalent:

Why do you want to do this?

tunecino

tunecino posted a new question

sitemap-module •

Main route without trailing slash

Is there a way to include the main page url without a trailing slash? Like https://example.com instead of https://example.com/ ?

I can exclude the main route but I didn't find a way to manually include a full path without programmatically involve hostname.

Thanks.