The Betirement blog system uses Markdown files with frontmatter for content management. Blog posts are statically generated at build time for optimal performance.
Create a new .md file in src/data/blog/ with a kebab-case filename:
src/data/blog/your-post-slug.md
Every blog post must include frontmatter at the top:
---
title: "Your Post Title"
excerpt: "A brief summary of your post (150-200 characters)"
coverImage: "/images/blog/your-image.jpg"
publishedAt: "2024-01-01"
category: "Category Name"
tags: ["tag1", "tag2", "tag3"]
featured: false
---After the frontmatter, write your content using standard Markdown:
# Main Heading
Your introduction paragraph.
## Section Heading
Content with **bold** and *italic* text.
- List item 1
- List item 2
[Link text](https://example.com)- title (string): The post title (used in SEO and display)
- excerpt (string): Brief summary for cards and SEO
- coverImage (string): Path to cover image (1200x630px recommended)
- publishedAt (string): Publication date in YYYY-MM-DD format
- category (string): Post category (see categories below)
- tags (array): Array of relevant tags
- updatedAt (string): Last update date in YYYY-MM-DD format
- featured (boolean): Set to
trueto feature on homepage (default: false) - author (object): Override default author
author: name: "Author Name" avatar: "/images/author/avatar.jpg" bio: "Short bio"
- seo (object): Override SEO metadata
seo: title: "Custom SEO Title" description: "Custom meta description" keywords: ["keyword1", "keyword2"] ogImage: "/images/custom-og.jpg"
Use one of these standard categories:
- Bitcoin Fundamentals: Basic Bitcoin education
- Retirement Planning: Retirement strategies and planning
- Investment Strategies: Investment approaches and tactics
- Market Analysis: Market trends and analysis
- Success Stories: Personal stories and case studies
- Getting Started: Beginner guides and introductions
Common tags to use:
- bitcoin
- retirement
- investing
- strategy
- basics
- advanced
- market analysis
- financial freedom
- portfolio
- security
- Headings:
#,##,### - Bold:
**text** - Italic:
*text* - Links:
[text](url) - Lists:
- itemor1. item - Code:
`code`or `language - Blockquotes:
> quote - Images:

The blog system automatically applies styling:
- Headings use the brand font (Inter)
- Links are styled in Bitcoin orange
- Code blocks have syntax highlighting
- Lists are properly spaced
- Images are responsive
- Location:
/public/images/blog/ - Dimensions: 1200x630px (optimal for social sharing)
- Format: WebP preferred, JPG/PNG acceptable
- Size: < 200KB for performance
Images are automatically optimized by Next.js Image component.
Reading time is automatically calculated based on content length (approximately 200 words per minute).
- Meta titles and descriptions from frontmatter
- Open Graph tags for social sharing
- Twitter Card tags
- Canonical URLs
- Schema.org Article markup
- Automatic sitemap generation
- Title: 50-60 characters, include target keyword
- Excerpt: 150-160 characters, compelling summary
- Keywords: 3-5 relevant tags
- Images: Always include descriptive alt text
- Links: Use descriptive anchor text
Blog posts are accessible at:
/content/blog/[slug]
Where [slug] is the filename without the .md extension.
/content/blog?category=Bitcoin%20Fundamentals
/content/blog?tag=retirement
/content/blog?search=bitcoin
# Create new file
touch src/data/blog/my-new-post.md
# Add frontmatter and content# Add image to public directory
cp my-image.jpg public/images/blog/npm run dev
# Visit http://localhost:3000/content/blognpm run build
# Posts are statically generatedThe blog system provides utility functions in src/lib/blog.ts:
getAllBlogPosts(): Get all posts sorted by dategetBlogPostBySlug(slug): Get single postgetBlogPostsByCategory(category): Filter by categorygetBlogPostsByTag(tag): Filter by taggetAllCategories(): Get all unique categoriesgetAllTags(): Get all unique tagsgetFeaturedBlogPosts(limit?): Get featured postssearchBlogPosts(query): Search posts
Each blog post includes social sharing buttons for:
- Copy link
- Static Generation: All posts pre-rendered at build time
- Image Optimization: Automatic WebP conversion and lazy loading
- Code Splitting: Each post loaded on demand
- Caching: Aggressive caching for static assets
Planned features:
- MDX support for interactive components
- Related posts suggestions
- Comments system integration
- Newsletter signup integration
- Author pages
- Series/collections
- Table of contents generation
- Estimated reading progress
- Check frontmatter syntax (YAML format)
- Ensure file is in
src/data/blog/ - Verify filename ends with
.md - Rebuild the site:
npm run build
- Check image path starts with
/ - Verify image exists in
public/images/blog/ - Check image filename matches exactly (case-sensitive)
- Validate frontmatter YAML syntax
- Check for special characters in content
- Ensure all required fields are present
- Run
npm run buildto see specific errors
For questions or issues with the blog system, refer to:
- Next.js documentation: https://nextjs.org/docs
- Markdown guide: https://www.markdownguide.org/
- Project README:
/README.md