From 2f5c803820eb8f621b15e61361f53e0518e63ed7 Mon Sep 17 00:00:00 2001 From: shy <1061867552@qq.com> Date: Wed, 12 Oct 2022 10:46:02 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=AF=B9=E4=BA=8Ewindows?= =?UTF-8?q?=E7=B3=BB=E7=BB=9F=E5=B8=AE=E5=8A=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- HELP.md | 8 ++++++-- http/theme.http | 22 +++++++++++++++++++++- templates/modules/footer.html | 4 ++-- 3 files changed, 29 insertions(+), 5 deletions(-) diff --git a/HELP.md b/HELP.md index a64e83e0..5f04b88d 100644 --- a/HELP.md +++ b/HELP.md @@ -49,12 +49,16 @@ halo 的主题路径: ![img.png](images/windows.png) 可以通过 IDEA 或者 vscode 直接打开主题文件夹,进行操作开发,这里会实时生效。 - +> windows系统推荐使用vscode打开,因为IDEA目前对于wsl2的支持并不好 #### 方式二 -1. 直接在主题目录(~/halo-next/theme)下 git pull 代码,然后重命名为 `theme-hao`。 此时打开 console 控制台是看不到这个主题的,(halo +1. 直接在主题目录(~/halo-next/)下,执行 mkdir -p theme/theme-hao + > windows系统目录是在 wsl2 里面的 /home/用户/halo-next +2. git pull 代码。此时打开 console 控制台是看不到这个主题的,(halo 后面会添加扫描主题功能) + > windows系统推荐使用ssh的方式连接github,然后再拉取代码 2. 通过 http 接口,将 theme.yaml 的配置提交,接口可以参考 swagger-ui + > 也可以直接通过swagger来执行对应的接口 3. 可以参考 http/theme.http 内的脚本 ### 如何动态更新配置 diff --git a/http/theme.http b/http/theme.http index 67b2720e..ca96d1ad 100644 --- a/http/theme.http +++ b/http/theme.http @@ -5,11 +5,31 @@ Content-Type: application/json Cookie: {{cookie}} -### 设置主题, body 即为 theme.yaml 的内容转 json +### 设置主题, body 即为 theme.yaml 的内容转 json,以下是theme-hao主题示例 POST http://localhost:8090/apis/theme.halo.run/v1alpha1/themes Content-Type: application/json Cookie: {{cookie}} { + "apiVersion": "theme.halo.run/v1alpha1", + "kind": "Theme", + "metadata": { + "name": "theme-hao" + }, + "spec": { + "displayName": "Hao", + "author": { + "name": "程序员小航", + "website": "https://liuzhihang.com" + }, + "description": "Halo 2.0 Theme base on Thymeleaf, Referring to Butterfly and Heo", + "logo": "https://liuzhihang.com/logo", + "website": "https://liuzhihang.com", + "repo": "https://github.com/liuzhihang/halo-theme-hao", + "settingName": "theme-hao-setting", + "configMapName": "theme-hao-configMap", + "version": "1.0.0", + "require": "2.0.0" + } } \ No newline at end of file diff --git a/templates/modules/footer.html b/templates/modules/footer.html index 5b4b6474..39792eee 100644 --- a/templates/modules/footer.html +++ b/templates/modules/footer.html @@ -1,7 +1,7 @@ - -