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

Commit fb5e00f

Browse files
committed
fix: cannot override default sitemap options
1 parent 89d2a8f commit fb5e00f

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/node/index.ts

+5-3
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,14 @@ module.exports = (options: BlogPluginOptions, ctx: VuePressContext) => {
3535
/**
3636
* Leverage other plugins
3737
*/
38-
let plugins
38+
let plugins: any[][] = []
3939

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

4648
return {

0 commit comments

Comments
 (0)