From d5c80de2c85be1697cee89f4e045c81a731d3c4d Mon Sep 17 00:00:00 2001 From: Erzbir Date: Thu, 31 Jul 2025 15:03:34 +0800 Subject: [PATCH] 1.0.0 --- .github/workflows/build.yml | 19 + .gitignore | 27 + LICENSE | 21 + Makefile | 38 + README.md | 96 ++ build.js | 32 + i18n/default.properties | 7 + package.json | 38 + pnpm-lock.yaml | 1461 +++++++++++++++++ preview/day.png | Bin 0 -> 201564 bytes preview/demo.png | Bin 0 -> 227781 bytes preview/demo2.png | Bin 0 -> 289791 bytes preview/ink.png | Bin 0 -> 197635 bytes preview/matrix.png | Bin 0 -> 224000 bytes preview/menu.png | Bin 0 -> 66295 bytes preview/niello.png | Bin 0 -> 211245 bytes preview/night.png | Bin 0 -> 214045 bytes preview/scheme.png | Bin 0 -> 106513 bytes preview/search.png | Bin 0 -> 82560 bytes settings.yaml | 115 ++ src/fonts/JetBrainsMono-Regular.woff2 | Bin 0 -> 92164 bytes ...sion-pixel-12px-proportional-zh_hans.woff2 | Bin 0 -> 610768 bytes src/libs/pjax.js | 268 +++ src/main.js | 8 + src/module/effect.js | 28 + src/module/post.js | 82 + src/module/toggle.js | 47 + src/styles/buttons.scss | 84 + src/styles/comment.scss | 34 + src/styles/fonts.scss | 12 + src/styles/footer.scss | 101 ++ src/styles/header.scss | 54 + src/styles/icons.scss | 12 + src/styles/links.scss | 56 + src/styles/main.scss | 534 ++++++ src/styles/menu.scss | 138 ++ src/styles/moment.scss | 14 + src/styles/pagination.scss | 117 ++ src/styles/post.scss | 160 ++ src/styles/search.scss | 24 + src/styles/style.scss | 16 + src/styles/theme.scss | 121 ++ src/styles/toc.scss | 73 + src/styles/typed-text.scss | 17 + src/styles/variables.scss | 3 + src/terminal.js | 26 + templates/archives.html | 43 + templates/categories.html | 18 + templates/category.html | 42 + templates/error/404.html | 19 + templates/error/5xx.html | 19 + templates/index.html | 63 + templates/links.html | 39 + templates/modules/category-tree.html | 11 + templates/modules/footer.html | 37 + templates/modules/header.html | 84 + templates/modules/layout.html | 39 + templates/moments.html | 59 + templates/page.html | 20 + templates/post.html | 54 + templates/tag.html | 41 + templates/tags.html | 23 + theme.yaml | 20 + 63 files changed, 4514 insertions(+) create mode 100644 .github/workflows/build.yml create mode 100644 .gitignore create mode 100644 LICENSE create mode 100644 Makefile create mode 100644 README.md create mode 100644 build.js create mode 100644 i18n/default.properties create mode 100644 package.json create mode 100644 pnpm-lock.yaml create mode 100644 preview/day.png create mode 100644 preview/demo.png create mode 100644 preview/demo2.png create mode 100644 preview/ink.png create mode 100644 preview/matrix.png create mode 100644 preview/menu.png create mode 100644 preview/niello.png create mode 100644 preview/night.png create mode 100644 preview/scheme.png create mode 100644 preview/search.png create mode 100644 settings.yaml create mode 100644 src/fonts/JetBrainsMono-Regular.woff2 create mode 100644 src/fonts/fusion-pixel-12px-proportional-zh_hans.woff2 create mode 100644 src/libs/pjax.js create mode 100644 src/main.js create mode 100644 src/module/effect.js create mode 100644 src/module/post.js create mode 100644 src/module/toggle.js create mode 100644 src/styles/buttons.scss create mode 100644 src/styles/comment.scss create mode 100644 src/styles/fonts.scss create mode 100644 src/styles/footer.scss create mode 100644 src/styles/header.scss create mode 100644 src/styles/icons.scss create mode 100644 src/styles/links.scss create mode 100644 src/styles/main.scss create mode 100644 src/styles/menu.scss create mode 100644 src/styles/moment.scss create mode 100644 src/styles/pagination.scss create mode 100644 src/styles/post.scss create mode 100644 src/styles/search.scss create mode 100644 src/styles/style.scss create mode 100644 src/styles/theme.scss create mode 100644 src/styles/toc.scss create mode 100644 src/styles/typed-text.scss create mode 100644 src/styles/variables.scss create mode 100644 src/terminal.js create mode 100644 templates/archives.html create mode 100644 templates/categories.html create mode 100644 templates/category.html create mode 100644 templates/error/404.html create mode 100644 templates/error/5xx.html create mode 100644 templates/index.html create mode 100644 templates/links.html create mode 100644 templates/modules/category-tree.html create mode 100644 templates/modules/footer.html create mode 100644 templates/modules/header.html create mode 100644 templates/modules/layout.html create mode 100644 templates/moments.html create mode 100644 templates/page.html create mode 100644 templates/post.html create mode 100644 templates/tag.html create mode 100644 templates/tags.html create mode 100644 theme.yaml 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"