修改文档

This commit is contained in:
Han 2025-03-14 17:21:58 +08:00
parent 1dc17d4e1b
commit 44a9090165
2 changed files with 57 additions and 40 deletions

View File

@ -1,6 +1,6 @@
MIT License MIT License
Copyright (c) 2024 uxiaohan Copyright (c) 2025 uxiaohan
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal

View File

@ -45,6 +45,8 @@
## 🚀 使用方法 ## 🚀 使用方法
### 使用 Github 模板
- 使用此模板 [生成新仓库或 Fork 此仓库](https://github.com/new?template_name=vhAstro-Theme&template_owner=uxiaohan) - 使用此模板 [生成新仓库或 Fork 此仓库](https://github.com/new?template_name=vhAstro-Theme&template_owner=uxiaohan)
- 进行本地开发Clone 新的仓库,执行 `pnpm install` 以安装依赖 - 进行本地开发Clone 新的仓库,执行 `pnpm install` 以安装依赖
- 若未安装 [pnpm](https://pnpm.io),执行 `npm install -g pnpm` - 若未安装 [pnpm](https://pnpm.io),执行 `npm install -g pnpm`
@ -53,6 +55,30 @@
- 参考官方指南将博客部署至 Vercel, Netlify,Cloudflare Pages, GitHub Pages 等 - 参考官方指南将博客部署至 Vercel, Netlify,Cloudflare Pages, GitHub Pages 等
- 部署前需编辑 `astro.config.mjs` 中的站点设置。 - 部署前需编辑 `astro.config.mjs` 中的站点设置。
### 使用命令
```bash
# pnpm
pnpm create astro@latest --template uxiaohan/vhAstro-Theme
# yarn
yarn create astro --template uxiaohan/vhAstro-Theme
# npm
npm create astro@latest -- --template uxiaohan/vhAstro-Theme
```
```bash
# 安装依赖
pnpm install
# 本地开发
pnpm dev
# 构建静态文件
pnpm build
# 创建新文章
pnpm newpost '文章标题'
```
## 🍬 特色页面 ## 🍬 特色页面
### 友情链接 ### 友情链接
@ -104,38 +130,38 @@ export default {
}; };
``` ```
### 圈子需部署FreshRSS ### 圈子(需部署 FreshRSS
```js ```js
// 配置文件 src/page_data/Friends.ts // 配置文件 src/page_data/Friends.ts
export default { export default {
// API 接口请求优先,数据格式保持和 data 一致 // API 接口请求优先,数据格式保持和 data 一致
api: '', api: "",
// api 为空则使用 data 静态数据 // api 为空则使用 data 静态数据
data: [ data: [
{ {
"title": "Astro 中使用 Lenis 增加鼠标滚动阻尼感", title: "Astro 中使用 Lenis 增加鼠标滚动阻尼感",
"auther": "韩小韩博客", auther: "韩小韩博客",
"date": "2025-03-06", date: "2025-03-06",
"link": "https://www.vvhan.com/article/Lenis-in-Astro", link: "https://www.vvhan.com/article/Lenis-in-Astro",
"content": "在移动端触控交互中惯性滚动带来的丝滑体验已成为标配但鼠标滚轮受限于机械结构滚动时难免产生生硬的段落感。如何让传统滚轮操作也能获得如触控板般的阻尼反馈Lenis库通过JavaScript模拟惯性算法成功将”物理惯性”引入网页滚动本文将解析其实现原理与实战应用。" content: "在移动端触控交互中惯性滚动带来的丝滑体验已成为标配但鼠标滚轮受限于机械结构滚动时难免产生生硬的段落感。如何让传统滚轮操作也能获得如触控板般的阻尼反馈Lenis库通过JavaScript模拟惯性算法成功将”物理惯性”引入网页滚动本文将解析其实现原理与实战应用。"
}, },
{ {
"title": "Astro 添加 Twikoo 评论组件", title: "Astro 添加 Twikoo 评论组件",
"auther": "韩小韩博客", auther: "韩小韩博客",
"date": "2025-03-03", date: "2025-03-03",
"link": "https://www.vvhan.com/article/astro-twikoo", link: "https://www.vvhan.com/article/astro-twikoo",
"content": "Astro在使用视图过渡路由时在跳转路由时会导致JS文件只有在第一次进入页面时生效所以Astro在使用视图过渡路由下Twikoo时无法正常使用的我是单独写了一个评论组件对Twikoo进行动态加载然后在需要评论的页面引入的。" content: "Astro在使用视图过渡路由时在跳转路由时会导致JS文件只有在第一次进入页面时生效所以Astro在使用视图过渡路由下Twikoo时无法正常使用的我是单独写了一个评论组件对Twikoo进行动态加载然后在需要评论的页面引入的。"
}, },
{ {
"title": "Astro主题-优雅的vhAstro-Theme【使用文档】", title: "Astro主题-优雅的vhAstro-Theme【使用文档】",
"auther": "韩小韩博客", auther: "韩小韩博客",
"date": "2025-03-02", date: "2025-03-02",
"link": "https://www.vvhan.com/article/astro-theme-vhastro-theme", link: "https://www.vvhan.com/article/astro-theme-vhastro-theme",
"content": "🥝从Z-Blog到Emlog从Typecho到Hexo从动态博客到静态博客作为一个前端我深入了解了多种SSG工具如Hexo、Vitepress、Hugo等并最终锁定了Astro作为重构博客的选择。🍇Astro活跃的社区支持、广泛的现代框架兼容性、高效的性能优化、优秀的开发体验。" content: "🥝从Z-Blog到Emlog从Typecho到Hexo从动态博客到静态博客作为一个前端我深入了解了多种SSG工具如Hexo、Vitepress、Hugo等并最终锁定了Astro作为重构博客的选择。🍇Astro活跃的社区支持、广泛的现代框架兼容性、高效的性能优化、优秀的开发体验。"
} }
] ]
} };
``` ```
## ⚙️ 文章格式 ## ⚙️ 文章格式
@ -157,15 +183,6 @@ hide: false # 是否隐藏文章
--- ---
``` ```
## 💻 命令 ## ✨ 反馈和建议
```bash 如果您有任何建议/反馈,您可以通过我的 [电子邮件](mailto:1655466387@qq.com) 联系我。或者,如果您发现错误或想要请求新功能,请随时打开问题。
# 安装依赖
pnpm install
# 本地开发
pnpm dev
# 构建静态文件
pnpm build
# 创建新文章
pnpm newpost '文章标题'
```