We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 9efc678 commit 441f023Copy full SHA for 441f023
packages/@vuepress/core/lib/node/App.js
@@ -348,7 +348,14 @@ module.exports = class App {
348
computed: new this.ClientComputedMixinConstructor(),
349
enhancers: this.pluginAPI.getOption('extendPageData').items
350
})
351
- this.pages.push(page)
+ const index = this.pages.findIndex(({ path }) => path === page.path)
352
+ if (index >= 0) {
353
+ // Override a page if corresponding path already exists
354
+ logger.warn(`Override existing page ${chalk.yellow(page.path)}.`)
355
+ this.pages.splice(index, 1, page)
356
+ } else {
357
+ this.pages.push(page)
358
+ }
359
}
360
361
/**
0 commit comments