Writing Articles Here — Markdown, Code and Math
The source of this site is on GitHub at yutaro-sakamoto/yutaro-sakamoto.github.io.
Articles are plain Markdown (or MDX) files under src/data/blog/en/
(src/data/blog/ja/ for the Japanese versions). This post doubles as a reference for the available syntax.
Frontmatter
Every article starts with frontmatter:
---
title: "Title of the article"
description: "Used on the index page and for social cards"
pubDate: 2026-08-22
updatedDate: 2026-08-23 # optional
tags: ["Astro", "Markdown"]
draft: false # true keeps it out of production builds
math: true # set for posts containing TeX
---
The schema is validated with Zod in src/content.config.ts, so a missing field fails the build instead of shipping a broken page.
Code
Code blocks are highlighted at build time by Shiki — no client-side JavaScript involved.
fn main() {
let cobol_files: Vec<_> = std::env::args()
.skip(1)
.filter(|p| p.ends_with(".cbl"))
.collect();
for path in &cobol_files {
println!("parsing {path}");
}
}
IDENTIFICATION DIVISION.
PROGRAM-ID. HELLO.
PROCEDURE DIVISION.
DISPLAY "HELLO, WORLD".
STOP RUN.
Math
Math is written in TeX and rendered to HTML by KaTeX during the build.
Inline math goes between $...$: the generalized Petersen graph has vertices.
Display math goes between $$...$$:
Environments work as expected:
Everything else
GitHub Flavored Markdown is enabled, so tables and task lists work too.
| Dish | Time | Notes |
|---|---|---|
| Curry | 40 min | Even better the next day |
| Miso soup | 10 min | Do not boil it after adding miso |
| Fried chicken | 30 min | Fry it twice for a crisp coating |
Blockquotes are available as well.
- An open task
- A finished task
Publishing
Add the Markdown file, push to main, and GitHub Actions builds and deploys the site to GitHub Pages.
To preview locally:
npm install
npm run dev