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:
Ron Rennick 2024-01-05 19:20:31 -04:00 committed by GitHub
parent a7627fbf0e
commit 60b3aa8ed8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 67 additions and 56 deletions

File diff suppressed because one or more lines are too long

View File

@ -1,5 +1,6 @@
--- ---
post_title: Notices post_title: Notices
menu_title: Notice guidelines
--- ---
## Notices ## Notices

View File

@ -24,6 +24,7 @@ export const generatePostFrontMatter = (
'category_title', 'category_title',
'category_slug', 'category_slug',
'content', 'content',
'menu_title',
]; ];
const frontMatter = matter( fileContents, { const frontMatter = matter( fileContents, {

View File

@ -55,6 +55,7 @@ async function processDirectory(
category.content = frontMatter.content; category.content = frontMatter.content;
category.category_slug = frontMatter.category_slug; category.category_slug = frontMatter.category_slug;
category.category_title = frontMatter.category_title; 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. // derive the category title from the directory name, capitalize first letter of each word.
const categoryFolder = path.basename( subDirectory ); const categoryFolder = path.basename( subDirectory );