feat: update mobile layout, fixes

This commit is contained in:
Andrea
2024-09-24 21:21:59 +02:00
parent 6d72ac0a56
commit bf0a411639
13 changed files with 76 additions and 65 deletions

View File

@@ -6,7 +6,7 @@ import path from "path";
type FrontMatter = {
title: string;
description: string;
published: string;
published: Date;
isFeatured: boolean;
};
@@ -34,11 +34,14 @@ export const getMdxFile = async (file: string) => {
});
};
export type Post = Omit<FrontMatter, "published"> & {
filename: string;
published: string;
};
export const findPosts = async () => {
const files = await readdir(`posts`);
const posts: (FrontMatter & {
filename: string;
})[] = [];
const posts: Post[] = [];
for (const file of files.filter((file) => file.endsWith(".mdx"))) {
const filePath = path.join(process.cwd(), `posts/${file}`);
const { frontmatter } = await bundleMDX<FrontMatter>({
@@ -61,8 +64,9 @@ export const findPosts = async () => {
});
posts.push({
filename: file.replace(".mdx", ""),
...frontmatter,
filename: file.replace(".mdx", ""),
published: frontmatter.published.toISOString(),
});
}