Sitemap generator plugin for vuepress.
Branch: master
Clone or download
Latest commit 3788874 Jan 30, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.editorconfig chore: configure workflow Nov 2, 2018
.eslintrc.yml chore: configure workflow Nov 2, 2018
.gitignore chore: initialize Sep 28, 2018
.npmignore chore: npm ignore ides Nov 2, 2018
.release-it.json chore(workflow): release using release-it Oct 28, 2018
CHANGELOG.md chore: changelog Jan 3, 2019
README.md docs: typo Jan 31, 2019
cli.js chore: configure workflow Nov 2, 2018
commitlint.config.js chore: configure workflow Nov 2, 2018
index.js fix: orange color not supported in every terminal (#12) Jan 3, 2019
lint-staged.config.js chore: configure workflow Nov 2, 2018
package.json chore: bump version Jan 3, 2019
yarn.lock

README.md

vuepress-plugin-sitemap

Sitemap generator plugin for vuepress.

Install

  • Yarn

    yarn add vuepress-plugin-sitemap
  • NPM

    npm install vuepress-plugin-sitemap

in v2.0.0, dependencies except sitemap are moved to peerDependencies so we need to install esm module manually (chalk and commander are already installed by vuepress) when we use this plugin with cli method.

Usage

Vuepress v1.x

// .vuepress/config.js
module.exports = {
  plugins: {
    'sitemap': {
      hostname: 'https://pake.web.id'
    },
  }
}

Vuepress v0.x

There's no plugin supported with Vuepress v0.x so we need to run it after the build process manually (or with npm postbuild script).

  1. Manual

    ./node_modules/.bin/vuepress -d "dist"
    ./node_modules/.bin/vuepress-sitemap -H "https://pake.web.id" -d "dist"
  2. NPM Script

    {
      scripts: {
        build: "vuepress build docs -d dist",
        postbuild: "vuepress-sitemap -H https://pake.web.id -d dist"
      }
    }

Options

hostname:
  type: string
  required: true
  default: null
  description: website root url
  example: https://pake.web.id

outFile:
  type: string
  required: false
  default: sitemap.xml
  description: sitemap file name
  example: sitemap.txt

urls:
  type: array
  required: false
  default: [],
  description: custom urls to append
  example: [
    { url: '/place', changefreq: 'montly'}
  ]

Note: Other options of sitemap can be used, all options passed except urls, hostname, cacheTime, xslUrl, xmlNs and outFile will be passed to url option

Todo

  • Localization

Related Plugins