feat: Rename image and data files
- Add PostCard component - Add WysiwygEditor component - Use 'front-matter' to parse front matter in markdown files for metadata instead of using redundant data objects
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import matter from 'gray-matter';
|
||||
import fm from 'front-matter';
|
||||
|
||||
const modules = import.meta.glob('./BlogPosts/*.md', { query: '?raw', import: 'default' });
|
||||
|
||||
@@ -7,10 +7,10 @@ export async function loadPosts() {
|
||||
|
||||
for (const path in modules) {
|
||||
const fileContent = await modules[path]();
|
||||
const { data } = matter(fileContent);
|
||||
const { attributes } = fm(fileContent);
|
||||
|
||||
posts.push({
|
||||
...data,
|
||||
...attributes,
|
||||
path,
|
||||
});
|
||||
}
|
||||
|
Reference in New Issue
Block a user