mirror of
https://github.com/waynesutton/markdown-site.git
synced 2026-01-12 04:09:14 +00:00
feat: add sidebar layout support for blog posts
- Add layout field to posts schema and frontmatter - Enable docs-style sidebar layout for posts (previously pages only) - Update Post.tsx to handle sidebar for both posts and pages - Add layout field to Write.tsx frontmatter reference - Update documentation in docs.md, setup-guide.md, how-to-publish.md - Add documentation links to README.md
This commit is contained in:
@@ -36,6 +36,7 @@ interface PostFrontmatter {
|
||||
featuredOrder?: number; // Order in featured section (lower = first)
|
||||
authorName?: string; // Author display name
|
||||
authorImage?: string; // Author avatar image URL (round)
|
||||
layout?: string; // Layout type: "sidebar" for docs-style layout
|
||||
}
|
||||
|
||||
interface ParsedPost {
|
||||
@@ -53,6 +54,7 @@ interface ParsedPost {
|
||||
featuredOrder?: number; // Order in featured section (lower = first)
|
||||
authorName?: string; // Author display name
|
||||
authorImage?: string; // Author avatar image URL (round)
|
||||
layout?: string; // Layout type: "sidebar" for docs-style layout
|
||||
}
|
||||
|
||||
// Page frontmatter (for static pages like About, Projects, Contact)
|
||||
@@ -122,6 +124,7 @@ function parseMarkdownFile(filePath: string): ParsedPost | null {
|
||||
featuredOrder: frontmatter.featuredOrder, // Order in featured section
|
||||
authorName: frontmatter.authorName, // Author display name
|
||||
authorImage: frontmatter.authorImage, // Author avatar image URL
|
||||
layout: frontmatter.layout, // Layout type: "sidebar" for docs-style layout
|
||||
};
|
||||
} catch (error) {
|
||||
console.error(`Error parsing ${filePath}:`, error);
|
||||
|
||||
Reference in New Issue
Block a user