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:
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user