forked from ParadigmEducation/snowflake-notes
feat: 初始化 Astro 学习博客骨架
- Astro+TS 严格模式(禁止 any、显式返回类型) - ESLint Flat Config + Prettier 格式化 - 内容集合(posts)与示例文章 - OSS 图床可配置 Img 组件 - 抽离 posts 数据逻辑(更易类型检查) - getStaticPaths 修正(rest 路由传字符串) - README/AGENTS 中文文档与约定 - Gitea CI:typecheck + lint - 忽略 ref/(仅作临时参考)
This commit is contained in:
@@ -0,0 +1,34 @@
|
||||
# 内部学习博客(Astro + TypeScript)
|
||||
|
||||
基于 Astro 构建的内部学习博客。目标:严格 TypeScript、统一格式化、内容可扩展(不仅 Markdown/MDX),图片优先使用外部 OSS。
|
||||
|
||||
## 快速开始
|
||||
|
||||
- 要求:Node >= 20,包管理器使用 pnpm
|
||||
- 安装依赖:`pnpm install`
|
||||
- 启动开发:`pnpm dev`
|
||||
|
||||
常用脚本:
|
||||
- 构建:`pnpm build` ;预览:`pnpm preview`
|
||||
- 代码检查:`pnpm lint` ;类型检查:`pnpm typecheck`
|
||||
- 格式化:`pnpm format`
|
||||
|
||||
## 内容与结构
|
||||
|
||||
- 文章与集合:`src/content/`(示例:`src/content/posts/hello-world.mdx`)
|
||||
- 页面与布局:`src/pages/`、`src/layouts/`
|
||||
- 通用组件:`src/components/`(如 `Img.astro` 支持外部图床)
|
||||
- 内容扩展抽象:`src/lib/content/`(为未来 Typst 等格式预留)
|
||||
|
||||
## 配置
|
||||
|
||||
- `PUBLIC_MEDIA_BASE_URL`:外部图床前缀(避免图片入库)
|
||||
- `PUBLIC_SITE_URL`:站点地址(可选,用于 canonical 等)
|
||||
|
||||
## 约定
|
||||
|
||||
- 严格 TypeScript:禁止 any,导出函数需显式返回类型
|
||||
- 统一格式化:Prettier(含 Astro/Markdown/MDX)
|
||||
- 图片默认不入库,建议走外部 OSS
|
||||
|
||||
更多细节与约定见 `AGENTS.md`。
|
||||
Reference in New Issue
Block a user