Activities

BobDempsey

BobDempsey resolved the question #c66

sitemap-module •

/sitemap.xml not rendering on live website

Hey you can delete this if needed. It worked when I deployed the entire nuxt project to my host. Thank you though!

BobDempsey

BobDempsey posted a new question

sitemap-module •

/sitemap.xml not rendering on live website

Hey I'm having difficulties with getting the actual sitemap page to display on my live website. It works just fine using run && build.

Any help much appreciated! I've tried both sitemap configs.

nuxt.config.js

modules:["@nuxtjs/sitemap"],

sitemap: {
hostname: "https://silentauctionvacations.com",
path: "/sitemap.xml",
exclude: ["/admin/**"]
}

OR

sitemap: {
exclude: ["/admin/**"]
}

adfdev

adfdev posted a new question

sitemap-module •

Nuxt.js Internal Server Error

Have this settings for sitemap:

  sitemap: {
    routes: [
      "/",
      "/en"
    ],
    path: '/sitemap.xml',
  },

in dev mode and in production mode (npm start) can see /sitemap.xml, but when deploy have this error:

Nuxt.js Internal Server Error

connecteev

connecteev posted a new question

sitemap-module •

Support sitemap creation for sites with large (hundreds of thousands) of URLs from a database

Sitemap files are limited to 50K URLs each.

  1. Does this package support sitemap creation for sites with large (hundreds of thousands) of URLs?
  2. How can I pass data from the database into this sitemap module? Is there an example of how to do this?
sonofmagic

sonofmagic posted a new feature request

sitemap-module •

idea Support sitemap Etag Header

What problem does this feature solve?

Sitemap with Rtag can speed up search engine crawling. Baidu search engine can respond to sitemap updates more quickly. refer:https://ziyuan.baidu.com/college/articleinfo?id=456

What does the proposed changes look like?

options:{
Etag:true
}

PTiCA1

PTiCA1 posted a new feature request

sitemap-module •

idea Auto creating sitemap and index files from one large list?

What problem does this feature solve?

Hello to everybody,
does anyone have a solution to solve sitemap generation for a large number of pages? I generate articles from wordpress rest api and I need to split the sitemap into more files.

There is a solution in the sitemap.js documentation but I don't know how to use it in nuxt.js
https://github.com/ekalinin/sitemap.js#building-just-the-sitemap-index-file

Thanks for any advice.

michelsteege

michelsteege posted a new question

sitemap-module •

Request in routes function

I have a project where i generate a sitemap based on the current domain, to do this is need the hostname in the routes function to send it to an api which returns all info needed for my dynamic routes.
Is there any way to get the hostname/current domain in the routes function?

manniL

manniL posted a new feature request

sitemap-module •

idea Option to add trailing slash to routes, especially static ones

What problem does this feature solve?

We can already add a trailing slash to our own defined routes, but there is no way (AFAIK) yet to add it to generated/static routes.

e.g.
/about -> /about/ (while there is a pages/about.vue)

ianfortier

ianfortier posted a new question

sitemap-module •

Load and merge external sitemap.xml

Is it possible to load an external site map and merge it with the one generated by the plugin?

eg: yyy.com/sitemap.xml

The items are loaded from this remote sitemap are merged with the one generated by the plugin.

Thanks

Aylay

Aylay posted a new feature request

sitemap-module •

idea The property exclude VS generate:route priority

What problem does this feature solve?

Hi all ;)

In my nuxt file, I have an array of URL in generate:routes which contain multiple url and my 404 URL.
Also, I put this same 404 URL in the array of sitemap:exclude.

But, the 404 URL is always in my sitemap.xml.

Is it possible to force the exclude property of the generate sitemap property ?

Thanks

What does the proposed changes look like?

If any URL is in the exclude property and the generate:routes property, keep removing the URL in the exclude property

jhd4tmr

jhd4tmr posted a new question

sitemap-module •

How to create several sitemaps to separate the routers?

I have a site with more than 50,000 uris, i want to separate the sitemap.xml to several small parts.

thisischrisj

thisischrisj posted a new question

sitemap-module •

Access the routes object inside the routes function

The filter function passes the routes object to the function call. Is it possible to access that same object from within the routes function call?

We have nuxt.js frontend that pulls data from a WordPress backend. To generate the sitemap we are pulling all the permalink structures from Wordpress inside the routes function:

...
  routes () {
    var endpoint = 'https://xxxx.yyyy/permalinks';
    return axios.get(endpoint)
    .then(res => res.data.map(page => page.permalink))
    .catch((err) => {  });
  }
...

The problem is that the permalinks we get back from WordPress are not necessarily aligned 1-to-1 with the nuxt routes. The ones that aren't can be removed as they are not needed.

What we'd like to do is get all the data from the endpoint and test each page.permalink against the structure of the nuxt routes. If the permalink matches a valid route then include it, otherwise, omit it.

So, imagine we have the following route structures:

blog/:id
news/:id

And the call to the endpoint returns:

[
    { permalink: 'blog/123' },
    { permalink: 'news/123' },
    { permalink: 'case-studies/123' }
}

We want to filter the endpoint results so that 'case-studies/123' is omitted from the sitemap because it is not a valid route.

SnirShechter

SnirShechter posted a new feature request

sitemap-module •

idea Exclude pages from sitemap via in-component options

What problem does this feature solve?

excluding pages via filter function and/or exclude globs is fine for a global configuration.

That being said, sometimes we would like the configuration to be related to the page itself (i.e a terms & conditions page that is duplicated across projects).

What does the proposed changes look like?

Terms.vue

<template>
...
</template>
<script>
export default {
      sitemap:false
}
</script>
<style>
...
</style>

A pull request is available in #70

miteyema

miteyema posted a new question

sitemap-module •

using both filter and defaults does not work when following README.md

If you blindly copy the code from the documentation for both filter (to have trailing slashes) and defaults (to set default values for all routes), the sitemap.xml has URLs with trailing slashes, but the URLs do not have the default values. This is because the map function used in the code example for filter to have trailing slashes, throws away everything but the URL. Changing the documentation would prevent other people having the same issue if they would blindly copy/paste the code from the documentation.

SnirShechter

SnirShechter posted a new feature request

sitemap-module •

idea Filter function should receive the full route object (instead of just the url)

What problem does this feature solve?

The filter function receives an array of routes containing URLs and sitemap options. This means that the only way to filter the route is by final URL:

filter function - received route object

{
      url:'/about-us',
      // ...sitemapOptions
}

The specific need rises when we are using nuxt-i18n:

localed route

routeName: 'about'
urls:{
      en: '/about-us', 
      fr: '/a-propos',
      es: '/sobre' 
}

If I wish to exclude these routes, I need to use one of two options:

sitemapConfig - exclude 'about'

exclude: [
      '/about-us', 
      '/a-propos',
      '/sobre'
]

or

filter function - exclude 'about'

filter(routes){
      const excludedRoutes =  ['/about-us', '/a-propos', '/sobre']
      return routes.filter(route=>!excludedRoutes.includes(route.url))
}

What does the proposed changes look like?

The route object can actually contain more data:

filter function - possible route object

{
      url:'/about-us',
      name:'about',
      path:'/',
      chunkName:'pages/index',
      component:'C:\dev\sitemap-module\test\fixture\pages\about.vue'
}

Using that data, we can easily exclude routes by name.

filter function - new form

filter(routes){
      const excludedRouteNames =  ['about']
      return routes.filter(route=>!excludedRouteNames .includes(route.name))
}
Jered

Jered posted a new feature request

sitemap-module •

idea Support sitemap creation when using generate payload

What problem does this feature solve?

When using generate with dynamic routes you return the routes as an array of string URLs which the sitemap module picks up and creates a correct sitemap.xml. However, if you return the routes object from generate to use the payload feature, the sitemap will fail because it expects a string instead of an object.

What does the proposed changes look like?

Make it so sitemap can use generate.routes when using payloads. Should be updated to also accept routes in the form of:

[
  {
    route: 'urlstring', 
    payload: {data object},
    ...
  }
]

and extract the route.

ilyaskorik

ilyaskorik posted a new question

sitemap-module •

The meaning of the exclude parameter is not clear.

Judging by the code, it filters the routes of nuxt, and not the final xml file data. In my case it does not work. Can you fix this and filter the final data?

fabsfabs

fabsfabs posted a new question

sitemap-module •

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

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

NicoPennec

NicoPennec resolved the question #c44

sitemap-module •

How does cache work?

Thanks for the encouragements @Jesus82 👍

About the cache system, it's driven by the back-end Node.js, so it's Universal mode only. It's a server-side global cache and therefore shared between all IP addresses or any HTTP requests.

AlexBa

AlexBa posted a new question

sitemap-module •

Wrong routes with /_nuxt/ prefix in sitemap

Version
v1.0.0

Reproduction link
https://alexanderbarton.de/sitemap.xml

Steps to reproduce
Just generate the sitemap with the config. :)

What is expected ?
Routes in sitemap without the /_nuxt/ prefix

What is actually happening?
Routes in sitemap with /_nuxt/ prefix

Additional comments?
This is my nuxt.config.js:

const pkg = require('./package');
const dotenv = require('dotenv');

dotenv.config();

module.exports = {
mode: 'universal',

/*
** Headers of the page
*/
head: {
title: pkg.name,
meta: [
{ charset: 'utf-8' },
{ name: 'viewport', content: 'width=device-width, initial-scale=1' },
{ hid: 'description', name: 'description', content: pkg.description }
],
link: [
{ rel: 'icon', type: 'image/x-icon', href: '/favicon.ico' },
]
},

/*
** Customize the progress-bar color
*/
loading: false,

/*
** Global CSS
*/
css: [
'~assets/scss/style.scss',
],

/*
** Plugins to load before mounting the App
*/
plugins: [
{src: '~plugins/bootstrap-native', ssr: false},
{src: '~plugins/tiny-slider', ssr: false}
],

/*
** Nuxt.js modules
*/
modules: [
'@nuxtjs/dotenv',
'@nuxtjs/axios',
'@nuxtjs/redirect-module',
['@nuxtjs/google-tag-manager', {
id: process.env.GTMCONTAINERID
}],
['nuxt-i18n', {
strategy: 'prefixexceptdefault',
defaultLocale: 'de',
lazy: true,
langDir: 'translations/',
locales: [
{
code: 'de',
file: 'de.json'
}
],
}],
'@nuxtjs/sitemap'
],

axios: {
// proxyHeaders: false
},

redirect: [
{ from: '^/datenschutz-erklaerung', to: '/datenschutz' }
],

/*
** Build configuration
*/
build: {
extend(config) {
config.module.rules.push({
test: /bootstrap.native/,
use: {
loader: 'bootstrap.native-loader',
options: {
only: ['collapse', 'modal']
}
}
});
}
}
};