Refactor navigation links to use Next.js routing and improve post handling

- Updated AboutButton to navigate to the about page using Next.js router.
- Changed HeaderButtons and MobileNav to link directly to the about page.
- Modified Home component to exclude the 'about' post from the posts list.
- Added a helper function to strip YAML frontmatter from post summaries.
- Enhanced API routes to handle reading and writing markdown files for posts.
This commit is contained in:
2025-07-04 17:34:04 +02:00
parent 5a49f37750
commit 525e4fdc35
12 changed files with 626 additions and 13 deletions

View File

@@ -73,6 +73,10 @@ async function readPostsDir(dir: string, relDir = '', pinnedData: { pinned: stri
const posts: any[] = [];
for (const entry of entries) {
// Skip the 'assets' folder
if (entry.isDirectory() && entry.name === 'assets' && relDir === '') {
continue;
}
const fullPath = path.join(dir, entry.name);
const relPath = relDir ? path.join(relDir, entry.name) : entry.name;