Bilingual personal website built with Astro + Markdown, designed for GitHub Pages.
- Astro (static output)
- Markdown content collections (
posts,projects) - Pagefind (on-site search)
- Giscus (comments)
- GA4 (analytics)
- GitHub Actions (deployment)
- Install Node 22 LTS.
- Install dependencies:
npm install- Start local dev server:
npm run dev- Build production output (includes Pagefind indexing):
npm run build/zh/Chinese homepage/en/English homepage/zh/blog/,/en/blog//zh/projects/,/en/projects//zh/publications/,/en/publications//zh/about/,/en/about/
Root / redirects to /en/.
Blog and Projects are intentionally empty until real content is added. Add
Markdown files under src/content/posts/{en,zh}/ and
src/content/projects/{en,zh}/ to publish entries. Entries with draft: true
are excluded from the home page, list pages, detail routes, and search index.
Selected papers are maintained in src/config/publications.ts, with their
thumbnails in public/images/publications/. Research introductions are in
src/content/about/{en,zh}/index.md. The three research directions and research
vision captions are maintained in src/config/i18n.ts and rendered by the shared
ResearchThrusts.astro and ResearchVision.astro components on Home and About.
Home uses the paragraph-form academic
profile in src/content/profile/{en,zh}.md; About uses the detailed sections
in src/content/profile/{en,zh}-detailed.md. Keep factual updates consistent
across both formats and languages.
Required frontmatter:
titledescriptiondatetags[]lang(zhoren)translationKeydraft(optional)
Required frontmatter:
titlesummarylang(zhoren)translationKeytech[]repoUrl(optional)demoUrl(optional)featured(optional)draft(optional)
Required frontmatter:
lang(zhoren)titlesubtitle
Optional settings can be defined in a local .env file:
PUBLIC_GA_IDPUBLIC_GISCUS_REPOPUBLIC_GISCUS_REPO_IDPUBLIC_GISCUS_CATEGORYPUBLIC_GISCUS_CATEGORY_ID
These variables are optional for first launch. If not provided:
- GA script will not be injected.
- Giscus area will show a fallback message instead of comments.
- One-time setup in GitHub repo settings:
Settings->Pages- Build and deployment source: GitHub Actions
- Push to
main(or run theDeploy to GitHub Pagesworkflow manually). - GitHub Actions will install dependencies, run
npm run build, and deploydistto Pages. - (Optional) Add
PUBLIC_*variables later if you want to enable GA/Giscus in production.
dist/ is generated during the build and does not need to be stored in Git.
Keep node_modules/ locally for development; dependencies can be reinstalled
from package-lock.json with npm ci.