Skip to content
This repository has been archived by the owner on May 13, 2024. It is now read-only.

Commit

Permalink
fix: cannot override default sitemap options
Browse files Browse the repository at this point in the history
  • Loading branch information
billyyyyy3320 committed Oct 12, 2019
1 parent 89d2a8f commit fb5e00f
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/node/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,14 @@ module.exports = (options: BlogPluginOptions, ctx: VuePressContext) => {
/**
* Leverage other plugins
*/
let plugins
let plugins: any[][] = []

if (options.sitemap && options.sitemap.hostname) {
const sitemapOptions = { ...options.sitemap, exclude: ['/404.html'] }
const defaultSitemapOptions = { exclude: ['/404.html'] }
const sitemapOptions = Object.assign({}, defaultSitemapOptions, options.sitemap)
// Temporarily use a fork of vuepress-plugin-sitemap. Should switch back when it release the next version.
plugins = [['vuepress-plugin-forked-sitemap', sitemapOptions], ['@vuepress/last-updated']]
const sitemapDependencies = [['vuepress-plugin-forked-sitemap', sitemapOptions], ['@vuepress/last-updated']]
plugins.push(...sitemapDependencies)
}

return {
Expand Down

0 comments on commit fb5e00f

Please sign in to comment.