mirror of
https://github.com/facebook/docusaurus.git
synced 2025-06-09 22:32:53 +02:00
feat: pass loaded siteConfig as props for React component
This commit is contained in:
parent
c0194a1f53
commit
11b0d15238
5 changed files with 21 additions and 10 deletions
|
@ -35,6 +35,17 @@ module.exports = function loadConfig(siteDir, deleteCache = true) {
|
|||
);
|
||||
}
|
||||
|
||||
/* Fill default value */
|
||||
const defaultConfig = {
|
||||
customDocsPath: 'docs',
|
||||
docsUrl: 'docs'
|
||||
};
|
||||
Object.keys(defaultConfig).forEach(field => {
|
||||
if (!config[field]) {
|
||||
config[field] = defaultConfig[field];
|
||||
}
|
||||
});
|
||||
|
||||
/*
|
||||
User's own array of custom fields,
|
||||
e.g: if they want to include some field so they can access it later from `props.siteConfig`
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue