diff --git a/.github/workflows/deploy-docs.yml b/.github/workflows/deploy-docs.yml new file mode 100644 index 00000000..59d70319 --- /dev/null +++ b/.github/workflows/deploy-docs.yml @@ -0,0 +1,39 @@ +name: Build and Deploy + +on: + push: + branches: [main] + paths: + - 'docs/**' # 监听 docs 目录中的所有文件变化 + workflow_dispatch: # 手动触发 + +jobs: + deploy: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + # 安装 bun + - name: Setup Bun + run: | + curl -fsSL https://bun.sh/install | bash + export BUN_INSTALL="$HOME/.bun" + export PATH="$BUN_INSTALL/bin:$PATH" + + # 进入 docs 目录并安装依赖 + - name: Install dependencies + run: | + cd docs + bun install + + # 进入 docs 目录并构建项目 + - name: Build + run: | + cd docs + bun build + + # 部署到 Halo + - name: Deploy to Halo # 关键步骤 + run: | + npx halo-static-pages-deploy-cli deploy -e ${{ secrets.ENDPOINT }} -i ${{ secrets.ID }} -t ${{ secrets.PAT }} -f dist diff --git a/docs/docs/.vitepress/config.mts b/docs/docs/.vitepress/config.mts new file mode 100644 index 00000000..bafdab74 --- /dev/null +++ b/docs/docs/.vitepress/config.mts @@ -0,0 +1,42 @@ +import { defineConfig } from 'vitepress' + +// https://vitepress.dev/reference/site-config +export default defineConfig({ + title: "Halo-theme-Joe3", + description: "Halo-theme-Joe3 base docs", + base: '/theme-Joe3/', + themeConfig: { + // https://vitepress.dev/reference/default-theme-config + search: { + provider: 'local' + }, + nav: [ + { text: 'Home', link: '/' }, + { text: 'Demo', link: 'https://www.jiewen.run/?preview-theme=theme-Joe3' } + ], + + sidebar: [ + { + text: '开始', + items: [ + { text: '介绍', link: '/guide/what-is-joe3' }, + ], + collapsible: true, + collapsed: true + } + ], + + socialLinks: [ + { icon: 'github', link: 'https://github.com/jiewenhuang/halo-theme-joe3.0' } + ], + editLink: { + pattern: ({ filePath }) => { + if (filePath.startsWith('packages/')) { + return `https://github.com/jiewenhuang/halo-theme-joe3.0/docs/docs/${filePath}` + } else { + return `https://github.com/jiewenhuang/halo-theme-joe3.0/docs/docs/${filePath}` + } + } + } + } +}) diff --git a/docs/docs/guide/what-is-joe3.md b/docs/docs/guide/what-is-joe3.md new file mode 100644 index 00000000..8a05040a --- /dev/null +++ b/docs/docs/guide/what-is-joe3.md @@ -0,0 +1,179 @@ + +
+ +
+ +预览:[Jiewen's Blog](https://www.jiewen.run/?preview-theme=theme-Joe3) + +文档:部分配置请参考 [Joe3不完全使用指导指南](https://www.jiewen.run/archives/joe3use) +> halo-theme-Joe3 是一款 [Halo2.0](https://halo.run/) 的博客主题 +> 由[halo-theme-joe2.0](https://github.com/qinhua/halo-theme-joe2.0)适配而来,感谢原作者的无私奉献 + +## 安裝 + +### 下载安装 +下载[releases](https://github.com/jiewenhuang/halo-theme-joe3.0/releases)或者直接[下载代码](https://github.com/jiewenhuang/halo-theme-joe3.0),通过 Halo Console 后台主题安装处上传即可。 + +## 使用说明 +> 1、首次使用请先把主题所有配置保存一遍 +> 2、部分功能使用插件进行实现 +> 3、请配合Halo2.8.0及以上版本使用 +> 4、菜单栏的图标请使用[iconfont](https://www.iconfont.cn/)的图标,需要填入Font Family 和图标代码例如:`jiewen joe-icon-tupian` +> 5、使用自定义标签样式请以插入HTML文本形式使用,标签请参考[Joe3部分样式](https://www.jiewen.run/archives/joe3style)或者直接使用插件标签 + +- [x] 卡片化设计 +- [x] 响应式主题 +- [x] 深色模式 +- [X] 文章目录 +- [X] 代码高亮/语言/复制) +- [x] [文章搜索](https://github.com/halo-sigs/plugin-search-widget) +- [x] 显示字数统计 +- [x] 显示相关文章 +- [X] [评论系统](https://github.com/halo-sigs/plugin-comment-widget) +- [x] [友情链接](https://github.com/halo-sigs/plugin-links) +- [x] [瞬时](https://github.com/halo-sigs/plugin-moments) +- [x] [图库](https://github.com/halo-sigs/plugin-photos) +- [x] 其他功能 + +## 主题配置 + +### 基本设置 + +#### Waline设置 + +##### Waline基础配置 + +该配置项可以对Waline进行自定义基础配置,内容为json格式,如果配置未生效,请先检查填入的内容是否为json格式,可以前往[JSON校验网站](https://www.json.cn/)进行格式校验。为了方便用户填写,这里提供如下样例,具体所代表的含义以及更多配置项请参考[Waline官网](https://waline.js.org/)。 + +```json +{ + "search":false, + "reaction":true, + "login":"force", + "locale": { + "placeholder":"欢迎评论啦啦啦" + }, + "emoji": [ + "//unpkg.com/@waline/emojis@1.2.0/weibo", + "//unpkg.com/@waline/emojis@1.2.0/bmoji" + ] +} +``` + +##### Waline图片上传配置 + +该配置项可以配置Waline的图片上传方式 + ++ 默认 + +默认的图片上传方式上传的图片最大只能128Kb + ++ 兰空图床 + +该配置项可以配置Waline的图片上传至兰空图床,需要自建兰空图床服务 + +##### 兰空图床上传设置 + ++ 兰空图床服务端地址 + +兰空图床服务端地址,如 https://img.example.com/api/v1/upload 不要加结尾反斜杠 + ++ 兰空图床Token + +兰空图床Token,如 `2|1bJbwlqBfnggmOMEZqXT5XusaIwqiZjCDs7r1Ob5`,通过配置Token可以进行图片上传的权限控制,如果为空则以游客身份上传(需要在兰空图床开放游客上传的权限) + +如何获取Token? + +通过兰空图床api获取,请求示例如下: + +```bash +curl -X POST https://img.example.com/api/v1/tokens \ +-H "Content-Type: application/json" \ +-d '{ + "email": "email@qq.com", + "password": "password***" +}' +``` + +如果出现如下报错,请在末尾加入参数`-k`来忽略证书验证 + +```bash +curl: (60) schannel: SEC_E_UNTRUSTED_ROOT (0x80090325) - More details here: https://curl.se/docs/sslcerts.html + +curl failed to verify the legitimacy of the server and therefore could not +establish a secure connection to it. +``` + +返回结果示例: + +```json +{"status":true,"message":"success","data":{"token":"2|1bJbwlqBfnggmOMEZqXT5XusaIwqiZjCDs7r1Ob5"}} +``` + +## 预览 +WIP +## TODO +- [ ] 优化图库 +- [ ] ...... + + +### 🏭 贡献 + +> 如果你想帮助完善 `Joe3.0` 主题,请: + +- 点 `star` +- 提 `issue` +- 修 `bugs` +- 推 `pr` + +