Personal site and blog, built with Astro, React (small islands), Tailwind CSS v4 (PostCSS), and TypeScript. Content lives in Markdown under src/content/blog/.
npm install
npm run dev # local dev
npm run build # static output → dist/
npm run preview # preview dist locallySet PUBLIC_GA_MEASUREMENT_ID to your G-xxxxxxxxxx ID. For GitHub Actions builds, add a repository secret with the same name. If unset, no analytics script is injected.
EU visitors: consider adding consent mode or a banner before loading GA; this is not implemented here.
The workflow in .github/workflows/deploy.yml uploads dist/ to GitHub Pages. Enable Pages in the repo settings with the GitHub Actions source. The site URL is configured as https://yifangdong.github.io in astro.config.mjs.
Required frontmatter: title, description, pubDate (YYYY-MM-DD), lang (en | zh-cn), tags (array), slug (URL segment, unique per language).
Optional: updatedDate, draft: true, translationKey (same on two posts for EN/ZH hreflang links).
Use fenced code blocks for Shiki highlighting. For Mermaid, use a fenced block with language mermaid (see the sample diagram in code-review-best-practices.md).