Activities

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.

asammitte

asammitte posted a new question

sitemap-module •

Pre-Fetch number of sitemaps

Trying to fetch number of sitemaps that should be created.

I have some amount of records for each entity. I want to prefetch this number to be able to add required amount to range.

Did try to fetch range amount with anonymous function but no luck.

// nuxt.config
sitemap: { path: '/sitemap.xml', cacheTime: 1000 * 60, sitemaps: [ ...lodash.range(30).map(index => ({ path:8a-sitemaps-e4532/8a-crags-sitemap${index + 1}.xml, routes: async () => { const { data } = await axios.get(${API_URL}/api/sitemap/products, { params: { pageIndex: index } }) console.log(data) return data }, cacheTime: 1000 * 60, trailingSlash: true, gzip: true, exclude: ['/**'], })) ] },

kimboender1983

kimboender1983 posted a new question

sitemap-module •

How to have sitemap with dynamic routes and keep it up to date?

I am creating a sitemap with dynamic routes but somehow it is cached or something? The first time it will generate the sitemap with all dynamic routes just fine. But when i add pages in my backend (Storyblok) the sitemap does not update, even when i rebuild my app and start it again. cacheTime and defaults: {changefreq} has no effect also. How can this be achieved? Can anyone point me in the right direction here?

Thanks in advance!

Y2-MosheHarush

Y2-MosheHarush posted a new feature request

sitemap-module •

idea Support server request context

What problem does this feature solve?

Hi,
I am using the module to create a dynamic sitemap on a large project.
So, the routes requested from the backend by routes option as a function using Axios to get routes.

Because it is a large project, the backend works around 1 minute to fetch & generate all routes.
I check on google's advice to return status 503 with Retry-After header to tell bots to return later when the data ready.

Now my issue is I got the error by Axios, but I can't handle it to the user because I no have access to Node Request Context.

I will glad full if you can expose the context to the routes function handler.

Thank you in advance.

What does the proposed changes look like?

Add the request context to routes function handler call.

Shuky

Shuky posted a new question

sitemap-module •

sitemap.xml not served in production build

when I run nuxt dev server I have a sitemap.xml generated on the fly.
when I build my production build and start the server sitemap.xml is not found.
Is there a way to generate sitemap.xml in during runtime in production or should I just use nuxt generate and serve it statically?

Nuxt.js v2.11.0
@nuxtjs/sitemap 2.0.1

relevant configuration:
'@nuxtjs/sitemap', { path: '/sitemap.xml', }

OysterD3

OysterD3 posted a new question

sitemap-module •

404 not found for sitemap.xml

Here is the link to sitemap: https://journey.com.my/sitemap.xml
I am using Nginx, should I set anything on Nginx configuration?

padinko

padinko posted a new feature request

sitemap-module •

idea Get routes config in routes function

What problem does this feature solve?

We are using named dynamic routes (path can change, but name doesn't, so all occurences of path in app are changed automaticly). Now we use api to generate dynamic routes, but can't access actual router config, so we can only staticly add this routes.. but when path changed, we need to change sitemap routes too. It will be great if we can use named routes and change only path and sitemap will still work without change

What does the proposed changes look like?

there will be router config in router parameter (probably second, so callback is still usable)

-or-

there will be some this in router function where we can access router config

miteyema

miteyema posted a new bug report

sitemap-module •

bug sitemap via SRR not working on zeit now

Version

2.0.1

Reproduction link

https://github.com/miteyema/nuxt-sitemap-now

Steps to reproduce

  • I have an api serverless function to return the dynamic routes so I can build a complete sitemap
  • The dynamic routes are added to nuxt generate, so they are available for the sitemap module
  • SRR app works in dev mode, but once deployed with zeit now in production (using nuxt/now-builder), it's not working
  • If I use nuxt generate (to make a static app), sitemap does work

This is the config object for sitemap in nuxt.config.js:

 sitemap: {
    hostname: baseURL,
    defaults: {
      lastmod: new Date(),
      changefreq: 'weekly',
      priority: 0.8
    }
}

The generate part in nuxt.config.js:

generate: {
    async routes() {
      const response = await axios.get('routes', {
        // FYI: generate will always be in production mode
        baseURL: apiBaseURL
      })
      const dynamicRoutes = response.data
      return dynamicRoutes
    }
}

What is expected ?

sitemap.xml is shown

What is actually happening?

"Nuxt.js Internal Server Error" is show with status code 500.
The following log is shown on the server:

ERROR  Cannot read property 'filter' of null
  at node_modules/@nuxtjs/sitemap/lib/routes.js:14:21
  at Array.forEach (<anonymous>)
  at excludeRoutes (node_modules/@nuxtjs/sitemap/lib/routes.js:11:12)
  at Object.cache.staticRoutes (node_modules/@nuxtjs/sitemap/lib/middleware.js:48:30)
  at AsyncCache.load [as _load] (node_modules/@nuxtjs/sitemap/lib/cache.js:19:68)
  at processTicksAndRejections (internal/process/task_queues.js:94:5)
everyx

everyx posted a new feature request

sitemap-module •

idea Allow manually configure routes in SSR mode

What problem does this feature solve?

Thus, when in SSR mode, we can get robots.txt data from api and dynamically generate robots.txt.

like nuxt-community/gtm-module

GTM Initialisation

If you want to block Google Tag Manager before user directly allows (GDPR realisation or other), you can set autoInit option to false and then manually enable using $gtm.init().

Note: All events will be still buffered in data layer but won't send until init() method getting called.