We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Plugins should be able to set default value for siteConfig, and probably themeConfig.
siteConfig
themeConfig
e.g. You create a plugin to fetch siteConfig from headless CMS, but you also want the user to be able to override siteConfig via saber-config.yml.
saber-config.yml
A plugin:
exports.name = 'my-plugin-name' exports.apply = api => { api.hooks.getSaberConfig.tapPromise('my-plugin-name', async config => { config.siteConfig = merge(await getSiteConfigFromApi(), config.siteConfig) return config }) }
Call the getSaberConfig hook before calling afterPlugins hook:
getSaberConfig
afterPlugins
saber/packages/saber/lib/index.js
Line 185 in 83c18a7
And call it again when config file is modified:
saber/packages/saber/lib/plugins/watch-config.js
Line 58 in 83c18a7
The text was updated successfully, but these errors were encountered:
Successfully merging a pull request may close this issue.
Feature request
What problem does this feature solve?
Plugins should be able to set default value for
siteConfig
, and probablythemeConfig
.e.g. You create a plugin to fetch
siteConfig
from headless CMS, but you also want the user to be able to overridesiteConfig
viasaber-config.yml
.What does the proposed API look like?
A plugin:
How should this be implemented in your opinion?
Call the
getSaberConfig
hook before callingafterPlugins
hook:saber/packages/saber/lib/index.js
Line 185 in 83c18a7
And call it again when config file is modified:
saber/packages/saber/lib/plugins/watch-config.js
Line 58 in 83c18a7
The text was updated successfully, but these errors were encountered: