Skip to contentNEWThe blog is live.Read posts →
Sswayambhu.dev
←All posts

1 min read

Writing in Markdown

How posts on this site work — drop a .md file in content/blog and it becomes a page.

  • #meta
  • #nextjs

This blog is just a folder of Markdown files. Every .md file in content/blog becomes a page at /blog/<file-name>, rendered to static HTML at build time.

Frontmatter

Each post starts with a small YAML header:

content/blog/my-post.md
---
title: My post
description: One sentence shown in lists and link previews.
date: 2026-10-31
tags: [react, notes]
draft: false
---

Only title and date are required. Posts marked draft: true show up while running next dev and are hidden in production builds.

Code

Fenced code blocks are highlighted at build time, so no JavaScript ships for it. Add a title to get a filename tab, and {n} to highlight lines:

lib/greet.ts
export function greet(name: string) {
  return `Hello, ${name}!`;
}

Everything else

GitHub-flavoured Markdown works too:

  • Tables, task lists and strikethrough
  • Headings get anchor ids automatically
  • Your next post
Thing Where
Posts content/blog/*.md
Rendering lib/blog.ts
Code theme lib/code-theme.ts

File names become URLs, so keep them lowercase and kebab-case.