Fetch blog post data from md file frontmatter

This commit is contained in:
Maria Shodunke
2024-02-05 13:22:27 +00:00
parent 02c4d08ee3
commit a4ac70ce43
8 changed files with 522 additions and 103 deletions

View File

@@ -1,9 +1,11 @@
import { indexPages } from './plugins/index-pages.js';
import { codeSamples } from './plugins/code-samples.js';
import { blogPosts } from './plugins/blog-posts.js';
export default function customPlugin() {
const indexPagesInst = indexPages();
const codeSamplesInst = codeSamples();
const blogPostsInst = blogPosts();
@@ -12,10 +14,12 @@ export default function customPlugin() {
processContent: async (content, actions) => {
await indexPagesInst.processContent?.(content, actions);
await codeSamplesInst.processContent?.(content, actions);
await blogPostsInst.processContent?.(content, actions);
},
afterRoutesCreated: async (content, actions) => {
await indexPagesInst.afterRoutesCreated?.(content, actions);
await codeSamplesInst.afterRoutesCreated?.(content, actions);
await blogPostsInst.afterRoutesCreated?.(content, actions);
},
};