nuxt-community / sitemap-module

Sitemap Module for Nuxt 2
https://sitemap.nuxtjs.org
MIT License
690 stars 128 forks source link

Can not set priority #187

Closed DanSnow closed 3 years ago

DanSnow commented 3 years ago

Reproduction link

N/A

Steps to reproduce

I want to set the priority like this with generate.routes

What is expected ?

The output sitemap.xml will have priority field

What is actually happening?

Could not find the priority field.

Additional comments?

I believe it's because here omits all the properties except the url.

This bug report is available on Nuxt community (#c134)
NicoPennec commented 3 years ago

You can set the priority directly in the generate.routes config as follows and it works fine with the sitemap module:

  generate: {
    routes: [{ url: 'test', priority: 1 }],
  },

In addition, you can set a default priority in the sitemap config as below:

  sitemap: {
    defaults: {
    priority: 1,
  },

(see docs about defaults option)