This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
This is a multilingual blog built with Astro, supporting Traditional Chinese (tw) and English (en). The site is deployed at https://blog.wildsky.cc.
# Development server
yarn dev # or yarn start
# Build for production
yarn build # or yarn out (outputs to ./out directory)
# Preview production build
yarn preview
# Create new article (requires slug parameter)
yarn new <article-slug>
# or directly: sh ./newArticle.sh <article-slug>- Posts: Located in
src/content/posts/tw/(Chinese) andsrc/content/posts/en/(English) - Posts follow naming pattern:
YYYY-MM-DD-HH-MM-SS_slug.md - Content schema defined in
src/content/config.tswith frontmatter: title, date, slug, excerpt, feature_image, guid, updated, tags, reference
- Default locale:
tw(Traditional Chinese) - Supported locales:
tw,en - Translation utilities in
src/i18n/utils.tsandsrc/i18n/translations.ts - URL structure:
/for default locale,/en/prefix for English
- Static pages: Markdown files in
src/pages/(about, bookshelf, donate, experiences, etc.) - Dynamic routes:
/posts/[...slug]- Individual blog posts/page/[...page]- Pagination pages- Both routes replicated under
/en/for English version
- Tailwind CSS v4 with Vite plugin
- UnoCSS for icon support (planning to replace with react-icons)
- Custom letter spacing for Chinese (
tw-normal: 0.02em)
astro.config.mjs- Main Astro configuration with i18n settingsPAGINATION_PER_PAGE_COUNT = 16insrc/data/globalConfig.js- Output directory:
./out
To add a new blog post:
- Run
yarn new <slug>to generate template - Edit the created file in
src/content/posts/tw/or manually create in/en/for English - Fill in the frontmatter fields
- Write content in Markdown
The site builds to the ./out directory and includes:
- Static HTML pages
- RSS feed at
/rss.xml - Sitemap generation with i18n support