feat: hide blog posts

This commit is contained in:
Alexander Daichendt 2022-07-26 13:15:10 +02:00
parent 94ca2a8a2a
commit c891a924cd
6 changed files with 49 additions and 6 deletions

View file

@ -10,10 +10,12 @@ export async function GET() {
resolved.forEach(({ metadata }, index) => {
const path = Object.keys(modules)[index].replace('.svx', '');
posts.push({ ...metadata, href: `blog/${path}` });
if (!metadata.hidden) posts.push({ ...metadata, href: `blog/${path}` });
});
posts.sort((a, b) => new Date(b.date).valueOf() - new Date(a.date).valueOf());
return {
body: { posts }
body: { posts },
};
}