[#781,blog][s]: /blog will now list files in content/docs when filetype is equal to 'blog'
This commit is contained in:
@@ -21,6 +21,17 @@ export async function getStaticProps() {
|
|||||||
extensions: ['md', 'mdx'],
|
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(
|
const blogsSorted = blogs.sort(
|
||||||
(a, b) =>
|
(a, b) =>
|
||||||
new Date(b.metadata.date).getTime() - new Date(a.metadata.date).getTime()
|
new Date(b.metadata.date).getTime() - new Date(a.metadata.date).getTime()
|
||||||
|
|||||||
Reference in New Issue
Block a user