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 @@ + +

Halo Theme Joe3

+ +

+ + Halo + + + Release + + + License + +

+ +--- +

+ +

+ +预览:[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` + +
+ +### 奉献提示 +~~此仓库分为main和dev分支,如何您想奉献代码,请fork dev分支,开发完成后提交pr到dev分支,dev分支会定期合并到main分支,main分支为稳定版本且dev分支才是最新代码,不接受pr。~~ +现在只维护main分支,dev分支不再维护,如有需要请直接提交pr到main分支。 + + +### 🙆‍♂️ 感谢 + +在此感谢以下项目提供的支持: + +- [Halo](https://halo.run) +- [theme-starter](https://github.com/halo-dev/theme-starter) +- [Typecho Themes Joe](https://github.com/HaoOuBa/Joe) +- [Halo-theme-Joe2.0](https://github.com/qinhua/halo-theme-joe2.0) +- [Halo-theme-hao](https://github.com/liuzhihang/halo-theme-hao) +- [Halo-theme-sakura](https://github.com/LIlGG/halo-theme-sakura/tree/next) +- [plugin-links](https://github.com/halo-sigs/plugin-links) +- [plugin-comment-widget](https://github.com/halo-sigs/plugin-comment-widget) +- [plugin-search-widget](https://github.com/halo-sigs/plugin-search-widget) +- [plugin-moments](https://github.com/halo-sigs/plugin-moments) +- [plugin-photos](https://github.com/halo-sigs/plugin-photos) +- ...... + +
+ +### 交流群 +QQ群号(929708466)欢迎大家前来交流分享 + +![QQ群](https://www.jiewen.run/upload/IMG_3508(20240717-140309).JPG) + +### TinyTale小程序 +[TinyTale Halo微信小程序正式版发布](https://www.jiewen.run/archives/TinyTale-formal-edition) +![TinyTale](https://www.jiewen.run/upload/111.png) diff --git a/docs/docs/index.md b/docs/docs/index.md new file mode 100644 index 00000000..1c7885d3 --- /dev/null +++ b/docs/docs/index.md @@ -0,0 +1,29 @@ +--- +layout: home + +hero: + name: Theme-Joe3 + text: Joe 主题 Halo 移植版 + tagline: 由 Halo Joe2 主题适配而来适用于Halo2.X + image: + src: /img.png + alt: 网站的 logo 图片 + actions: + - theme: brand + text: 快速开始 + link: /guide/what-is-joe3 + - theme: alt + text: 在 github 上查看 + link: https://github.com/jiewenhuang/halo-theme-joe3.0 +features: + - icon: ⚡️ + title: 功能丰富 + details: 主题含有卡片化设计、响应式主题、深色模式、文章目录、代码高亮/语言/复制、文章搜索、评论系统、友情链接、瞬时、图库等功能 + - icon: 🖖 + title: 上手容易 + details: 内置详细主题配置,无语修改主题样式,只需简单配置即可 + - icon: 🛠️ + title: 可定制性强 + details: 主题支持自定义标签样式,以插入 HTML 文本形式使用,标签请参考 Joe3 自定义标签 +--- + diff --git a/docs/docs/public/img.png b/docs/docs/public/img.png new file mode 100644 index 00000000..245db5bc Binary files /dev/null and b/docs/docs/public/img.png differ diff --git a/docs/package.json b/docs/package.json new file mode 100644 index 00000000..886ab21c --- /dev/null +++ b/docs/package.json @@ -0,0 +1,10 @@ +{ + "scripts": { + "docs:dev": "vitepress dev docs", + "docs:build": "vitepress build docs", + "docs:preview": "vitepress preview docs" + }, + "devDependencies": { + "vitepress": "^1.3.4" + } +} \ No newline at end of file