{"_id":"@adamcikado/sitemap","_rev":"1-d977f7bcc159bbf21b6f2016e416486d","name":"@adamcikado/sitemap","dist-tags":{"latest":"2.4.0"},"versions":{"2.4.0":{"name":"@adamcikado/sitemap","version":"2.4.0","description":"Automatically generate or serve dynamic sitemap.xml for Nuxt.js projects","keywords":["nuxt","nuxt.js","nuxtjs","seo","sitemap","sitemap.xml","ssr"],"repository":{"type":"git","url":"git+https://github.com/nuxt-community/sitemap-module.git"},"license":"MIT","contributors":[{"name":"Nicolas Pennec"},{"name":"Pooya Parsa"}],"main":"lib/module.js","scripts":{"build":"nuxt build test/fixture","dev":"nuxt test/fixture","format":"yarn lint --fix","generate":"nuxt generate test/fixture","lint":"eslint . --ext js,vue","preview":"standard-version --dry-run","release":"standard-version && git push --follow-tags && npm publish","start":"nuxt start test/fixture","test":"yarn lint && yarn unit","unit":"jest"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"lint-staged","pre-push":"yarn test"}},"lint-staged":{"*.{js,vue}":["eslint --fix"]},"dependencies":{"async-cache":"^1.1.0","consola":"^2.15.0","etag":"^1.8.1","fresh":"^0.5.2","fs-extra":"^8.1.0","is-https":"^2.0.2","lodash.unionby":"^4.8.0","minimatch":"^3.0.4","sitemap":"^4.1.1"},"devDependencies":{"@babel/runtime-corejs2":"latest","@commitlint/cli":"latest","@commitlint/config-conventional":"latest","@nuxtjs/eslint-config":"latest","codecov":"latest","eslint":"latest","eslint-config-prettier":"latest","eslint-plugin-prettier":"latest","husky":"latest","jest":"latest","lint-staged":"latest","node-fetch":"latest","nuxt":"latest","nuxt-i18n":"latest","prettier":"latest","standard-version":"latest"},"engines":{"node":">=8.9.0","npm":">=5.0.0"},"publishConfig":{"access":"public"},"gitHead":"3971092cc990c784ce75c0ba4b995dd3eac7a2e0","bugs":{"url":"https://github.com/nuxt-community/sitemap-module/issues"},"homepage":"https://github.com/nuxt-community/sitemap-module#readme","_id":"@adamcikado/sitemap@2.4.0","_nodeVersion":"12.13.1","_npmVersion":"6.14.8","dist":{"integrity":"sha512-PG3Emfw1XZ5bhFk1BIhEGGAybZhM/5171TNuB8fX+KAg9kFlcG3Err4gbqTr9FDpAbRoYEaPsMWeToz212ci9w==","shasum":"e1d12ba661a76631a5ef7f4f350fe2d68b8c0f28","tarball":"https://registry.npmjs.org/@adamcikado/sitemap/-/sitemap-2.4.0.tgz","fileCount":12,"unpackedSize":52874,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfewi1CRA9TVsSAnZWagAATaEP/2I6JAxfU7L5rU2dlLBU\n4D8TVI6C6nYy6ZbwOmA9hYq4MhTz71olUWSR21ORpTTlw+IjfevY4y8wayfQ\ne3cTccEljH9Y/EhLdUCsJuXqt4/YCCZf3bCR7qXdFSZJiFfz20OHIai6pmB1\nzNaMeR+CdooYizNj44Og5tgUlPTen+UJRo8+iACm9TvXomrDsIGQYUT8nfV5\nD0QoUV9GZfq0W4SfWT2Z2LYqEPahXuUnSTS0EmlF/O6TzsAvifWQPFxzUee/\n5i5mNBJqW3+dj8KodEVEw4NOXSSkAanVAapElh0ZRemxdgBsNDiV01o9suIT\nIhq0owmXrbHfpAMCSiC4viB1XWdAEUga2zH/5Xldsrr1eWJuttLQPrkFk4SO\nDEJCZeHAiUUL7qygUFEc99mp6KXm4M+pPe3oKAdgAqb5PlG6xAnmSeD4nXh4\nCukg3YP+Vsz8+T0Fk566tilgiY+fE1VEHB3T4+O2md/Jo8EKfzEAyZlZnX4K\nfDFCZPSD6eT/txc6RlCKbEa1Dr6x6K3Iq96dKaHQMoXxDdPkB9U+e47qIOAs\nBwEDjSZuPPkQ1e/8SuHUWfi4X+/RkIPj5Nhg9PS1bnlHMHEdDNh8YBwJxjv5\nTMvhoPftNc3RrFBfW2KLmWDM+DhgQhktVR1pgIpROaObuu0CdvjIrj+9AN+F\nPi+8\r\n=MY7t\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCsinrqbQUEBlnN3UZkV4jMH/GlZVGXJu1zmqJO392f8gIhAPmnqu8oOUl5IvMgXQSy/ZpMdjRqwLihtVzJATQu7QoF"}]},"maintainers":[{"name":"adamcikado","email":"adamcikado@gmail.com"}],"_npmUser":{"name":"adamcikado","email":"adamcikado@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/sitemap_2.4.0_1601898676500_0.9758516359559151"},"_hasShrinkwrap":false}},"time":{"created":"2020-10-05T11:51:16.464Z","2.4.0":"2020-10-05T11:51:16.703Z","modified":"2022-04-04T11:25:09.117Z"},"maintainers":[{"name":"adamcikado","email":"adamcikado@gmail.com"}],"description":"Automatically generate or serve dynamic sitemap.xml for Nuxt.js projects","homepage":"https://github.com/nuxt-community/sitemap-module#readme","keywords":["nuxt","nuxt.js","nuxtjs","seo","sitemap","sitemap.xml","ssr"],"repository":{"type":"git","url":"git+https://github.com/nuxt-community/sitemap-module.git"},"contributors":[{"name":"Nicolas Pennec"},{"name":"Pooya Parsa"}],"bugs":{"url":"https://github.com/nuxt-community/sitemap-module/issues"},"license":"MIT","readme":"# Sitemap Module\n\n[![npm (scoped with tag)](https://img.shields.io/npm/v/@nuxtjs/sitemap/latest?style=flat-square)](https://npmjs.com/package/@nuxtjs/sitemap)\n[![Downloads](https://img.shields.io/npm/dw/@nuxtjs/sitemap?style=flat-square)](https://npmjs.com/package/@nuxtjs/sitemap)\n[![Build Status](https://img.shields.io/circleci/project/github/nuxt-community/sitemap-module?style=flat-square)](https://app.circleci.com/pipelines/github/nuxt-community/sitemap-module)\n[![Coverage Status](https://img.shields.io/codecov/c/github/nuxt-community/sitemap-module?style=flat-square)](https://codecov.io/gh/nuxt-community/sitemap-module)\n[![License](https://img.shields.io/npm/l/@nuxtjs/sitemap?style=flat-square)](http://standardjs.com)\n\n> Automatically generate or serve dynamic [sitemap.xml](https://www.sitemaps.org/protocol.html) for Nuxt.js projects!\n\n[📖 **Release Notes**](./CHANGELOG.md)\n\n## Features\n\n- Module based on the awesome **[sitemap.js](https://github.com/ekalinin/sitemap.js) package** ❤️\n- Create **sitemap** or **sitemap index**\n- Automatically add the static routes to each sitemap\n- Support **i18n** routes from **nuxt-i18n** (latest version)\n- Works with **all modes** (SSR, SPA, generate)\n- For **Nuxt 2.x** and higher\n\n---\n\n## Table of Contents\n\n- [Install](#installation)\n- [Setup](#setup)\n- [Usage](#usage)\n- [Sitemap Options](#sitemap-options)\n- [Sitemap Index Options](#sitemap-index-options)\n- [Routes Declaration](#routes-declaration)\n- [Hooks](#hooks)\n\n## Installation\n\n```shell\nnpm install @nuxtjs/sitemap\n```\n\nor\n\n```shell\nyarn add @nuxtjs/sitemap\n```\n\n## Setup\n\nAdd `@nuxtjs/sitemap` to the `modules` section of your `nuxt.config.js` file:\n\n```js\n{\n  modules: [\n    '@nuxtjs/sitemap'\n  ],\n}\n```\n\n> **notice:**  \n> If you use other modules (eg. `nuxt-i18n`), always declare the sitemap module at end of array  \n> eg. `modules: ['nuxt-i18n', '@nuxtjs/sitemap']`\n\n### Configuration\n\nAdd a custom configuration with the `sitemap` property:\n\n```js\n// nuxt.config.js\n\n{\n  modules: [\n    '@nuxtjs/sitemap'\n  ],\n  sitemap: {\n    // options\n  },\n}\n```\n\nThe module option parameter can be:\n\n### `Object`\n\nA single item of [sitemap](#sitemap-options) or [sitemap index](#sitemap-index-options):\n\n```js\n{\n  sitemap: {\n    // ...\n  },\n}\n```\n\n### `Array`\n\nA list of [sitemap](#sitemap-options) or [sitemap index](#sitemap-index-options) items:\n\n```js\n{\n  sitemap: [\n    {\n      // ...\n    },\n    {\n      // ...\n    },\n  ],\n}\n```\n\n### `Function`\n\nA function that returns a valid sitemap configuration:\n\n```js\n{\n  sitemap: function () {\n    return {\n      // ...\n    }\n  },\n}\n```\n\n### `Boolean`\n\nYou can disable the sitemap module with a boolean value at `false`:\n\n```js\n{\n  sitemap: false\n}\n```\n\n## Usage\n\n### Setup a Sitemap\n\nBy default, the sitemap is setup to the following path: `/sitemap.xml`  \nAll static routes (eg. `/pages/about.vue`) are automatically add to the sitemap, but you can exclude each of them with the [`exclude`](#exclude-optional---string-array) property.  \nFor dynamic routes (eg. `/pages/_id.vue`), you have to declare them with the [`routes`](#routes-optional---array--function) property. This option can be an array or a function. In addition, the routes defined in `generate.routes` will be automatically used for the sitemap.\n\n```js\n// nuxt.config.js\n\n{\n  sitemap: {\n    hostname: 'https://example.com',\n    gzip: true,\n    exclude: [\n      '/secret',\n      '/admin/**'\n    ],\n    routes: [\n      '/page/1',\n      '/page/2',\n      {\n        url: '/page/3',\n        changefreq: 'daily',\n        priority: 1,\n        lastmod: '2017-06-30T13:30:00.000Z'\n      }\n    ]\n  }\n}\n```\n\n### Setup a Sitemap Index\n\nTo declare a sitemap index and its linked sitemaps, use the [`sitemaps`](#sitemaps---array-of-object) property.  \nBy default, the sitemap index is setup to the following path: `/sitemapindex.xml`  \nEach item of the `sitemaps` array can be setup with its own [sitemap options](#sitemap-options).\n\n```js\n// nuxt.config.js\n\n{\n  sitemap: {\n    hostname: 'https://example.com',\n    lastmod: '2017-06-30',\n    sitemaps: [\n      {\n        path: '/sitemap-foo.xml',\n        routes: ['foo/1', 'foo/2'],\n        gzip: true\n      }, {\n        path: '/folder/sitemap-bar.xml',\n        routes: ['bar/1', 'bar/2'],\n        exclude: ['/**']\n      }\n    ]\n  }\n}\n```\n\n### Setup a list of sitemaps\n\nTo declare a list of sitemaps, use an `array` to setup each sitemap with its own configuration.  \nYou can combine sitemap and sitemap index configurations.\n\n```js\n// nuxt.config.js\n\n{\n  sitemap: [\n    {\n      path: '/sitemap-products.xml',\n      routes: [\n        // array of URL\n      ]\n    }, {\n      path: '/sitemap-news.xml',\n      routes: () => // promise or function\n    }, {\n      path: '/sitemapindex.xml',\n      sitemaps: [{\n        // array of Sitemap configuration\n      }]\n    }\n  }\n}\n```\n\n## Sitemap Options\n\n### `routes` (optional) - array | function\n\n- Default: `[]` or [`generate.routes`](https://nuxtjs.org/api/configuration-generate#routes) value from your `nuxt.config.js`\n\nThe `routes` parameter follows the same way than the `generate` [configuration](https://nuxtjs.org/api/configuration-generate#routes).\n\nSee as well the [routes declaration](#routes-declaration) examples below.\n\n### `path` (optional) - string\n\n- Default: `/sitemap.xml`\n\nThe URL path of the generated sitemap.\n\n### `hostname` (optional) - string\n\n- Default:\n  1. `sitemap.hostname` value from your `nuxt.config.js`\n  2. [`build.publicPath`](https://nuxtjs.org/api/configuration-build/#publicpath) value from your `nuxt.config.js` (⚠️ **deprecated**)\n  3. [`os.hostname()`](https://nodejs.org/api/os.html#os_os_hostname) in **generate** or **spa** mode, or dynamically based on request URL (`headers.host`) in **ssr** mode\n\nThis value is **mandatory** for generation sitemap file, and you should explicitly provide it in **generate** or **spa** mode.\n\n⚠️ The usage of `build.publicPath` as default value is deprecated and will be removed on release v3.0.  \nTo disable it on the current release, set a falsy value (eg. `hostname: false`).\n\n### `cacheTime` (optional) - number\n\n- Default: `1000 * 60 * 15` (15 Minutes)\n\nDefines how frequently sitemap **routes** should be updated (value in milliseconds).  \nSetting a negative value will disable the cache.\n\nPlease note that after each invalidation, `routes` will be evaluated again (see [routes declaration](#routes-declaration) section).\n\nThis option is only available in **ssr** mode.\n\n### `etag` (optional) - object\n\n- Default: [`render.etag`](https://nuxtjs.org/api/configuration-render#etag) value from your `nuxt.config.js`\n\nEnable the etag cache header on sitemap (see [etag](https://nuxtjs.org/api/configuration-render#etag) docs for possible options).\n\nTo disable etag for sitemap set `etag: false`\n\nThis option is only available in **ssr** mode.\n\n### `exclude` (optional) - string array\n\n- Default: `[]`\n\nThe `exclude` parameter is an array of [glob patterns](https://github.com/isaacs/minimatch#features) to exclude static routes from the generated sitemap.\n\n### `filter` (optional) - function\n\n- Default: `undefined`\n\nIf the `filter` option is set as a function, all routes will be filtered through it.\n\nThis option is useful to customize or extend the features of the module, before the sitemap generation.\n\nExamples:\n\n```js\n// nuxt.config.js\n\n// Filter routes by language\n{\n  sitemap: {\n    filter ({ routes, options }) {\n      if (options.hostname === 'example.com') {\n        return routes.filter(route => route.locale === 'en')\n      }\n      return routes.filter(route => route.locale === 'fr')\n    }\n  }\n}\n\n// Add a trailing slash to each route\n{\n  sitemap: {\n    filter ({ routes }) {\n      return routes.map(route => {\n        route.url = `${route.url}/`\n        return route\n      })\n    }\n  }\n}\n```\n\n### `gzip` (optional) - boolean\n\n- Default: `false`\n\nEnable the creation of the `.xml.gz` sitemap compressed with gzip.\n\n### `xmlNs` (optional) - string\n\n- Default: `undefined`\n\nSet the XML namespaces by override all default `xmlns` attributes in `<urlset>` element.\n\n```js\n// nuxt.config.js\n\n{\n  sitemap: {\n    xmlNs: 'xmlns=\"http://www.sitemaps.org/schemas/sitemap/0.9\"'\n  }\n}\n```\n\n### `xslUrl` (optional) - string\n\n- Default: `undefined`\n\nThe URL path of the XSL file to style the sitemap.\n\n### `trailingSlash` (optional) - boolean\n\n- Default: `false`\n\nAdd a trailing slash to each route URL (eg. `/page/1` => `/page/1/`)\n\n> **notice:** To avoid [duplicate content](https://support.google.com/webmasters/answer/66359) detection from crawlers, you have to configure an HTTP 301 redirect between the 2 URLs (see [redirect-module](https://github.com/nuxt-community/redirect-module) or [nuxt-trailingslash-module](https://github.com/WilliamDASILVA/nuxt-trailingslash-module)).\n\n### `i18n` (optional) - string | object\n\n- Default: `undefined`\n\nConfigure the support of localized routes from **[nuxt-i18n](https://www.npmjs.com/package/nuxt-i18n)** module.\n\nIf the `i18n` option is configured, the sitemap module will automatically add the default locale URL of each page in a `<loc>` element, with child `<xhtml:link>` entries listing every language/locale variant of the page including itself (see [Google sitemap guidelines](https://support.google.com/webmasters/answer/189077)).\n\nExample:\n\n```js\n// nuxt.config.js\n\n{\n  modules: [\n    'nuxt-i18n',\n    '@nuxtjs/sitemap'\n  ],\n  i18n: {\n    locales: ['en', 'es', 'fr'],\n    defaultLocale: 'en'\n  },\n  sitemap: {\n    hostname: 'https://example.com',\n    // shortcut notation (basic)\n    i18n: true,\n    // nuxt-i18n notation (advanced)\n    i18n: {\n      locales: ['en', 'es', 'fr'],\n      routesNameSeparator: '___'\n    }\n  }\n}\n```\n\n```xml\n  <url>\n    <loc>https://example.com/</loc>\n    <xhtml:link rel=\"alternate\" hreflang=\"en\" href=\"https://example.com/\"/>\n    <xhtml:link rel=\"alternate\" hreflang=\"es\" href=\"https://example.com/es/\"/>\n    <xhtml:link rel=\"alternate\" hreflang=\"fr\" href=\"https://example.com/fr/\"/>\n  </url>\n  <url>\n    <loc>https://example.com/es/</loc>\n    <xhtml:link rel=\"alternate\" hreflang=\"en\" href=\"https://example.com/\"/>\n    <xhtml:link rel=\"alternate\" hreflang=\"es\" href=\"https://example.com/es/\"/>\n    <xhtml:link rel=\"alternate\" hreflang=\"fr\" href=\"https://example.com/fr/\"/>\n  </url>\n  <url>\n    <loc>https://example.com/fr/</loc>\n    <xhtml:link rel=\"alternate\" hreflang=\"en\" href=\"https://example.com/\"/>\n    <xhtml:link rel=\"alternate\" hreflang=\"es\" href=\"https://example.com/es/\"/>\n    <xhtml:link rel=\"alternate\" hreflang=\"fr\" href=\"https://example.com/fr/\"/>\n  </url>\n```\n\n### `defaults` (optional) - object\n\n- Default: `{}`\n\nThe `defaults` parameter set the default options for all routes.\n\n```js\n// nuxt.config.js\n\n{\n  sitemap: {\n    defaults: {\n      changefreq: 'daily',\n      priority: 1,\n      lastmod: new Date()\n    }\n  }\n}\n```\n\nSee available options: https://github.com/ekalinin/sitemap.js/blob/4.1.1/README.md#sitemap-item-options\n\n## Sitemap Index Options\n\n### `path` (optional) - string\n\n- Default: `/sitemapindex.xml`\n\nThe URL path of the generated sitemap index.\n\n### `hostname` (optional) - string\n\nSet the `hostname` value to each sitemap linked to its sitemap index.\n\n### `sitemaps` - array of object\n\n- Default: `[]`\n\nArray of [sitemap configuration](#sitemap-options]) linked to the sitemap index.\n\n```js\n// nuxt.config.js\n\n{\n  sitemap: {\n    path: '/sitemapindex.xml',\n    hostname: 'https://example.com',\n    sitemaps: [\n      {\n        path: '/sitemap-foo.xml',\n        // ...\n      }, {\n        path: '/folder/sitemap-bar.xml',\n        // ...\n      }\n    ]\n  }\n}\n```\n\n```xml\n<!-- generated sitemapindex.xml -->\n\n<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<sitemapindex xmlns=\"http://www.sitemaps.org/schemas/sitemap/0.9\">\n  <sitemap>\n    <loc>https://example.com/sitemap-foo.xml</loc>\n  </sitemap>\n  <sitemap>\n    <loc>https://example.com/folder/sitemap-bar.xml</loc>\n  </sitemap>\n</sitemapindex>\n```\n\nSee more [examples](#usage) above.\n\n### `lastmod` (optional) - string\n\nSet the `lastmod` value to each sitemap linked to its sitemap index.\n\nIn addition, the `lastmod` can be defined for each linked sitemap.\n\n```js\n// nuxt.config.js\n\n{\n  sitemap: {\n    lastmod: \"2020-01-01\",\n    sitemaps: [\n      {\n        path: '/sitemap-foo.xml',\n        lastmod: \"2020-01-02\"\n      }, {\n        path: '/sitemap-bar.xml'\n      }\n    ]\n  }\n}\n```\n\n### `etag` (optional) - object\n\n- Default: [`render.etag`](https://nuxtjs.org/api/configuration-render#etag) value from your `nuxt.config.js`\n\nEnable the etag cache header on sitemap index (See [etag](https://nuxtjs.org/api/configuration-render#etag) docs for possible options).\n\nTo disable etag for sitemap index set `etag: false`\n\nThis option is only available in **ssr** mode.\n\n### `gzip` (optional) - boolean\n\n- Default: `false`\n\nEnable the creation of the `.xml.gz` sitemap index compressed with gzip.\n\n### `xmlNs` (optional) - string\n\n- Default: `undefined`\n\nSet the XML namespaces by override all default `xmlns` attributes in `<sitemapindex>` element.\n\n```js\n// nuxt.config.js\n\n{\n  sitemap: {\n    xmlNs: 'xmlns=\"http://www.sitemaps.org/schemas/sitemap/0.9\"',\n    sitemaps: [...]\n  }\n}\n```\n\n### `xslUrl` (optional) - string\n\n- Default: `undefined`\n\nThe URL path of the XSL file to style the sitemap index.\n\n## Routes Declaration\n\nBy default, the dynamic routes are ignored by the sitemap module.  \nNuxt cannot automatically provide this type of complex routes.\n\nExample:\n\n```\n-| pages/\n---| index.vue  --> static route\n---| about.vue  --> static route\n---| users/\n-----| _id.vue  --> dynamic route\n```\n\nIf you want the module to add any route with dynamic parameters, you have to set an array of dynamic routes.\n\neg. add routes for `/users/:id` in the configuration:\n\n### From a static list\n\n```js\n// nuxt.config.js\n\n{\n  sitemap: {\n    routes: ['/users/1', '/users/2', '/users/3']\n  }\n}\n```\n\n### From a function which returns a Promise\n\n```js\n// nuxt.config.js\n\nconst axios = require('axios')\n\n{\n  sitemap: {\n    routes: async () => {\n      const { data } = await axios.get('https://jsonplaceholder.typicode.com/users')\n      return data.map((user) => `/users/${user.username}`)\n    }\n  }\n}\n```\n\n\n## Hooks\n\nHooks are listeners to Nuxt events. [Learn more](https://nuxtjs.org/api/configuration-hooks)\n\nYou can register hooks on certain life cycle events.\n\n| Hook  | Arguments  | When  | \n|---|---|---|\n| sitemap:generate:before  | (nuxt, sitemapOptions)  | Hook on before site generation  |\n| sitemap:generate:done  |  (nuxt) | Hook on sitemap generation finished |\n\n## License\n\n[MIT License](./LICENSE)\n\n## Contributors\n\n- [Nicolas Pennec](https://github.com/NicoPennec)\n- [Pooya Parsa](https://github.com/pi0)\n","readmeFilename":"README.md"}