The website now includes a blog feature that automatically parses markdown files (.md) from the md/ folder and displays them as blog posts on the website.
- Create a new
.mdfile in themd/folder at the root of the project - Write your content in markdown format
- The first
# Headingin the file will be used as the blog post title - The file name (without
.md) will be used as the URL slug
Create a file md/my-new-post.md:
# My New Blog Post
This is the introduction paragraph that will be used as an excerpt.
## Section 1
Your content here...
## Section 2
More content...The post will automatically be available at /blog/my-new-post
- Headings:
#,##,###for h1, h2, h3 - Paragraphs: Regular text separated by blank lines
- Lists:
- Unordered lists with
-or* - Ordered lists with
1.,2., etc.
- Unordered lists with
- Code:
- Inline code with `backticks`
- Code blocks with triple backticks
- Links:
[text](url) - Bold:
**text**or__text__ - Italic:
*text*or_text_ - Blockquotes:
> quote text
react-folio/
├── md/ # Blog posts directory
│ ├── welcome.md # Sample post
│ ├── nextjs-tips.md # Sample post
│ └── tailwind-design.md # Sample post
├── src/
│ ├── app/
│ │ ├── blog/
│ │ │ ├── page.tsx # Blog listing page
│ │ │ └── [slug]/
│ │ │ └── page.tsx # Individual blog post page
│ │ └── components/
│ │ ├── BlogSection.tsx # Blog cards component
│ │ └── BlogPostSection.tsx # Markdown renderer
│ └── data/
│ └── blogUtils.ts # Markdown parsing utilities
react-markdown: Converts markdown to React componentsremark-gfm: GitHub Flavored Markdown support
All blog posts are statically generated at build time using Next.js generateStaticParams. This means:
- Fast page loads
- No runtime markdown parsing
- SEO-friendly
Simply add or remove .md files from the md/ folder and rebuild:
npm run buildThe build process will automatically detect and generate pages for all markdown files.
Blog posts use Tailwind CSS for styling with a custom markdown component configuration that provides:
- Proper typography hierarchy
- Code syntax highlighting
- Responsive design
- Consistent spacing
You can customize the styling by editing src/app/components/BlogPostSection.tsx.