Skip to content

Commit

Permalink
doc: update README
Browse files Browse the repository at this point in the history
add an instruction about the declaration order of sitemap module with other nuxt modules (eg. nuxt-i18n)

fix #32
  • Loading branch information
Nicolas Pennec committed Jan 8, 2019
1 parent 37f3cfb commit eefc7a6
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,17 @@
Module based on the awesome [sitemap](https://github.com/ekalinin/sitemap.js) package ❤️

## Setup

- Add `@nuxtjs/sitemap` dependency using yarn or npm to your project

- Add `@nuxtjs/sitemap` module to `nuxt.config.js`
```js
modules: [
'@nuxtjs/sitemap'
]
````
```
> **notice:** If you use other modules (eg. `nuxt-i18n`), always declare the sitemap module at end of array (eg. `modules: ['nuxt-i18n', '@nuxtjs/sitemap']`)
- Add additional options to `sitemap` section of `nuxt.config.js` to override defaults
```js
sitemap: {
Expand Down Expand Up @@ -92,7 +96,7 @@ Examples:

module.exports = {
sitemap: {
filter ({ routes, options }){
filter ({ routes, options }) {
if (options.hostname === 'example.com') {
return routes.filter(route => route.locale === 'en')
}
Expand Down

0 comments on commit eefc7a6

Please sign in to comment.