Getting Started
This guide helps you bootstrap Xingluo for local development and production builds from scratch.
Requirements
| Dependency | Minimum version | Notes |
|---|---|---|
| Node.js | 22.12.0 | See engines.node in package.json |
| pnpm | 10.x | Package manager (the project uses pnpm workspace) |
Installation
After cloning the repository, install dependencies:
bashpnpm install
Once dependencies are installed, the reference projects under references/ are automatically excluded from TypeScript compilation and builds (see exclude in tsconfig.json).
Local Development
Start the dev server (defaults to http://localhost:4321/):
bashpnpm dev
In development mode:
- Drafts and scheduled posts are all visible (for preview); they are filtered only during production builds
- Content collection changes trigger hot reload
- Client-side behaviors (theme toggle, View Transitions, etc.) match production
Type Sync
After modifying content collection schemas or types, run sync to refresh .astro/types.d.ts:
bashpnpm sync
Build
The production build has three steps (see the build script in package.json):
bashpnpm build
astro check: TypeScript and Astro template type checking; any error aborts the buildastro build: statically generates the whole site todist/(including dynamic OG images, RSS, sitemap, robots.txt)node scripts/generateSearchIndex.mjs: scansdist/to generate the full-text search index intodist/search/
Note: The search index is generated by a Node script after the build completes.
Preview the Build
Preview the build output in dist/ locally:
bashpnpm preview
Code Quality
| Command | Purpose |
|---|---|
pnpm format | Format all code with Prettier (including Astro and Tailwind) |
pnpm format:check | Check formatting compliance (used in CI) |
pnpm lint | ESLint checks (including eslint-plugin-astro) |
Next Steps
- Read the Configuration Guide to customize site info and feature toggles
- Read Content Authoring to start writing
- Read Deployment to publish your site
Related posts
Deployment
2 min readXingluo deployment guide covering static hosting platforms (Netlify/Vercel/GitHub Pages), Nginx self-hosting, Docker, and environment variables.
Search
1 min readXingluo search guide covering Flexsearch full-text search integration, index generation, UI, multilingual search, and performance.