commit d5c80de2c85be1697cee89f4e045c81a731d3c4d Author: Erzbir Date: Thu Jul 31 15:03:34 2025 +0800 1.0.0 diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..6228d4d --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,19 @@ +name: CD + +on: + release: + types: + - published + +jobs: + cd: + uses: halo-sigs/reusable-workflows/.github/workflows/theme-cd.yaml@v3 + secrets: + halo-pat: ${{ secrets.HALO_PAT }} + permissions: + contents: write + with: + skip-appstore-release: true + app-id: app-foo + pnpm-version: 10 + node-version: 20 \ No newline at end of file diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..e6d9064 --- /dev/null +++ b/.gitignore @@ -0,0 +1,27 @@ +# Logs +logs +*.log +npm-debug.log* +yarn-debug.log* +yarn-error.log* +pnpm-debug.log* +lerna-debug.log* + +node_modules +dist +dist-ssr +*.local + +# Editor directories and files +.vscode/* +!.vscode/extensions.json +.idea +.DS_Store +*.suo +*.ntvs* +*.njsproj +*.sln +*.sw? + +.gradle +build \ No newline at end of file diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..3644b9f --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2025 Erzbir + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..08367c7 --- /dev/null +++ b/Makefile @@ -0,0 +1,38 @@ +NODE_MODS := node_modules +BUILD_DIR := build +DIST_DIR := templates/assets/dist +NAME := $(shell grep '^[[:space:]]*name:' theme.yaml | head -n1 | cut -d ':' -f2 | xargs) +VERSION := $(shell grep '^[[:space:]]*version:' theme.yaml | head -n1 | cut -d ':' -f2 | xargs) +ARCHIVE := $(NAME)-$(VERSION).zip + +all: install build release + +$(BUILD_DIR): + @mkdir -p $(BUILD_DIR) + +$(NODE_MODS): package.json + pnpm install + +$(DIST_DIR): $(NODE_MODS) theme.yaml settings.yaml build.js + pnpm make + +$(BUILD_DIR)/$(ARCHIVE): $(DIST_DIR) $(BUILD_DIR) + @mkdir $(BUILD_DIR)/$(NAME) + cp -r templates $(BUILD_DIR)/$(NAME)/ + cp -r i18n $(BUILD_DIR)/$(NAME)/ + cp settings.yaml $(BUILD_DIR)/$(NAME)/ + cp theme.yaml $(BUILD_DIR)/$(NAME)/ + zip -r $@ $(BUILD_DIR)/$(NAME) -x "*.DS_Store" -x "*.git*" -x "$(ARCHIVE)" + +install: $(NODE_MODS) + +build: $(DIST_DIR) + +release: $(BUILD_DIR)/$(ARCHIVE) + +.PHNOY: clean +clean: + @rm -rf $(DIST_DIR) + @rm -rf $(BUILD_DIR) + @rm -rf $(NODE_MODS) + @rm -rf dist \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..628caf1 --- /dev/null +++ b/README.md @@ -0,0 +1,96 @@ +# Terminal + +一款 Terminal 风格的 Halo 主题, 基于 wan92hen 的 [Terminal](https://github.com/wan92hen/theme-terminal) 修改 + +scheme + +前往: https://erzbir.com 查看 + +## 对原主题的修改 + +### 新增功能 +1. 支持 PJAX +2. 支持亮暗模式 +3. 支持指定亮暗模式配色 +4. 支持子菜单 +5. 支持像素化开关 + +### 样式 +1. 去除 a 标签的下划线 +2. 修改分页样式 +3. 修改默认字体为 JetBrains Mono +4. 修改一些固定文字 +5. 修改 footer 样式并且兼容小屏 +6. 修改文章之间的间隔 +7. 修改滑轨颜色为透明 +8. 修改滑块颜色 +9. 修改文章目录样式, 去除选中时的背景色 +10. 修改分页的样式, 只有一个时居中, 适配小屏端 +11. 修改一些标签的大小以及间距 +12. 修改标题与文章的分割线 +13. 让代码块背景色适配主题 +14. 让搜索组件颜色适配主题 +15. 让评论颜色适配主题 +16. 修改友链的样式 +17. 修改标签页以及归档页及分类页的列表显示 +18. 修改按扭边框样式 +19. 修改代码块背景 +20. 禁用字体连字 +21. 在移动端菜单纵向排列 +22. 调整各个元素的间距等 + +### 优化 +1. 防止由于滑块引起的页面抖动 + +### 开发相关 +- 项目迁移至 ES modules 使用原生 JS 开发 +- 删除所有工具依赖, 引入 esbuild + +## 关于 PJAX + +**目前 PJAX 功能需要手动开启** + +### 代码注入需注意的事项 + +预留了一个 `.ex-pjax` 类名, 可以通过将注入的标签设置 `class="ex-pjax"` 来使用 PJAX + +如果要注入 ` + + + + + + +
+
+ +
+
+
+ +
+
+
+ + + diff --git a/templates/moments.html b/templates/moments.html new file mode 100644 index 0000000..44ce826 --- /dev/null +++ b/templates/moments.html @@ -0,0 +1,59 @@ + + + +
+
+ +
+
Moment Content...
+ +
+
+ + + +
+ +
+
+
+
+
+
+ +
+
+ diff --git a/templates/page.html b/templates/page.html new file mode 100644 index 0000000..c925ab0 --- /dev/null +++ b/templates/page.html @@ -0,0 +1,20 @@ + + + +
+
+

Post Title

+
+
+
Post Content
+
+
+
+

Comments

+ +
+
+ diff --git a/templates/post.html b/templates/post.html new file mode 100644 index 0000000..25ca51b --- /dev/null +++ b/templates/post.html @@ -0,0 +1,54 @@ + + + +
+
+

Post Title

+ + +
+
+
Post Content
+
+
+
+
+
+ Read other posts +
+
+ +
+
+

Comments

+ +
+
+ diff --git a/templates/tag.html b/templates/tag.html new file mode 100644 index 0000000..b908d08 --- /dev/null +++ b/templates/tag.html @@ -0,0 +1,41 @@ + + + + +
+ +
+
+ diff --git a/templates/tags.html b/templates/tags.html new file mode 100644 index 0000000..9e13f0b --- /dev/null +++ b/templates/tags.html @@ -0,0 +1,23 @@ + + + +
+
+

Tags

+
+
+ +
+
+
+ diff --git a/theme.yaml b/theme.yaml new file mode 100644 index 0000000..3a067bb --- /dev/null +++ b/theme.yaml @@ -0,0 +1,20 @@ +apiVersion: theme.halo.run/v1alpha1 +kind: Theme +metadata: + name: theme-terminal-ez +spec: + displayName: Terminal-EZ + author: + name: Erzbir + website: https://github.com/Erzbir + description: 一款 Terminal 风格的 Halo 主题, 基于 wan92hen 的 Terminal 修改, 包括功能增强以及个性化 + logo: https://halo.run/logo + website: https://github.com/Erzbir/halo-theme-terminal + repo: https://github.com/Erzbir/halo-theme-terminal.git + settingName: "theme-terminal-ez-setting" + configMapName: "theme-terminal-ez-configMap" + version: 1.0.0 + require: ">=2.8.0" + license: + - name: "MIT" + url: "https://github.com/Erzbir/halo-theme-terminal/blob/main/LICENSE"