Repository sitemap-module

OlegLevitskiy

OlegLevitskiy posted a new question

sitemap-module • 2 months ago

What about alternate language pages?

How to add a multi-language to the sitemap configuration?

links: [
 { lang: 'en', url: 'http://test.com/page-1/', },
 { lang: 'ja', url: 'http://test.com/page-1/ja/', }
]
OlegLevitskiy

OlegLevitskiy posted a new question

sitemap-module • 2 months ago

What about alternate language pages?
temi4

temi4 posted a new question

sitemap-module • 2 months ago

Large sitemap

Hello.

1) Sitemaps should be no larger than 50MB (52,428,800 bytes) and can contain a maximum of 50,000 URLs
If I have more links or more size. How do I add a pagination?

2) May be do sitemap with section?
Repo: https://github.com/litchfield/django-fastsitemaps
Example:

scottsweb

scottsweb posted a new bug report

sitemap-module • 4 months ago

bug Double run on generate

Version

0.1.1

Reproduction link

https://github.com/nuxt-community/sitemap-module

Steps to reproduce

Create a new routes section in your nuxt.config.js file with a console.log statement like so:

  sitemap: {
    path: '/sitemap.xml',
    cacheTime: 1000 * 60 * 15,
    generate: true, 
    gzip: true,
    async routes() {
        console.log( '....routes()' )
                ...

What is expected ?

Only one log is output during generate.

What is actually happening?

Multiple log entries are output:

nuxt:generate Generating... +0ms ....routes() nuxt: Call build:before hooks (3) +0ms nuxt:pwa Adding icons +0ms nuxt:pwa Adding manifest +0ms nuxt:pwa Adding meta +0ms nuxt:build Generating files... +4ms nuxt:build Generating routes... +8ms ....routes()

Additional comments?

This is an issue because with a dynamically generated set of routes, the API gets hit twice for every request (as far as I can tell).

Using 1.4.0 of nuxt.

wolle404

wolle404 posted a new question

sitemap-module • 4 months ago

Generate dynamic sitemap with axios-module ($axios)

Hey there,

is there a way that I can use the nuxt axios client here instead of the normal axios client?

https://github.com/nuxt-community/axios-module

ekoeryanto

ekoeryanto posted a new question

sitemap-module • 4 months ago

weird code generated on netlify

weird code generated to sitemap.xml in netlify cms.
but none such code generated on local

{ const open = XMLHttpRequest.prototype.open; XMLHttpRequest.prototype.open = function (method, url) { open.apply(this, arguments); this.addEventListener('readystatechange', function _() { if(this.readyState == this.HEADERS_RECEIVED) { const contentType = this.getResponseHeader('Content-Type') || ''; if (contentType.startsWith('video/') || contentType.startsWith('audio/')) { window.postMessage({ source: 'xmlhttprequest-open', url, mime: contentType, method, contentType }, '*'); } this.removeEventListener('readystatechange', _); } }) } }

dimitrieh

dimitrieh posted a new question

sitemap-module • 4 months ago

RSS support?

I found https://github.com/yashha/rss-module but I am unsure how it works. It seems to be a fork of this repository. Can this also work with static generated websites?

I would appreciate any help implementing an rss feed for static nuxt websites 😉

HADB

HADB posted a new question

sitemap-module • 4 months ago

npm version is not updated

The latest version on npm is 0.0.3 not 0.0.4.

HADB

HADB posted a new question

sitemap-module • 4 months ago

npm version is not updated

The latest version on npm is 0.0.3 not the latest 0.0.4.

dohomi

dohomi posted a new question

sitemap-module • 5 months ago

errors on npm install trying to make a PR

Hi @NicoPennec

thanks for your module. I tried to fork it for applying a PR but unfortunately after forking and trying to run npm install and npm run test nothing works.

```
nuxt-module: Starting build +0ms
nuxt-module:build Building +0ms
nuxt-module:build Done +627ms

@nuxtjs/[email protected] lint /data/vuejs/sitemap-module
eslint lib src test

console.error node_modules/nuxt/lib/common/utils.js:22

 ERROR  Nuxt error

  TypeError: Cannot read property 'length' of undefined

`` It would be great if you could pass thereqof the server to theroutes` promise based function. This is what I tried to do with my PR because in my setup I have a multilang setup and would like to serve the right language inside the server middleware.
Thanks

yangchendoit

yangchendoit posted a new bug report

sitemap-module • 5 months ago

bug regeneratorRuntime is not defined

image
image

when i go back to 0.0.3, the problem fixed.

jerakode

jerakode posted a new feature request

sitemap-module • 5 months ago

idea Multiple sitemaps possible?

Hello. Is it possible to create separate multiple sitemaps?
I want separate sitemap for Google News.

crabdul

crabdul posted a new question

sitemap-module • 5 months ago

sitemap.xml not generating

The sitemap is not running when I run the build command.

Below is the configuration for modules and sitemap.
I am importing axios at the start of the nuxt.config.js file

  modules: ['@nuxtjs/sitemap'],
  sitemap: {
    hostname: 'https://karaimusic.com',
    routes () {
      return axios.get('https://karaimusic.co.uk/wp-json/wp/v2/posts?categories=2')
        .then(res => res.data.map(track => {
          const path = '/tracks/' + track.slug
          console.log(path)
          return path
        }))
    }
  }

Axios is getting the data properly because I'm able to print out the slugs of my posts properly

/tracks/parquet-courts-almost-had-to-start-a-fight-in-and-out-of-patience
/tracks/iceage-catch-it

Where am I going wrong?
What else can I check?

rizkiheryandi

rizkiheryandi posted a new question

sitemap-module • 6 months ago

How to create .xml.gz sitemap index ?

I have web app with lots of URL of single product (let's say it's a e-commerce website).

Let's say i have 60.000 url to save in my sitemap, and i separate that with 2 sitemap.

And each sitemap i wanna compress it with .xml.gz format, to reduce its size.

I can easily do that with PHP (i used laravel), but how to do that with NuxtJs ? (even a pure javascript besides the NuxtJs)

Can someone help me ?

Thank you :)

delucis

delucis posted a new feature request

sitemap-module • 6 months ago

idea Options for static routes

Hi, thanks for your work on this module!

When passing dynamic routes, setting extra options is possible, e.g.

routes: [
  { url: '/dynamic/1', changefreq: 'daily', priority: 1 /* etc. */ }
]

But for “static” routes, there doesn’t seem to be any way to pass such options.

If I add a static route to the routes option, it gets duplicated because static and dynamic routes are merged using lodash’s union(). It ends up comparing, e.g. '/route' with { url: '/route', changefreq: 'daily' }, which aren’t equal so both are included.

Is there a solution? If not, perhaps the following might make sense:

  1. Improve the merge strategy in the createCache() method to avoid such duplicates. This would allow overriding static routes by adding them to the routes option.

  2. Allow for a default set of route options to be set, which are applied to static routes (or all routes?)

// maybe something like this?
sitemap: {
  routeDefaults: {
    changefreq: 'daily'
  },
  routes: [ '/foo', '/bar' ]
}
// would be equivalent to, with routeDefaults also applying to static routes
sitemap: {
  routes: [
    { url: '/foo', changefreq: 'daily' },
    { url: '/bar', changefreq: 'daily' }
  ]
}

Any thoughts? I might have misread index.js, so maybe another solution would be better. Would be happy to work on a solution if there’s interest.

leandromatos

leandromatos posted a new question

sitemap-module • 7 months ago

Internationalized routes are not being generated

Does this module not generate the sitemap for internationalized routes?

I used the following example to start a project, but the site map does not generate the routes for the pages that are within pages/_lang/.

https://nuxtjs.org/examples/i18n/

How can I do to generate the routes of these pages dynamically?

qathom

qathom posted a new question

sitemap-module • 8 months ago

Generate a meta link (<link rel="sitemap")

Hello,

First of all, thank you for making this module!
I was wondering why there isn't an option to generate a meta link automatically? Is it appropriate to pass through the module for this functionality?

For example:

<link rel="sitemap" href="/sitemap.xml" />
hackuun

hackuun posted a new question

sitemap-module • 8 months ago

Generate sitemap when API data changes?

Is it possible to regenerate sitemap if I change my API data without rerunning npm run build?

I mean, Nuxt by itself doesn't need to rebuild everytime I add/change article. It just fetch new data.
Can this be done with this sitemap module?

Julien76

Julien76 posted a new question

sitemap-module • 8 months ago

Does not see child page when generating the sitemap

Hi,

Thanks for this module.
I have an issue and do not know if it's a bug or not.

I have some children pages which are not dynamic:

Here is the list of url:

/
/singlePageA   
/singlePageB
/parentA/
/parentA/childA
/parentA/childB

Here is the folder set-up in the directory pages

index.vue
singlePageA.vue   
singlePageB.vue
parentA.vue
parentA/
  index.vue    
  childA.vue
  childB.vue

Now if I run @nuxtjs/sitemap with the default value and just set generate: true, then only the following route are considered in the sitemap.xml:

/
/singlePageA   
/singlePageB
/parentA

Missing routes are:

/parentA/    <--- Note the trailing forward slash
/parentA/childA
/parentA/childB

My understanding is that as those routes are "static" children routes, they should be considered by the @nuxtjs/sitemap module. Am I wrong?
Do I have to define them manually?
If so, do you a know an easy way to generate a route list (json file) and inject it in the @nuxtjs/sitemap options

Thanks.

hackuun

hackuun posted a new question

sitemap-module • 9 months ago

Additional `routes` options with Dynamic routes?

Right now I have this

routes () {
      return axios.get(`http://example.me/articles/crypto`)
        .then(res => res.data.map(article => '/crypto/' + article.slug))
    }

As I see it, it just returns generated URL. But what if I want to use something like this in example

{
        url: '/page/2',
        changefreq: 'daily',
        priority: 1,
        lastmodISO: '2017-06-30T13:30:00.000Z'
}

I can define it in then?