feat(v2): create docusaurus-content-blog plugin draft

This commit is contained in:
Yangshun Tay 2019-02-24 23:11:15 -08:00
parent 211e04f409
commit e5b7daef33
8 changed files with 95 additions and 41 deletions

View file

@ -18,8 +18,8 @@ const REQUIRED_FIELDS = [
'headerIcon',
'organizationName',
'projectName',
'title',
'tagline',
'title',
'url',
];
@ -34,6 +34,7 @@ const OPTIONAL_FIELDS = [
'githubHost',
'highlight',
'markdownPlugins',
'plugins',
];
const DEFAULT_CONFIG = {
@ -94,12 +95,12 @@ function loadConfig(siteDir, deleteCache = true) {
}
config.headerLinks = headerLinks;
/*
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`
*/
// 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`.
const {customFields = []} = config;
// TODO: Check that plugins mentioned exist.
// Don't allow unrecognized fields.
const allowedFields = [
...REQUIRED_FIELDS,