# Blog **Repository Path**: gitgreat/blog ## Basic Information - **Project Name**: Blog - **Description**: 个人博客,开放预览, - **Primary Language**: JavaScript - **License**: Not specified - **Default Branch**: master - **Homepage**: https://www.sofile.cn - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2025-05-26 - **Last Updated**: 2025-12-20 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # 介绍 使用 Astro 构建的个人博客 / 或 ⌘K(Windows/Linux 用 Ctrl+K) 打开搜索框 # 准备实现的功能 - [相关文章](https://johndalesandro.com/blog/astro-add-related-posts-to-blog-entries/) - 嵌入 Excalidraw(示意图) - 添加说说功能 - 进行 SEO 改造 # 已实现 HowTo:优先从 “## 步骤/Steps” 的有序列表提取,否则回退到 H2 标题。 FAQ:自动解析 Q:/问: 与 A:/答: 格式的问答段落。 这样在 astro build 时自动生成,无需手工维护。 建议下一步 文章里用 ## 步骤 + 有序列表,或 Q:/A: 格式写 FAQ,结构化数据会更精准。 如需严格控制生成内容(比如禁用 FAQ/HowTo),我可以加开关字段。 # 相关文章 - [为啥选择 Astro 而不是 Vuepress?](https://johndalesandro.com/blog/why-i-switched-from-wordpress-to-astro/) ## 草稿 已加好草稿模式:在内容 schema 增加 draft 字段,并在列表页/详情页/分类/标签/RSS 中过滤草稿。开发环境仍可访问草稿 ## 撰写教程 去掉博客链接中的 blog 路径:https://chatgpt.com/s/t_693d0b404c748191b78008f97a5e09bb ```sh npm create astro@latest -- --template blog ``` > 🧑‍🚀 **Seasoned astronaut?** Delete this file. Have fun! Features: - ✅ Minimal styling (make it your own!) - ✅ 100/100 Lighthouse performance - ✅ SEO-friendly with canonical URLs and OpenGraph data - ✅ Sitemap support - ✅ RSS Feed support - ✅ Markdown & MDX support ## 🚀 Project Structure Inside of your Astro project, you'll see the following folders and files: ```text ├── public/ ├── src/ │   ├── components/ │   ├── content/ │   ├── layouts/ │   └── pages/ ├── astro.config.mjs ├── README.md ├── package.json └── tsconfig.json ``` Astro looks for `.astro` or `.md` files in the `src/pages/` directory. Each page is exposed as a route based on its file name. There's nothing special about `src/components/`, but that's where we like to put any Astro/React/Vue/Svelte/Preact components. The `src/content/` directory contains "collections" of related Markdown and MDX documents. Use `getCollection()` to retrieve posts from `src/content/blog/`, and type-check your frontmatter using an optional schema. See [Astro's Content Collections docs](https://docs.astro.build/en/guides/content-collections/) to learn more. Any static assets, like images, can be placed in the `public/` directory. ## 🧞 Commands All commands are run from the root of the project, from a terminal: | Command | Action | | :------------------------ | :----------------------------------------------- | | `npm install` | Installs dependencies | | `npm run dev` | Starts local dev server at `localhost:4321` | | `npm run build` | Build your production site to `./dist/` | | `npm run preview` | Preview your build locally, before deploying | | `npm run astro ...` | Run CLI commands like `astro add`, `astro check` | | `npm run astro -- --help` | Get help using the Astro CLI | ## 👀 Want to learn more? Check out [our documentation](https://docs.astro.build) or jump into our [Discord server](https://astro.build/chat). ## Credit This theme is based off of the lovely [Bear Blog](https://github.com/HermanMartinus/bearblog/).