Files
snowflake-notes/README.md
T
sjfhsjfh 6cc96a7126 feat: 初始化 Astro 学习博客骨架
- Astro+TS 严格模式(禁止 any、显式返回类型)
- ESLint Flat Config + Prettier 格式化
- 内容集合(posts)与示例文章
- OSS 图床可配置 Img 组件
- 抽离 posts 数据逻辑(更易类型检查)
- getStaticPaths 修正(rest 路由传字符串)
- README/AGENTS 中文文档与约定
- Gitea CI:typecheck + lint
- 忽略 ref/(仅作临时参考)
2025-11-27 17:08:07 +08:00

35 lines
1.2 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# 内部学习博客(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`