add support for custom document and category titles (#43340)
* add support for custom document and category titles * remove the s in the source file instead of the manifest --------- Co-authored-by: Ron Rennick <ronald.rennick@automattic.com>
This commit is contained in:
parent
a7627fbf0e
commit
60b3aa8ed8
File diff suppressed because one or more lines are too long
|
@ -1,5 +1,6 @@
|
|||
---
|
||||
post_title: Notices
|
||||
menu_title: Notice guidelines
|
||||
---
|
||||
|
||||
## Notices
|
||||
|
|
|
@ -24,6 +24,7 @@ export const generatePostFrontMatter = (
|
|||
'category_title',
|
||||
'category_slug',
|
||||
'content',
|
||||
'menu_title',
|
||||
];
|
||||
|
||||
const frontMatter = matter( fileContents, {
|
||||
|
|
|
@ -55,6 +55,7 @@ async function processDirectory(
|
|||
category.content = frontMatter.content;
|
||||
category.category_slug = frontMatter.category_slug;
|
||||
category.category_title = frontMatter.category_title;
|
||||
category.menu_title = frontMatter.menu_title;
|
||||
}
|
||||
// derive the category title from the directory name, capitalize first letter of each word.
|
||||
const categoryFolder = path.basename( subDirectory );
|
||||
|
|
Loading…
Reference in New Issue