[#781,blog][s]: /blog will now list files in content/docs when filetype is equal to 'blog'
This commit is contained in:
parent
17e7434c97
commit
92316d4680
@ -21,6 +21,17 @@ export async function getStaticProps() {
|
||||
extensions: ['md', 'mdx'],
|
||||
});
|
||||
|
||||
// Temporary, while MarkdownDB doesn't support filetypes
|
||||
// Merges docs that have the "blog" filetype
|
||||
let docs = await mddb.getFiles({
|
||||
folder: 'docs',
|
||||
extensions: ['md', 'mdx'],
|
||||
});
|
||||
|
||||
docs = docs.filter((doc) => doc.metadata.filetype === 'blog');
|
||||
|
||||
blogs = [...blogs, ...docs];
|
||||
|
||||
const blogsSorted = blogs.sort(
|
||||
(a, b) =>
|
||||
new Date(b.metadata.date).getTime() - new Date(a.metadata.date).getTime()
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user