fix: Address dependency issues within KendoReact components.
- add gray-matter to reduce duplicated meta data for posts - rename files in data/BlogPosts/ to address limitations in path handling
This commit is contained in:
@@ -1,4 +1,25 @@
|
||||
// /data/blog-post-data.js
|
||||
import matter from 'gray-matter';
|
||||
|
||||
const modules = import.meta.glob('./BlogPosts/*.md', { query: '?raw', import: 'default' });
|
||||
|
||||
export async function loadPosts() {
|
||||
const posts = [];
|
||||
|
||||
for (const path in modules) {
|
||||
const fileContent = await modules[path]();
|
||||
const { data } = matter(fileContent);
|
||||
|
||||
posts.push({
|
||||
...data,
|
||||
path,
|
||||
});
|
||||
}
|
||||
|
||||
return posts;
|
||||
}
|
||||
|
||||
|
||||
/* // /data/blog-post-data.js
|
||||
export const blogPosts = [
|
||||
{
|
||||
title: "#0 - Setting Up Camp",
|
||||
@@ -87,4 +108,4 @@ export const blogPosts = [
|
||||
tags: null,
|
||||
published: false
|
||||
}
|
||||
];
|
||||
]; */
|
||||
|
Reference in New Issue
Block a user