Commit 5de339a

HPCesia <me@hpcesia.com>
2025-02-02 13:03:22
docs: update README
1 parent 2b46d79
README-zh_CN.md
@@ -1,3 +1,63 @@
 # Astral Halo
 
-[English](README.md) | 简体中文
\ No newline at end of file
+[在线预览(Netlify)](https://astral-halo.netlify.app/) | [English](README.md) | 简体中文
+
+Astral Halo 是一个基于 [Astro](https://astro.build) 开发的静态博客模板。
+
+## 功能特性
+
+- [x] 基于 Astro 和 Tailwind CSS 开发
+- [x] 可自由切换的明亮/暗黑主题
+- [x] 响应式设计
+- [x] 搜索(目前仅支持 [Pagefind](https://pagefind.app/))
+- [x] 文章目录显示
+- [x] 评论(目前仅支持 [Twikoo](https://twikoo.js.org/))
+- [ ] 流畅的动画和页面过渡
+
+## 使用方法
+
+1. 使用此模板[生成新仓库](https://github.com/HPCesia/astral-halo/generate)或 Fork 此仓库。
+2. 进行本地开发,克隆仓库到本地,执行 `pnpm install` 安装依赖,执行 `pnpm dev` 启动开发服务器。
+
+   - 若未安装 [pnpm](https://pnpm.io/),请先执行 `npm install -g pnpm` 安装 pnpm。
+
+3. 通过配置文件 `src/config.ts` 自定义博客,配置说明位于 `src/types/config.ts` 的文档注释中。
+4. 执行 `pnpm new [draft|post] [title]` 创建新文章。若创建的是草稿,编写完成后执行 `pnpm pub [title]` 发布文章到 `src/content/posts` 目录。
+5. 参考[官方指南](https://docs.astro.build/zh-cn/guides/deploy/)将博客部署至 Vercel, Netlify, GitHub Pages 等;部署前需编辑 astro.config.mjs 中的站点设置。
+
+## 文章 Front Matter
+
+```yaml
+---
+title: 文章标题
+slug: post-entry
+published: 1970-01-01T00:00:00.000Z
+description: 文章描述
+category: Lorem
+tags: [Foo, Bar]
+cover: /path/to/cover.jpg
+lang: zh-CN # 仅当文章语言与 `config.ts` 中站点语言不同时需要设置
+comment: true # 是否启用评论,需要在 `config.ts` 中启用并配置评论系统
+---
+```
+
+## 指令
+
+下列指令均需要在项目根目录执行:
+
+| 指令                                     | 行为                               |
+| ---------------------------------------- | ---------------------------------- |
+| `pnpm install`                           | 安装依赖                           |
+| `pnpm dev`                               | 在 `localhost:4321` 启动开发服务器 |
+| `pnpm build`                             | 构建静态站点到 `./dist/` 目录      |
+| `pnpm preview`                           | 本地预览构建的静态站点             |
+| `pnpm new [draft\|post] [title] [--dir]` | 创建新文章                         |
+| `pnpm pub [title]`                       | 发布草稿                           |
+| `pnpm lint`                              | 检查代码                           |
+| `pnpm format`                            | 格式化代码                         |
+| `pnpm astro ...`                         | 运行 Astro CLI                     |
+
+## 致谢
+
+- 项目受 [Fuwari](https://github.com/saicaca/fuwari) 启发,使用了其中的部分代码和设计元素。
+- 项目受 [Solitude](https://github.com/everfu/hexo-theme-solitude) 启发,参考了其中的部分设计元素。
README.md
@@ -1,3 +1,63 @@
 # Astral Halo
 
-English | [简体中文](README-zh_CN.md)
\ No newline at end of file
+English | [简体中文](README-zh_CN.md) | [Live Preview (Netlify)](https://astral-halo.netlify.app/)
+
+Astral Halo is a static blog template developed with [Astro](https://astro.build).
+
+## Features
+
+- [x] Built with Astro and Tailwind CSS
+- [x] Freely switchable light/dark themes
+- [x] Responsive design
+- [x] Search functionality (currently only supports [Pagefind](https://pagefind.app/))
+- [x] Article table of contents
+- [x] Comments system (currently only supports [Twikoo](https://twikoo.js.org/))
+- [ ] Smooth animations and page transitions
+
+## Getting Started
+
+1. Use this template to [generate a new repository](https://github.com/HPCesia/astral-halo/generate) or fork this repository.
+2. For local development, clone the repository, run `pnpm install` to install dependencies, and `pnpm dev` to start the development server.
+
+   - If [pnpm](https://pnpm.io/) is not installed, first run `npm install -g pnpm` to install it.
+
+3. Customize your blog through the configuration file `src/config.ts`. Configuration documentation can be found in the comments of `src/types/config.ts`.
+4. Run `pnpm new [draft|post] [title]` to create a new article. If creating a draft, run `pnpm pub [title]` to publish it to the `src/content/posts` directory when finished.
+5. Refer to the [official guide](https://docs.astro.build/en/guides/deploy/) to deploy your blog to Vercel, Netlify, GitHub Pages, etc. Before deployment, edit the site settings in astro.config.mjs.
+
+## Article Front Matter
+
+```yaml
+---
+title: Article Title
+slug: post-entry
+published: 1970-01-01T00:00:00.000Z
+description: Article Description
+category: Lorem
+tags: [Foo, Bar]
+cover: /path/to/cover.jpg
+lang: en # Only needed when article language differs from site language in `config.ts`
+comment: true # Enable comments, requires comment system to be enabled and configured in `config.ts`
+---
+```
+
+## Commands
+
+All commands need to be run from the project root directory:
+
+| Command                          | Action                               |
+| -------------------------------- | ------------------------------------ |
+| `pnpm install`                   | Install dependencies                 |
+| `pnpm dev`                       | Start dev server at `localhost:4321` |
+| `pnpm build`                     | Build static site to `./dist/`       |
+| `pnpm preview`                   | Preview built site locally           |
+| `pnpm new [draft\|post] [title]` | Create new article                   |
+| `pnpm pub [title]`               | Publish draft                        |
+| `pnpm lint`                      | Check code                           |
+| `pnpm format`                    | Format code                          |
+| `pnpm astro ...`                 | Run Astro CLI                        |
+
+## Acknowledgments
+
+- This project is inspired by [Fuwari](https://github.com/saicaca/fuwari) and uses some of its code and design elements.
+- This project is inspired by [Solitude](https://github.com/everfu/hexo-theme-solitude) and references some of its design elements.