← 返回项目列表
← 所有项目
selflearning-pages
一个面向自主学习的多语言文档站点,使用 Astro + Starlight 构建,使用 MDX 编写内容,支持英文与简体中文。
亮点
- 基于 Astro + Starlight 的内容驱动文档站。
- 多语言 — 英文(en)与简体中文(zh-cn)。
- 使用 MDX 编写内容,支持 Starlight 组件与标准 Markdown。
- 公有领域(CC0-1.0),欢迎贡献。
完整文档
以下内容来自仓库的 GitHub README。
selflearning-pages
A multilingual documentation site for self-directed learning, built with Astro + Starlight.
Site: https://selflearning-pages.pages.dev/
Tech Stack
- Astro
^7.0.2 - @astrojs/starlight
^0.41.3 - sharp
^0.35.3
Commands
| Command | Action |
|---|---|
npm install | Install dependencies |
npm run dev | Start dev server at localhost:4321 |
npm run build | Build to dist/ |
npm run preview | Preview built site |
Project Structure
src/content/docs/
├── en/ # English
└── zh-cn/ # Simplified Chinese
Internationalization
Locale folders use lowercase (e.g. zh-cn), BCP-47 tag via lang in config.
To add a language: create src/content/docs/<locale>/ and register in astro.config.mjs locales.
Contributing
- Fork & clone.
git checkout -b feat/your-feature.- Add/update pages under
src/content/docs/<locale>/. - Register new directories in
astro.config.mjssidebar. - Verify with
npm run build. - Open a pull request.
Contact us on GitHub. MDX syntax reference: MDX Tutorial
MDX Syntax
Frontmatter
---
title: My Page
description: Short description.
---
Optional fields: template: splash, hero, sidebar, pagefind: false.
Starlight components
import { Card, CardGrid } from '@astrojs/starlight/components';
<CardGrid stagger>
<Card title="Title" icon="pencil">Content</Card>
</CardGrid>
Others
- Code blocks: `
`language`. - Links:
[text](/en/page/). - Images: relative paths from file location.
- Tables: standard Markdown syntax.
.mdxsupports JSX;.mddoes not.sidebar.slugis path relative tosrc/content/docs/without extension.
License
CC0 1.0 Universal — public domain.