A modern, bilingual (English/Vietnamese) blog built with Astro, TypeScript, and Tailwind CSS.
- π Astro SSR - Fast server-side rendering with Vercel
- π Bilingual - Full English/Vietnamese support with URL-based switching
- π MDX Support - Write blog posts in Markdown with JSX components
- π¨ Tailwind CSS - Beautiful, responsive design with 3 themes (Light/Sepia/Dark)
- π¬ Giscus Comments - GitHub Discussions powered comments
- π€ Custom Fonts - Merriweather (headings), Inter (body), JetBrains Mono (code)
- β‘ TypeScript - Type-safe development
- π SEO Optimized - Meta tags, Open Graph, hreflang for bilingual content
- Node.js 18+
- npm or yarn
# Clone the repository
git clone https://github.com/your-username/your-repo.git
cd your-repo
# Install dependencies
npm install
# Copy environment variables
cp .env.example .env
# Edit .env and add your values
# Start development server
npm run devVisit http://localhost:4321 (or the port shown in terminal)
# Start development server
npm run dev
# Build for production
npm run build
# Preview production build locally
npm run preview
# Type checking
npm run astro check/
βββ docs/ # Documentation
β βββ DEPLOYMENT.md # Deployment guide
β βββ GISCUS-SETUP.md # Giscus setup guide
β βββ CODE-REVIEW-ISSUES.md
βββ src/
β βββ content/
β β βββ blog/ # Blog posts (MDX files)
β β β βββ *.en.mdx # English posts
β β β βββ *.vi.mdx # Vietnamese posts
β β βββ config.ts # Content collections schema
β βββ components/ # Astro components
β βββ layouts/ # Page layouts
β βββ pages/ # Routes (index, blog, about, 404)
β βββ styles/ # Global styles
β βββ utils/ # Utilities (i18n, helpers)
β βββ env.d.ts
βββ public/ # Static assets
β βββ images/
βββ astro.config.mjs # Astro configuration
βββ tailwind.config.mjs # Tailwind configuration
βββ tsconfig.json # TypeScript configuration
βββ .env.example # Environment variables template
βββ package.json
Create two files in src/content/blog/ (one for each language):
English version (my-post.en.mdx):
---
title: "Your Post Title"
description: "Post description"
pubDate: 2026-02-13
author: "Your Name"
category: "programming"
tags: ["astro", "web"]
coverImage: "/images/posts/cover.jpg"
coverAlt: "Cover image description"
lang: "en"
translationKey: "my-post"
---
Your content here...Vietnamese version (my-post.vi.mdx):
---
title: "TiΓͺu Δα» bΓ i viαΊΏt"
description: "MΓ΄ tαΊ£ bΓ i viαΊΏt"
pubDate: 2026-02-13
author: "TΓͺn bαΊ‘n"
category: "programming"
tags: ["astro", "web"]
coverImage: "/images/posts/cover.jpg"
coverAlt: "Mô tả ảnh bìa"
lang: "vi"
translationKey: "my-post"
---
Nα»i dung cα»§a bαΊ‘n...Important: Use the same translationKey to link EN/VI versions!
Available categories: programming, lifestyle, personal
See docs/HOW-TO-WRITE-POST.md for more details.
Create a .env file (copy from .env.example):
# Site URL (update for production)
PUBLIC_SITE_URL=http://localhost:4321
# Giscus Comments (optional - see docs/GISCUS-SETUP.md)
PUBLIC_GISCUS_REPO=your-username/your-repo
PUBLIC_GISCUS_REPO_ID=YOUR_REPO_ID
PUBLIC_GISCUS_CATEGORY=General
PUBLIC_GISCUS_CATEGORY_ID=YOUR_CATEGORY_IDFollow the detailed guide: docs/GISCUS-SETUP.md
Quick steps:
- Enable GitHub Discussions in your repo
- Install Giscus app
- Generate config at giscus.app
- Add env variables to
.env
Quick Deploy:
- Push code to GitHub
- Import project on Vercel
- Add environment variables
- Deploy!
Full Guide: See docs/DEPLOYMENT.md for detailed instructions including:
- Step-by-step deployment
- Custom domain setup
- Environment variables configuration
- Troubleshooting
- Performance tips
The blog can also be deployed to:
- Netlify
- Cloudflare Pages
- AWS Amplify
- Any platform supporting Node.js SSR
Update adapter in astro.config.mjs accordingly.
The blog includes 3 beautiful themes:
- Light - Clean, bright theme
- Sepia - Warm, paper-like reading experience
- Dark - Easy on the eyes
Themes are persisted in localStorage and sync across tabs.
- URL-based:
?lang=enor?lang=vi - Automatic translation switching on blog posts
- Preserved in localStorage
- SEO-friendly with hreflang tags
Edit src/utils/i18n.ts to add/modify translations for UI text.
- Framework: Astro 5.0
- Styling: Tailwind CSS 3.4
- Content: MDX
- Fonts: Merriweather, Inter, JetBrains Mono
- Comments: Giscus
- Deployment: Vercel
- Type Safety: TypeScript 5.6
- Deployment Guide - Complete deployment instructions
- Giscus Setup - Configure GitHub comments
- Writing Posts - Blog post guidelines
- Code Review - Code quality checklist
Contributions are welcome! Feel free to:
- Report bugs
- Suggest features
- Submit pull requests
MIT
Made with β€οΈ using Astro + TypeScript + Tailwind CSS