mutate themeConfig in plugin onInitialized hook #705
-
Hey there, I created a simple test plugin like this: const {path} = require('@vuepress/utils')
module.exports = (config, ctx) => {
return {
name: 'autonav',
onInitialized(app) {
// double assignment is just to make sure im not using wrong context
app.options.themeConfig.navbar = ctx.options.themeConfig.navbar = [
{ text: 'hello', link: '/'}
]
}
}
} The plugin is loading but changing the configuration has no effect on the navbar. Where is the right place to mutate the navbar config from within a plugin ? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
See @vuepress/plugin-theme-data, that's what are using to provide themeData. You must edit it before returning a plugin api options. |
Beta Was this translation helpful? Give feedback.
See @vuepress/plugin-theme-data, that's what are using to provide themeData.
You must edit it before returning a plugin api options.