← 返回项目列表

selflearning-pages

一个面向自主学习的多语言文档站点,使用 Astro + Starlight 构建,使用 MDX 编写内容,支持英文与简体中文。

在线 · 开发中AstroStarlightMDXTypeScriptCC0-1.0

亮点

  • 基于 Astro + Starlight 的内容驱动文档站。
  • 多语言 — 英文(en)与简体中文(zh-cn)。
  • 使用 MDX 编写内容,支持 Starlight 组件与标准 Markdown。
  • 公有领域(CC0-1.0),欢迎贡献。

完整文档

以下内容来自仓库的 GitHub README。

selflearning-pages

Languages: English | 简体中文

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

CommandAction
npm installInstall dependencies
npm run devStart dev server at localhost:4321
npm run buildBuild to dist/
npm run previewPreview 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

  1. Fork & clone.
  2. git checkout -b feat/your-feature.
  3. Add/update pages under src/content/docs/<locale>/.
  4. Register new directories in astro.config.mjs sidebar.
  5. Verify with npm run build.
  6. 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.
  • .mdx supports JSX; .md does not.
  • sidebar.slug is path relative to src/content/docs/ without extension.

License

CC0 1.0 Universal — public domain.

← 所有项目