1.0.0
@@ -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
|
||||
@@ -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
|
||||
@@ -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.
|
||||
@@ -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
|
||||
@@ -0,0 +1,96 @@
|
||||
# Terminal
|
||||
|
||||
一款 Terminal 风格的 Halo 主题, 基于 wan92hen 的 [Terminal](https://github.com/wan92hen/theme-terminal) 修改
|
||||
|
||||
<img src="preview/scheme.png" alt="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
|
||||
|
||||
如果要注入 `<script>`, 根据插入的位置需要为标签添加一些属性才能保证行为正常
|
||||
|
||||
在 `<head>`, `<footer>`, 以及 `.content` 下的 `<script>` 会被重新执行, 行为略有不同
|
||||
|
||||
- `<head>`: 重新执行所有请求页面新插入的无 `no-pjax` 属性的 `<script>`
|
||||
- `<footer>`: 重新执行有 `data-pjax` 属性的 `<script>`
|
||||
- `.content`: 重新执行有 `data-pjax` 属性的 `<script>`
|
||||
|
||||
设置 `no-pjax` 属性, 可以防止 `<script>` 被 PJAX 重新执行
|
||||
|
||||
### 已知的问题
|
||||
|
||||
首屏就加载全部 css 和 script 的情况下不会出现问题, 只有在动态注入的时候会出现一些问题
|
||||
|
||||
- highlightjs 插件的 _复制按扭_ 数量会随页面切换增加
|
||||
|
||||
## 构建
|
||||
|
||||
项目使用原生 ES 模块, 用 `esbuild` 来构建, 使用 `pnpm` 管理依赖
|
||||
|
||||
确保已安装 `nodejs`
|
||||
|
||||
执行:
|
||||
|
||||
```shell
|
||||
make
|
||||
```
|
||||
|
||||
## 计划
|
||||
|
||||
- [ ] 自定义配色
|
||||
- [ ] 全站像素化
|
||||
- [ ] 支持移动端 TOC
|
||||
- [ ] 调整代码高亮
|
||||
- [ ] 本地化
|
||||
|
||||
## 原主题
|
||||
|
||||
- [Terminal](https://github.com/wan92hen/theme-terminal)
|
||||
- [Hugo Terminal](https://github.com/panr/hugo-theme-terminal)
|
||||
@@ -0,0 +1,32 @@
|
||||
import esbuild from 'esbuild'
|
||||
import {sassPlugin} from 'esbuild-sass-plugin';
|
||||
|
||||
await esbuild.build({
|
||||
entryPoints: ['src/main.js'],
|
||||
bundle: true,
|
||||
outfile: 'templates/assets/dist/main.js',
|
||||
assetNames: '[name]',
|
||||
plugins: [
|
||||
sassPlugin(),
|
||||
],
|
||||
loader: {
|
||||
'.woff': 'file',
|
||||
'.woff2': 'file',
|
||||
'.ttf': 'file',
|
||||
},
|
||||
format: 'esm',
|
||||
target: 'es2020',
|
||||
minify: true,
|
||||
sourcemap: false
|
||||
|
||||
})
|
||||
|
||||
await esbuild.build({
|
||||
entryPoints: ['src/libs/pjax.js'],
|
||||
bundle: true,
|
||||
outfile: 'templates/assets/dist/libs/pjax.js',
|
||||
format: 'esm',
|
||||
target: 'es2020',
|
||||
minify: true,
|
||||
sourcemap: false
|
||||
});
|
||||
@@ -0,0 +1,7 @@
|
||||
page.archives.title=Archives
|
||||
page.links.title=Links
|
||||
page.moments.title=Moments
|
||||
page.tags.title=Tags
|
||||
page.tag.title=Tag: {0}
|
||||
page.categories.title=Categories
|
||||
page.category.title=Category: {0}
|
||||
@@ -0,0 +1,38 @@
|
||||
{
|
||||
"scripts": {
|
||||
"build": "node build.js && theme-package",
|
||||
"make": "node build.js"
|
||||
},
|
||||
"keywords": [
|
||||
"halo",
|
||||
"halo-theme",
|
||||
"terminal",
|
||||
"halo-theme-terminal",
|
||||
"erzbir"
|
||||
],
|
||||
"homepage": "https://github.com/Erzbir/halo-theme-terminal#readme",
|
||||
"bugs": {
|
||||
"url": "https://github.com/Erzbir/halo-theme-terminal/issues"
|
||||
},
|
||||
"author": {
|
||||
"name": "Erzbir",
|
||||
"url": "https://github.com/Erzbir"
|
||||
},
|
||||
"license": "MIT",
|
||||
"repository": {
|
||||
"url": "https://github.com/Erzbir/halo-theme-terminal",
|
||||
"type": "git"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@halo-dev/theme-package-cli": "^1.0.0",
|
||||
"sass": "^1.56.1",
|
||||
"esbuild": "^0.20.2",
|
||||
"esbuild-sass-plugin": "^3.3.1",
|
||||
"pjax": "^0.2.8",
|
||||
"tocbot": "^4.29.0"
|
||||
},
|
||||
"dependencies": {
|
||||
},
|
||||
"type": "module",
|
||||
"packageManager": "pnpm@9.14.2+sha512.6e2baf77d06b9362294152c851c4f278ede37ab1eba3a55fda317a4a17b209f4dbb973fb250a77abc463a341fcb1f17f17cfa24091c4eb319cda0d9b84278387"
|
||||
}
|
||||
|
After Width: | Height: | Size: 197 KiB |
|
After Width: | Height: | Size: 222 KiB |
|
After Width: | Height: | Size: 283 KiB |
|
After Width: | Height: | Size: 193 KiB |
|
After Width: | Height: | Size: 219 KiB |
|
After Width: | Height: | Size: 65 KiB |
|
After Width: | Height: | Size: 206 KiB |
|
After Width: | Height: | Size: 209 KiB |
|
After Width: | Height: | Size: 104 KiB |
|
After Width: | Height: | Size: 81 KiB |
@@ -0,0 +1,115 @@
|
||||
apiVersion: v1alpha1
|
||||
kind: Setting
|
||||
metadata:
|
||||
name: theme-terminal-ez-setting
|
||||
spec:
|
||||
forms:
|
||||
- group: basic
|
||||
label: 基本设置
|
||||
formSchema:
|
||||
- $formkit: text
|
||||
name: index_notice_title
|
||||
label: 首页公告标题
|
||||
value: "Hello Terminal!"
|
||||
- $formkit: textarea
|
||||
name: index_notice_content
|
||||
label: 首页公告内容
|
||||
value: "一款 Terminal 风格的 Halo 主题."
|
||||
- $formkit: checkbox
|
||||
name: show_toc
|
||||
label: 显示文章目录
|
||||
value: true
|
||||
help: 开启后, 将在文章页面显示文章目录
|
||||
- $formkit: checkbox
|
||||
name: pjax
|
||||
label: 启用 PJAX
|
||||
help: 是否启用 PJAX, 默认关闭
|
||||
value: false
|
||||
- group: style
|
||||
label: 样式设置
|
||||
formSchema:
|
||||
- $formkit: checkbox
|
||||
name: pixel_style
|
||||
label: 像素化风格
|
||||
value: false
|
||||
help: 开启后, 将优先使用像素风格字体及图标
|
||||
- $formkit: select
|
||||
name: default_schema_mode
|
||||
label: 默认模式
|
||||
value: "dark"
|
||||
options:
|
||||
- label: "暗模式"
|
||||
value: "dark"
|
||||
- label: "亮模式"
|
||||
value: "light"
|
||||
- $formkit: select
|
||||
name: dark_color_schema
|
||||
label: 暗色模式配色方案
|
||||
value: "night"
|
||||
options:
|
||||
- label: "day"
|
||||
value: "day"
|
||||
- label: "night"
|
||||
value: "night"
|
||||
- label: "niello"
|
||||
value: "niello"
|
||||
- label: "matrix"
|
||||
value: "matrix"
|
||||
- label: "ink"
|
||||
value: "ink"
|
||||
- label: "hopbush"
|
||||
value: "hopbush"
|
||||
- label: "pistachio"
|
||||
value: "pistachio"
|
||||
- label: "hopbush"
|
||||
value: "hopbush"
|
||||
- label: "blue"
|
||||
value: "blue"
|
||||
- label: "studio"
|
||||
value: "studio"
|
||||
- label: "vanilla"
|
||||
value: "vanilla"
|
||||
- $formkit: select
|
||||
name: light_color_schema
|
||||
label: 亮色模式配色方案
|
||||
value: "day"
|
||||
options:
|
||||
- label: "day"
|
||||
value: "day"
|
||||
- label: "night"
|
||||
value: "night"
|
||||
- label: "niello"
|
||||
value: "niello"
|
||||
- label: "matrix"
|
||||
value: "matrix"
|
||||
- label: "ink"
|
||||
value: "ink"
|
||||
- label: "hopbush"
|
||||
value: "hopbush"
|
||||
- label: "pistachio"
|
||||
value: "pistachio"
|
||||
- label: "hopbush"
|
||||
value: "hopbush"
|
||||
- label: "blue"
|
||||
value: "blue"
|
||||
- label: "studio"
|
||||
value: "studio"
|
||||
- label: "vanilla"
|
||||
value: "vanilla"
|
||||
- group: icp
|
||||
label: 备案设置
|
||||
formSchema:
|
||||
- $formkit: text
|
||||
name: icp_text
|
||||
label: ICP备案号
|
||||
- $formkit: text
|
||||
name: icp_link
|
||||
label: ICP备案跳转链接
|
||||
value: https://beian.miit.gov.cn/
|
||||
- $formkit: text
|
||||
name: filing_text
|
||||
label: 公安备案号
|
||||
- $formkit: text
|
||||
name: filing_link
|
||||
label: 公安备案跳转链接
|
||||
value: https://www.beian.gov.cn/
|
||||
@@ -0,0 +1,268 @@
|
||||
// Original source code from: https://github.com/LIlGG/halo-theme-sakura/blob/main/src/libs/pjax.js
|
||||
|
||||
import Pjax from "pjax";
|
||||
|
||||
const pjax = new Pjax({
|
||||
elements: "a[data-pjax]",
|
||||
selectors: ["head title", ".content", ".ex-pjax"],
|
||||
switches: {
|
||||
".content": Pjax.switches.innerHTML,
|
||||
},
|
||||
cacheBust: false,
|
||||
analytics: false,
|
||||
debug: false
|
||||
});
|
||||
|
||||
let _responseText = '';
|
||||
|
||||
pjax._handleResponse = pjax.handleResponse;
|
||||
|
||||
pjax.handleResponse = function (responseText, request, href, options) {
|
||||
_responseText = responseText;
|
||||
pjax._handleResponse(responseText, request, href, options);
|
||||
};
|
||||
|
||||
function djb2(str) {
|
||||
let hash = 5381;
|
||||
for (let i = 0; i < str.length; i++) {
|
||||
hash = ((hash << 5) + hash) + str.charCodeAt(i);
|
||||
}
|
||||
return (hash >>> 0)
|
||||
}
|
||||
|
||||
function renewElement(element) {
|
||||
const newElem = document.createElement(element.tagName);
|
||||
for (let i = 0; i < element.attributes.length; i++) {
|
||||
const attr = element.attributes[i];
|
||||
newElem.setAttribute(attr.name, attr.value);
|
||||
}
|
||||
return newElem;
|
||||
}
|
||||
|
||||
function insertStyle(dom, parentElement, selectors) {
|
||||
const existingStyles = new Set();
|
||||
|
||||
document.querySelectorAll(selectors).forEach(link => {
|
||||
existingStyles.add(link.href);
|
||||
});
|
||||
|
||||
dom.querySelectorAll(selectors).forEach(link => {
|
||||
const href = link.href;
|
||||
if (href && !existingStyles.has(href)) {
|
||||
const newLink = renewElement(link);
|
||||
parentElement.appendChild(newLink);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function insertScript(dom, parentElement, selectors) {
|
||||
const existingScripts = new Set();
|
||||
|
||||
parentElement.querySelectorAll(selectors).forEach(script => {
|
||||
existingScripts.add(script.src);
|
||||
});
|
||||
|
||||
dom.querySelectorAll(selectors).forEach(script => {
|
||||
const src = script.src;
|
||||
if (src && !existingScripts.has(src)) {
|
||||
const newScript = renewElement(script);
|
||||
parentElement.appendChild(newScript);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function insertInlineScript(dom, parentElement, selectors) {
|
||||
dom.querySelectorAll(selectors).forEach(script => {
|
||||
if (script.innerHTML.trim()) {
|
||||
let hash = djb2(script.innerHTML);
|
||||
let old = parentElement.querySelector(`script[data-hash="${hash}"]`);
|
||||
if (old) {
|
||||
parentElement.removeChild(old);
|
||||
} else {
|
||||
let scripts = parentElement.querySelectorAll('script:not([src]):not([no-pjax])');
|
||||
scripts.forEach((s) => {
|
||||
if (djb2(s.innerHTML) === hash) {
|
||||
parentElement.removeChild(s);
|
||||
}
|
||||
});
|
||||
}
|
||||
const newScript = renewElement(script);
|
||||
newScript.innerHTML = script.innerHTML;
|
||||
newScript.setAttribute("data-hash", hash);
|
||||
parentElement.appendChild(newScript);
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
// 这个函数将请求的页面 head 中 script 和 link 都插入进来合成新页面
|
||||
function insertResourcesToHead(dom, parentElement) {
|
||||
insertStyle(dom, parentElement, 'head link[rel="stylesheet"]:not([no-pjax])');
|
||||
insertScript(dom, parentElement, 'head script[src]:not([no-pjax])');
|
||||
insertInlineScript(dom, parentElement, 'head script:not([src]):not([no-pjax])');
|
||||
}
|
||||
|
||||
// 这个函数将请求的页面 footer 中 script 和 link 都插入进来合成新页面
|
||||
function insertResourcesToFooter(dom, parentElement) {
|
||||
insertStyle(dom, parentElement, 'footer link[rel="stylesheet"][data-pjax]:not([no-pjax])');
|
||||
insertScript(dom, parentElement, 'footer script[src][data-pjax]:not([no-pjax])');
|
||||
insertInlineScript(dom, parentElement, 'footer script:not([src])[data-pjax]:not([no-pjax])');
|
||||
}
|
||||
|
||||
// 处理请求的页面新增样式和脚本
|
||||
function processNewScripts(responseText) {
|
||||
const parser = new DOMParser();
|
||||
const dom = parser.parseFromString(responseText, 'text/html');
|
||||
insertResourcesToHead(dom, document.head);
|
||||
let footer = document.querySelector('footer');
|
||||
if (!footer) {
|
||||
return;
|
||||
}
|
||||
insertResourcesToFooter(dom, footer);
|
||||
}
|
||||
|
||||
const originalAddEventListener = EventTarget.prototype.addEventListener;
|
||||
|
||||
EventTarget.prototype.addEventListener = function (type, listener, options) {
|
||||
if (type === "DOMContentLoaded") {
|
||||
if (listener) {
|
||||
window.addEventListener(
|
||||
"pjax:success",
|
||||
() => {
|
||||
retry(() => listener(), 10, 100);
|
||||
},
|
||||
{
|
||||
once: true,
|
||||
}
|
||||
);
|
||||
return;
|
||||
}
|
||||
}
|
||||
originalAddEventListener.call(this, type, listener, options);
|
||||
};
|
||||
|
||||
// 刷新 script, 以及重新刷新主题注册的函数
|
||||
document.addEventListener("pjax:complete", function () {
|
||||
// 处理头和尾有新增的情况
|
||||
processNewScripts(_responseText);
|
||||
// 处理替换的内容中存在脚本的情况
|
||||
let pjaxDoms = document.querySelectorAll(".content script[data-pjax]:not([no-pjax])");
|
||||
pjaxDoms.forEach((element) => {
|
||||
let code = element.text || element.textContent || element.innerHTML || "";
|
||||
let parent = element.parentNode;
|
||||
if (parent === null) {
|
||||
return;
|
||||
}
|
||||
parent.removeChild(element);
|
||||
let script = renewElement(element);
|
||||
if (code !== "") {
|
||||
script.appendChild(document.createTextNode(code));
|
||||
}
|
||||
parent.appendChild(script);
|
||||
});
|
||||
// 刷新注册的函数
|
||||
window.terminal.refresh();
|
||||
});
|
||||
|
||||
window.addEventListener("pjax:error", (event) => {
|
||||
const request = event.request
|
||||
if (request.status === 404 || request.status === 500) {
|
||||
window.location.href = request.responseURL;
|
||||
}
|
||||
});
|
||||
|
||||
pjax.doRequest = function (location, options, callback) {
|
||||
options = options || {};
|
||||
let queryString;
|
||||
const requestOptions = options.requestOptions || {};
|
||||
const requestMethod = (requestOptions.requestMethod || "GET").toUpperCase();
|
||||
const requestParams = requestOptions.requestParams || null;
|
||||
const formData = requestOptions.formData || null;
|
||||
let requestPayload = null;
|
||||
const request = new XMLHttpRequest();
|
||||
const timeout = options.timeout || 0;
|
||||
|
||||
request.onreadystatechange = function () {
|
||||
if (request.readyState === 4) {
|
||||
if (request.status === 200) {
|
||||
callback(request.responseText, request, location, options);
|
||||
} else if (request.status !== 0) {
|
||||
callback(null, request, location, options);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
request.onerror = function (e) {
|
||||
console.log(e);
|
||||
callback(null, request, location, options);
|
||||
};
|
||||
|
||||
request.ontimeout = function () {
|
||||
callback(null, request, location, options);
|
||||
};
|
||||
|
||||
if (requestParams && requestParams.length) {
|
||||
queryString = requestParams
|
||||
.map(function (param) {
|
||||
return param.name + "=" + param.value;
|
||||
})
|
||||
.join("&");
|
||||
|
||||
switch (requestMethod) {
|
||||
case "GET":
|
||||
location = location.split("?")[0];
|
||||
|
||||
location += "?" + queryString;
|
||||
break;
|
||||
|
||||
case "POST":
|
||||
requestPayload = queryString;
|
||||
break;
|
||||
}
|
||||
} else if (formData) {
|
||||
requestPayload = formData;
|
||||
}
|
||||
|
||||
if (options.cacheBust) {
|
||||
location = updateQueryString(location, "t", Date.now());
|
||||
}
|
||||
|
||||
request.open(requestMethod, location, true);
|
||||
request.timeout = timeout;
|
||||
request.setRequestHeader("X-Requested-With", "XMLHttpRequest");
|
||||
request.setRequestHeader("X-PJAX", "true");
|
||||
request.setRequestHeader("X-PJAX-Selectors", JSON.stringify(options.selectors));
|
||||
request.setRequestHeader("accept", "text/html, application/json, text/plain, */*");
|
||||
request.withCredentials = true;
|
||||
|
||||
// 发送 POST 表单
|
||||
if (requestPayload && requestMethod === "POST" && !formData) {
|
||||
request.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
|
||||
}
|
||||
|
||||
request.send(requestPayload);
|
||||
|
||||
return request;
|
||||
};
|
||||
|
||||
const updateQueryString = (uri, key, value) => {
|
||||
const re = new RegExp(`([?&])${key}=.*?(&|$)`, "i");
|
||||
const separator = uri.includes("?") ? "&" : "?";
|
||||
return uri.match(re)
|
||||
? uri.replace(re, `$1${key}=${value}$2`)
|
||||
: uri + separator + key + "=" + value;
|
||||
};
|
||||
|
||||
|
||||
async function retry(promiseFn, maxRetries = 3, interval = 1000) {
|
||||
try {
|
||||
return await promiseFn();
|
||||
} catch (error) {
|
||||
if (maxRetries > 0) {
|
||||
await new Promise((resolve) => setTimeout(resolve, interval));
|
||||
return await retry(promiseFn, maxRetries - 1, interval);
|
||||
} else {
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
import {terminal} from "./terminal.js";
|
||||
import './styles/style.scss';
|
||||
import './module/post.js'
|
||||
import './module/toggle.js'
|
||||
import './module/effect.js'
|
||||
|
||||
terminal.refresh();
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
function type() {
|
||||
document.addEventListener('DOMContentLoaded', () => {
|
||||
let typedTextContainer = document.querySelector('.typed-text');
|
||||
if (!typedTextContainer) {
|
||||
return;
|
||||
}
|
||||
|
||||
function typeWriter(container) {
|
||||
let text = container.innerText;
|
||||
container.innerText = '';
|
||||
let i = 0;
|
||||
|
||||
function _type() {
|
||||
if (i < text.length) {
|
||||
container.innerHTML += text.charAt(i);
|
||||
i++;
|
||||
setTimeout(_type, Math.random() * 200 + 50);
|
||||
}
|
||||
}
|
||||
|
||||
_type();
|
||||
}
|
||||
|
||||
typeWriter(typedTextContainer);
|
||||
})
|
||||
}
|
||||
|
||||
terminal.registerRefresh(type);
|
||||
@@ -0,0 +1,82 @@
|
||||
import tocbot from "tocbot";
|
||||
|
||||
async function generateToc() {
|
||||
const toc = document.querySelector(".toc");
|
||||
if (!toc) return;
|
||||
const content = document.getElementById("content");
|
||||
const titles = content.querySelectorAll("h1, h2, h3, h4");
|
||||
if (!titles || titles.length === 0) {
|
||||
toc.style.display = "none";
|
||||
toc.remove();
|
||||
return;
|
||||
} else {
|
||||
toc.style.display = "block";
|
||||
}
|
||||
if (typeof tocbot !== 'undefined') {
|
||||
tocbot.destroy();
|
||||
tocbot.init({
|
||||
tocSelector: ".toc",
|
||||
contentSelector: "#content",
|
||||
headingSelector: "h1, h2, h3, h4",
|
||||
extraListClasses: "toc-list",
|
||||
extraLinkClasses: "toc-link",
|
||||
headingsOffset: 96,
|
||||
scrollSmoothOffset: -96,
|
||||
scrollSmooth: true,
|
||||
});
|
||||
}
|
||||
void locateToc();
|
||||
}
|
||||
|
||||
async function locateToc() {
|
||||
const toc = document.querySelector(".toc")
|
||||
if (!toc) return;
|
||||
const content = document.getElementById("content");
|
||||
const contentRight = content.getBoundingClientRect().right;
|
||||
if (toc && contentRight) {
|
||||
toc.style.left = `${contentRight}px`;
|
||||
}
|
||||
}
|
||||
|
||||
function destroyToc() {
|
||||
const toc = document.querySelector(".toc")
|
||||
if (!toc) return;
|
||||
toc.style.display = "none";
|
||||
toc.remove();
|
||||
if (typeof tocbot !== 'undefined') {
|
||||
tocbot.destroy();
|
||||
}
|
||||
}
|
||||
|
||||
async function init_toc() {
|
||||
void generateToc();
|
||||
void locateToc();
|
||||
|
||||
let resizeTimer;
|
||||
let isVisible = true;
|
||||
|
||||
document.addEventListener('visibilitychange', () => {
|
||||
isVisible = !document.hidden;
|
||||
});
|
||||
|
||||
window.addEventListener('resize', () => {
|
||||
if (!isVisible) return;
|
||||
|
||||
clearTimeout(resizeTimer);
|
||||
resizeTimer = setTimeout(() => {
|
||||
requestAnimationFrame(() => {
|
||||
locateToc();
|
||||
});
|
||||
}, 200);
|
||||
});
|
||||
}
|
||||
|
||||
function register_toc() {
|
||||
document.addEventListener('DOMContentLoaded', () => {
|
||||
void init_toc();
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
terminal.registerRefresh(generateToc);
|
||||
terminal.registerInitFunc(register_toc);
|
||||
@@ -0,0 +1,47 @@
|
||||
function register_themeToggle() {
|
||||
const toggle = document.getElementById("theme-toggle");
|
||||
let storedMode = localStorage.getItem("theme-mode");
|
||||
|
||||
if (!storedMode) {
|
||||
localStorage.setItem("theme-mode", default_mode);
|
||||
storedMode = default_mode;
|
||||
}
|
||||
|
||||
const targetTheme = storedMode === "light" ? light_theme : dark_theme;
|
||||
|
||||
document.documentElement.setAttribute("data-color-scheme", storedMode);
|
||||
document.documentElement.setAttribute("theme-color-scheme", targetTheme);
|
||||
|
||||
toggle.addEventListener("click", function () {
|
||||
const nextMode = storedMode === "dark" ? "light" : "dark";
|
||||
const nextTheme = nextMode === "dark" ? dark_theme : light_theme;
|
||||
|
||||
document.documentElement.setAttribute("data-color-scheme", nextMode);
|
||||
document.documentElement.setAttribute("theme-color-scheme", nextTheme);
|
||||
localStorage.setItem("theme-mode", nextMode);
|
||||
|
||||
storedMode = nextMode;
|
||||
});
|
||||
}
|
||||
|
||||
function register_pixelToggle() {
|
||||
const pixel_toggle = document.getElementById('pixel-toggle');
|
||||
let storedStatus = localStorage.getItem("pixel_style");
|
||||
if (!storedStatus) {
|
||||
localStorage.setItem("pixel_style", pixel_status);
|
||||
storedStatus = pixel_status.toString();
|
||||
}
|
||||
|
||||
document.documentElement.setAttribute("pixel_style", storedStatus);
|
||||
|
||||
pixel_toggle.addEventListener('click', function () {
|
||||
let newStatus = storedStatus === 'true' ? 'false' : 'true';
|
||||
document.documentElement.setAttribute("pixel_style", newStatus);
|
||||
localStorage.setItem("pixel_style", newStatus);
|
||||
|
||||
storedStatus = newStatus;
|
||||
});
|
||||
}
|
||||
|
||||
terminal.registerInitFunc(register_pixelToggle);
|
||||
terminal.registerInitFunc(register_themeToggle);
|
||||
@@ -0,0 +1,84 @@
|
||||
.button-container {
|
||||
display: table;
|
||||
margin-left: auto;
|
||||
margin-right: auto;
|
||||
}
|
||||
|
||||
button,
|
||||
.button,
|
||||
a.button {
|
||||
position: relative;
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
padding: 8px 18px;
|
||||
text-decoration: none;
|
||||
text-align: center;
|
||||
font: inherit;
|
||||
font-weight: bold;
|
||||
appearance: none;
|
||||
cursor: pointer;
|
||||
outline: none;
|
||||
}
|
||||
|
||||
button.outline,
|
||||
.button.outline,
|
||||
a.button.outline {
|
||||
background: transparent;
|
||||
box-shadow: none;
|
||||
padding: 8px 18px;
|
||||
}
|
||||
|
||||
button.outline :hover,
|
||||
.button.outline :hover,
|
||||
a.button.outline :hover {
|
||||
transform: none;
|
||||
box-shadow: none;
|
||||
}
|
||||
|
||||
button.link,
|
||||
.button.link,
|
||||
a.button.link {
|
||||
background: none;
|
||||
font-size: var(--font-size);
|
||||
}
|
||||
|
||||
button.small,
|
||||
.button.small,
|
||||
a.button.small {
|
||||
font-size: calc(var(--font-size) * 0.8);
|
||||
}
|
||||
|
||||
button.wide,
|
||||
.button.wide,
|
||||
a.button.wide {
|
||||
min-width: 200px;
|
||||
padding: 14px 24px;
|
||||
}
|
||||
|
||||
a.button.inline {
|
||||
background: none;
|
||||
color: var(--color-theme-accent);
|
||||
padding: initial;
|
||||
margin: initial;
|
||||
border: initial;
|
||||
font-weight: initial;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
a.button.inline:active,
|
||||
a.button.inline:hover {
|
||||
background: none;
|
||||
}
|
||||
|
||||
a.read-more,
|
||||
a.read-more:hover,
|
||||
a.read-more:active {
|
||||
display: inline-flex;
|
||||
border: none;
|
||||
background: none;
|
||||
box-shadow: none;
|
||||
padding: 0;
|
||||
max-width: 100%;
|
||||
text-decoration: none;
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
comment-widget {
|
||||
--halo-comment-widget-base-font-family: var(--font-theme-default) !important;
|
||||
--halo-comment-widget-base-border-radius: 0 !important;
|
||||
--halo-comment-widget-base-color: var(--color-theme-accent) !important;
|
||||
--halo-comment-widget-base-info-color: var(--color-theme-foreground) !important;
|
||||
--halo-comment-widget-component-form-input-bg-color: var(--color-theme-background) !important;
|
||||
--halo-comment-widget-component-form-input-color: var(--color-theme-foreground) !important;
|
||||
--halo-comment-widget-component-form-input-border-color: var(--color-theme-accent) !important;
|
||||
--halo-comment-widget-component-form-input-border-color-focus: var(--color-theme-accent) !important;
|
||||
--halo-comment-widget-component-form-input-box-shadow-focus: var(--color-theme-accent) !important;
|
||||
--halo-comment-widget-component-form-button-login-bg-color: var(--color-theme-background) !important;
|
||||
--halo-comment-widget-component-form-button-login-bg-color-hover: var(--color-theme-background) !important;
|
||||
--halo-comment-widget-component-form-button-login-border-color: var(--color-theme-background) !important;
|
||||
--halo-comment-widget-component-form-button-submit-bg-color: var(--color-theme-background) !important;
|
||||
--halo-comment-widget-component-form-button-submit-color: var(--color-theme-accent) !important;
|
||||
--halo-comment-widget-component-form-button-submit-border-color: var(--color-theme-background) !important;
|
||||
--halo-comment-widget-component-form-button-submit-border-color-hover: var(--color-theme-background) !important;
|
||||
--halo-comment-widget-component-form-button-emoji-color: var(--color-theme-background) !important;
|
||||
--halo-comment-widget-component-comment-item-action-bg-color-hover: var(--color-theme-background) !important;
|
||||
--halo-comment-widget-component-comment-item-action-color-hover: var(--color-theme-accent) !important;
|
||||
--halo-comment-widget-component-pagination-button-bg-color-hover: var(--color-theme-background) !important;
|
||||
--halo-comment-widget-component-pagination-button-bg-color-active: var(--color-theme-background) !important;
|
||||
--halo-comment-widget-component-pagination-button-border-color-active: var(--color-theme-background) !important;
|
||||
--halo-comment-widget-component-emoji-picker-rgb-color: var(--color-theme-background) !important;
|
||||
--halo-comment-widget-component-emoji-picker-rgb-accent: var(--color-theme-accent) !important;
|
||||
--halo-comment-widget-component-emoji-picker-rgb-background: var(--color-theme-background) !important;
|
||||
--halo-comment-widget-component-emoji-picker-rgb-input: var(--color-theme-accent) !important;
|
||||
--halo-comment-widget-component-emoji-picker-color-border: var(--color-theme-background) !important;
|
||||
--halo-comment-widget-component-emoji-picker-color-border-over: var(--color-theme-background) !important;
|
||||
}
|
||||
|
||||
.comment {
|
||||
margin-top: 80px;
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
@font-face {
|
||||
font-family: 'JetBrains Mono';
|
||||
src: local('JetBrains Mono'), local('JetBrainsMono Nerd Font'), url('../fonts/JetBrainsMono-Regular.woff2') format('woff2');
|
||||
font-display: swap;
|
||||
font-style: normal;
|
||||
}
|
||||
|
||||
@font-face {
|
||||
font-family: 'Fusion Pixel 12px P zh_hans';
|
||||
font-display: swap;
|
||||
src: url("../fonts/fusion-pixel-12px-proportional-zh_hans.woff2") format('woff2');
|
||||
}
|
||||
@@ -0,0 +1,101 @@
|
||||
@import "variables";
|
||||
|
||||
.footer {
|
||||
padding: 40px 0;
|
||||
flex-grow: 0;
|
||||
opacity: 0.65;
|
||||
}
|
||||
|
||||
.footer-inner {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
text-align: center;
|
||||
padding: 20px;
|
||||
max-width: 1200px;
|
||||
margin: 0 auto;
|
||||
gap: 12px;
|
||||
|
||||
a {
|
||||
color: inherit;
|
||||
}
|
||||
}
|
||||
|
||||
.footer-copyright-engine {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
font-size: 0.9rem;
|
||||
line-height: 1.5;
|
||||
}
|
||||
|
||||
.footer-copyright-engine span,
|
||||
.footer-copyright-engine a {
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
|
||||
.footer-copyright-site {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
gap: 10px;
|
||||
flex-wrap: wrap;
|
||||
font-size: 0.9rem;
|
||||
line-height: 1.5;
|
||||
}
|
||||
|
||||
.footer-user {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.footer-icp p {
|
||||
margin: 0;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 10px;
|
||||
flex-wrap: wrap;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
@media (max-width: 768px) {
|
||||
.footer-inner {
|
||||
padding: 15px 10px;
|
||||
gap: 10px;
|
||||
}
|
||||
|
||||
.footer-copyright-engine {
|
||||
font-size: 13px;
|
||||
line-height: 1.6;
|
||||
}
|
||||
|
||||
.footer-copyright-site {
|
||||
flex-direction: column;
|
||||
gap: 8px;
|
||||
font-size: 13px;
|
||||
}
|
||||
|
||||
.footer-icp p {
|
||||
flex-direction: column;
|
||||
gap: 5px;
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 480px) {
|
||||
.footer-inner {
|
||||
padding: 12px 8px;
|
||||
}
|
||||
|
||||
.footer-copyright-engine,
|
||||
.footer-copyright-site {
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
.footer-copyright-engine span,
|
||||
.footer-copyright-engine a {
|
||||
white-space: normal;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,54 @@
|
||||
.header {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.header__inner {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
|
||||
#theme-toggle, #search-button, #pixel-toggle {
|
||||
background-color: transparent;
|
||||
color: var(--color-theme-header);
|
||||
border-color: var(--color-theme-header);
|
||||
margin: 0 0 0 .5rem;
|
||||
padding: 0;
|
||||
}
|
||||
}
|
||||
|
||||
.header__logo {
|
||||
display: flex;
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
.header__logo::after {
|
||||
content: "";
|
||||
background: repeating-linear-gradient(90deg, var(--color-theme-header), var(--color-theme-header) 2px, transparent 0, transparent 10px);
|
||||
display: block;
|
||||
width: 100%;
|
||||
right: 10px;
|
||||
}
|
||||
|
||||
.header__logo a {
|
||||
flex: 0 0 auto;
|
||||
max-width: 100%;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.logo {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
text-decoration: none;
|
||||
background: var(--color-theme-header);
|
||||
color: var(--color-theme-background);
|
||||
font-weight: bold;
|
||||
padding: 5px 10px;
|
||||
}
|
||||
|
||||
@media print {
|
||||
.header {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
.icon-pixel,
|
||||
.icon-regular {
|
||||
display: none;
|
||||
}
|
||||
|
||||
html[pixel_style='false'] .icon-regular {
|
||||
display: inline;
|
||||
}
|
||||
|
||||
html[pixel_style='true'] .icon-pixel {
|
||||
display: inline;
|
||||
}
|
||||
@@ -0,0 +1,56 @@
|
||||
.link-section {
|
||||
margin-bottom: 2rem;
|
||||
}
|
||||
|
||||
.link-table {
|
||||
width: 100%;
|
||||
border-collapse: collapse;
|
||||
}
|
||||
|
||||
.link-item {
|
||||
display: block;
|
||||
margin-bottom: 0.5rem;
|
||||
text-decoration: none;
|
||||
color: inherit;
|
||||
}
|
||||
|
||||
.link-item:hover {
|
||||
background-color: var(--color-theme-background);
|
||||
}
|
||||
|
||||
.link-container {
|
||||
display: flex;
|
||||
padding: 0.25rem;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.link-logo {
|
||||
width: 4rem;
|
||||
height: auto;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.link-content {
|
||||
margin-left: 1rem;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: space-around;
|
||||
min-height: 4rem;
|
||||
}
|
||||
|
||||
.link-title {
|
||||
margin: 0;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
.link-url {
|
||||
color: var(--color-theme-accent);
|
||||
font-size: 0.9em;
|
||||
}
|
||||
|
||||
.link-description {
|
||||
margin: 0;
|
||||
color: var(--color-theme-foreground);
|
||||
font-size: 0.9em;
|
||||
line-height: 1.4;
|
||||
}
|
||||
@@ -0,0 +1,534 @@
|
||||
@import "variables";
|
||||
|
||||
:root {
|
||||
--color-theme-background: ;
|
||||
--color-theme-foreground: ;
|
||||
--color-theme-accent: ;
|
||||
--color-theme-tag: ;
|
||||
--color-theme-title: ;
|
||||
--color-theme-meta: ;
|
||||
--color-theme-framed: ;
|
||||
--color-theme-menu: ;
|
||||
--color-theme-header: ;
|
||||
--list-marker: "►";
|
||||
--font-size: 1rem;
|
||||
--line-height: 1.54em;
|
||||
--radius: 0;
|
||||
--font-theme-default: 'JetBrains Mono';
|
||||
--font--theme-fallback: Monaco, Consolas, -apple-system, BlinkMacSystemFont, 'segoe ui',
|
||||
Roboto, Oxygen, Ubuntu, Cantarell, 'open sans', 'helvetica neue';
|
||||
|
||||
@media (max-width: $phone-max-width) {
|
||||
--font-size: 0.95rem;
|
||||
}
|
||||
}
|
||||
|
||||
html {
|
||||
box-sizing: border-box;
|
||||
scrollbar-gutter: stable;
|
||||
}
|
||||
|
||||
html[pixel_style='true'] {
|
||||
--font-theme-default: 'Fusion Pixel 12px P zh_hans';
|
||||
}
|
||||
|
||||
* {
|
||||
scrollbar-width: thin !important;
|
||||
scrollbar-color: rgba(134, 134, 134, 0.45) rgba(255, 255, 255, 0);
|
||||
font-variant-ligatures: none;
|
||||
}
|
||||
|
||||
*,
|
||||
*::before,
|
||||
*::after {
|
||||
box-sizing: inherit;
|
||||
word-break: break-word;
|
||||
}
|
||||
|
||||
body {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
font-family: var(--font-theme-default), var(--font--theme-fallback), sans-serif;
|
||||
font-size: var(--font-size);
|
||||
line-height: var(--line-height);
|
||||
background-color: var(--color-theme-background);
|
||||
color: var(--color-theme-foreground);
|
||||
text-rendering: optimizelegibility;
|
||||
-webkit-font-smoothing: antialiased;
|
||||
-webkit-overflow-scrolling: touch;
|
||||
text-size-adjust: 100%;
|
||||
}
|
||||
|
||||
h1 {
|
||||
font-size: calc(var(--font-size) * 1.45);
|
||||
letter-spacing: 0;
|
||||
}
|
||||
|
||||
h2 {
|
||||
font-size: calc(var(--font-size) * 1.35);
|
||||
letter-spacing: 0;
|
||||
}
|
||||
|
||||
h3 {
|
||||
font-size: calc(var(--font-size) * 1.15);
|
||||
letter-spacing: 0;
|
||||
}
|
||||
|
||||
h4,
|
||||
h5,
|
||||
h6 {
|
||||
font-size: calc(var(--font-size) * 1);
|
||||
letter-spacing: 0;
|
||||
}
|
||||
|
||||
h1,
|
||||
h2,
|
||||
h3,
|
||||
h4,
|
||||
h5,
|
||||
h6,
|
||||
p,
|
||||
ul,
|
||||
ol,
|
||||
img,
|
||||
figure,
|
||||
video,
|
||||
table {
|
||||
margin: 25px 0;
|
||||
}
|
||||
|
||||
a {
|
||||
color: var(--color-theme-accent);
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
button {
|
||||
position: relative;
|
||||
font: inherit;
|
||||
font-weight: bold;
|
||||
text-decoration: none;
|
||||
text-align: center;
|
||||
background: transparent;
|
||||
color: var(--color-theme-accent);
|
||||
padding: 5px 18px;
|
||||
border: 4px solid var(--color-theme-accent);
|
||||
border-radius: var(--radius);
|
||||
transition: background 0.15s linear;
|
||||
appearance: none;
|
||||
cursor: pointer;
|
||||
outline: none;
|
||||
}
|
||||
|
||||
button:hover {
|
||||
background: color-mix(in srgb, var(--color-theme-accent) 15%, transparent);
|
||||
}
|
||||
|
||||
button:focus-visible,
|
||||
a:focus-visible {
|
||||
outline: 1px solid var(--color-theme-accent);
|
||||
outline-offset: 2px;
|
||||
}
|
||||
|
||||
fieldset {
|
||||
display: inline-block;
|
||||
border: 2px solid var(--color-theme-foreground);
|
||||
border-radius: calc(var(--radius) * 1.6);
|
||||
padding: 10px;
|
||||
}
|
||||
|
||||
fieldset *:first-child {
|
||||
margin-top: 0;
|
||||
}
|
||||
|
||||
fieldset input,
|
||||
fieldset select,
|
||||
fieldset textarea,
|
||||
fieldset label,
|
||||
fieldset button {
|
||||
margin-top: calc(var(--line-height) * 0.5);
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
label {
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
label input {
|
||||
margin-top: 0;
|
||||
}
|
||||
|
||||
input,
|
||||
textarea,
|
||||
select {
|
||||
background: transparent;
|
||||
color: var(--color-theme-foreground);
|
||||
border: 1px solid var(--color-theme-foreground);
|
||||
border-radius: var(--radius);
|
||||
padding: 10px;
|
||||
font: inherit;
|
||||
appearance: none;
|
||||
}
|
||||
|
||||
input[type="checkbox"] {
|
||||
width: auto;
|
||||
}
|
||||
|
||||
input:focus-visible,
|
||||
input:active,
|
||||
textarea:focus-visible,
|
||||
textarea:active,
|
||||
select:focus-visible,
|
||||
select:active {
|
||||
border-color: var(--color-theme-accent);
|
||||
outline: 1px solid var(--color-theme-accent);
|
||||
outline-offset: 2px;
|
||||
}
|
||||
|
||||
input:active,
|
||||
textarea:active,
|
||||
select:active {
|
||||
box-shadow: none;
|
||||
}
|
||||
|
||||
select {
|
||||
background-image: linear-gradient(
|
||||
45deg,
|
||||
transparent 50%,
|
||||
var(--color-theme-foreground) 50%
|
||||
),
|
||||
linear-gradient(135deg, var(--color-theme-foreground) 50%, transparent 50%);
|
||||
background-position: calc(100% - 20px), calc(100% - 1em);
|
||||
background-size: 5px 5px, 5px 5px;
|
||||
background-repeat: no-repeat;
|
||||
padding-right: 40px;
|
||||
}
|
||||
|
||||
select option {
|
||||
background: var(--color-theme-background);
|
||||
}
|
||||
|
||||
input[type="checkbox"] {
|
||||
vertical-align: middle;
|
||||
padding: 10px;
|
||||
box-shadow: inset 0 0 0 3px var(--color-theme-background);
|
||||
}
|
||||
|
||||
input[type="checkbox"]:checked {
|
||||
background: var(--color-theme-accent);
|
||||
}
|
||||
|
||||
img {
|
||||
display: block;
|
||||
max-width: 100%;
|
||||
border: 4px solid var(--color-theme-accent);
|
||||
border-radius: var(--radius);
|
||||
padding: 4px;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
img.left {
|
||||
margin-right: auto;
|
||||
}
|
||||
|
||||
img.center {
|
||||
margin-left: auto;
|
||||
margin-right: auto;
|
||||
}
|
||||
|
||||
img.right {
|
||||
margin-left: auto;
|
||||
}
|
||||
|
||||
figure {
|
||||
width: fit-content;
|
||||
}
|
||||
|
||||
figure.left {
|
||||
margin-right: auto;
|
||||
}
|
||||
|
||||
figure.center {
|
||||
margin-left: auto;
|
||||
margin-right: auto;
|
||||
}
|
||||
|
||||
figure.right {
|
||||
margin-left: auto;
|
||||
}
|
||||
|
||||
figure img,
|
||||
figure video {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
figure figcaption {
|
||||
background: var(--color-theme-accent);
|
||||
color: var(--color-theme-background);
|
||||
text-align: center;
|
||||
font-size: var(--font-size);
|
||||
font-weight: normal;
|
||||
margin-top: -8px;
|
||||
padding: 0 8px;
|
||||
border-radius: 0 0 var(--radius) var(--radius);
|
||||
}
|
||||
|
||||
figure figcaption p:first-child {
|
||||
margin-top: 0;
|
||||
}
|
||||
|
||||
ul,
|
||||
ol {
|
||||
margin-left: 4ch;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
ul ul,
|
||||
ul ol,
|
||||
ol ul,
|
||||
ol ol {
|
||||
margin-top: 0;
|
||||
}
|
||||
|
||||
li::marker {
|
||||
color: var(--color-theme-accent);
|
||||
}
|
||||
|
||||
ul li,
|
||||
ol li {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
code,
|
||||
kbd {
|
||||
font-family: inherit !important;
|
||||
font-feature-settings: normal;
|
||||
background: color-mix(in srgb, var(--color-theme-foreground) 5%, transparent);
|
||||
border: 1px solid var(--code-border);
|
||||
padding: 1px 6px;
|
||||
margin: 0 2px;
|
||||
font-size: calc(var(--font-size) * 0.95);
|
||||
}
|
||||
|
||||
kbd {
|
||||
border-top: 1px solid color-mix(in srgb, var(--color-theme-accent) 25%, transparent);
|
||||
border-left: 1px solid var(--color-theme-accent);
|
||||
border-right: 1px solid var(--color-theme-accent);
|
||||
border-bottom: 4px solid var(--color-theme-accent);
|
||||
border-radius: 4px;
|
||||
}
|
||||
|
||||
code code {
|
||||
background: transparent;
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
pre {
|
||||
font-family: inherit !important;
|
||||
tab-size: 4;
|
||||
background: color-mix(in srgb, var(--color-theme-foreground) 5%, transparent) !important;
|
||||
color: var(--color-theme-foreground);
|
||||
padding: 10px 10px;
|
||||
font-size: calc(var(--font-size) * 0.95) !important;
|
||||
overflow: auto;
|
||||
border-radius: var(--radius);
|
||||
border: 1px solid color-mix(in srgb, var(--color-theme-foreground) 10%, transparent);
|
||||
|
||||
@media (max-width: $phone-max-width) {
|
||||
white-space: pre-wrap;
|
||||
word-wrap: break-word;
|
||||
}
|
||||
}
|
||||
|
||||
pre code {
|
||||
background: none !important;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
border: none;
|
||||
}
|
||||
|
||||
sup {
|
||||
line-height: 0;
|
||||
}
|
||||
|
||||
abbr {
|
||||
position: relative;
|
||||
text-decoration-style: wavy;
|
||||
text-decoration-color: var(--color-theme-accent);
|
||||
cursor: help;
|
||||
}
|
||||
|
||||
sub {
|
||||
bottom: -0.25em;
|
||||
}
|
||||
|
||||
sup {
|
||||
top: -0.25em;
|
||||
}
|
||||
|
||||
mark {
|
||||
background: color-mix(in srgb, var(--color-theme-accent) 45%, transparent);
|
||||
color: var(--color-theme-foreground);
|
||||
}
|
||||
|
||||
blockquote {
|
||||
position: relative;
|
||||
border-top: 1px solid var(--color-theme-foreground);
|
||||
border-bottom: 1px solid var(--color-theme-foreground);
|
||||
border-left: .4rem solid var(--color-theme-foreground);
|
||||
margin: 0;
|
||||
padding: 20px;
|
||||
}
|
||||
|
||||
blockquote p:first-child {
|
||||
margin-top: 0;
|
||||
}
|
||||
|
||||
blockquote p:last-child {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
table {
|
||||
table-layout: auto;
|
||||
border-collapse: collapse;
|
||||
}
|
||||
|
||||
table,
|
||||
th,
|
||||
td {
|
||||
border: 2px solid var(--color-theme-foreground);
|
||||
padding: 10px;
|
||||
}
|
||||
|
||||
th {
|
||||
border-style: solid;
|
||||
color: var(--color-theme-foreground);
|
||||
text-align: left;
|
||||
text-transform: uppercase;
|
||||
letter-spacing: 0.04em;
|
||||
}
|
||||
|
||||
hr {
|
||||
width: 100%;
|
||||
border: none;
|
||||
background: var(--color-theme-accent);
|
||||
height: 2px;
|
||||
}
|
||||
|
||||
/* One Heading Size */
|
||||
.headings--one-size h1,
|
||||
.headings--one-size h2,
|
||||
.headings--one-size h3,
|
||||
.headings--one-size h4,
|
||||
.headings--one-size h5,
|
||||
.headings--one-size h6 {
|
||||
font-size: 1.4rem;
|
||||
line-height: 1.3;
|
||||
margin: 20px 0;
|
||||
}
|
||||
|
||||
.headings--one-size ~ h1:first-child,
|
||||
.headings--one-size ~ h2:first-child,
|
||||
.headings--one-size ~ h3:first-child,
|
||||
.headings--one-size ~ h4:first-child,
|
||||
.headings--one-size ~ h5:first-child,
|
||||
.headings--one-size ~ h6:first-child {
|
||||
margin-top: 20px;
|
||||
}
|
||||
|
||||
blockquote.twitter-tweet {
|
||||
position: relative;
|
||||
background: var(--color-theme-background);
|
||||
font: inherit;
|
||||
color: inherit;
|
||||
border: 1px solid var(--color-theme-accent);
|
||||
padding-top: 60px;
|
||||
}
|
||||
|
||||
blockquote.twitter-tweet a {
|
||||
color: var(--color-theme-accent);
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
blockquote.twitter-tweet::before {
|
||||
content: "> From X:";
|
||||
position: absolute;
|
||||
top: 20px;
|
||||
left: 20px;
|
||||
color: var(--color-theme-accent);
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.container {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
padding: 40px;
|
||||
max-width: 864px;
|
||||
min-height: 100vh;
|
||||
border-right: 1px solid color-mix(in srgb, var(--color-theme-accent) 10%, transparent);
|
||||
|
||||
@media (max-width: $phone-max-width) {
|
||||
padding: 20px;
|
||||
}
|
||||
}
|
||||
|
||||
.container.full, .container.center {
|
||||
border: none;
|
||||
margin: 0 auto;
|
||||
}
|
||||
|
||||
.container.full {
|
||||
max-width: 100%;
|
||||
}
|
||||
|
||||
.content {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.hidden {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.__h_video {
|
||||
position: relative;
|
||||
overflow: visible !important;
|
||||
height: auto !important;
|
||||
padding-bottom: 0 !important;
|
||||
}
|
||||
|
||||
.__h_video a {
|
||||
position: relative;
|
||||
display: block;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.__h_video a img {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.__h_video a .play {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
margin: auto;
|
||||
width: 60px;
|
||||
height: 60px;
|
||||
}
|
||||
|
||||
iframe[src*="youtube.com"] {
|
||||
border: 8px solid var(--color-theme-accent) !important;
|
||||
padding: 8px !important;
|
||||
}
|
||||
|
||||
@media print {
|
||||
.container {
|
||||
display: initial;
|
||||
}
|
||||
|
||||
.content {
|
||||
display: initial;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,138 @@
|
||||
@import "variables";
|
||||
|
||||
.navigation-menu {
|
||||
display: flex;
|
||||
align-items: flex-start;
|
||||
justify-content: space-between;
|
||||
margin: 20px 1px;
|
||||
|
||||
a {
|
||||
text-decoration: none;
|
||||
color: var(--color-theme-menu);
|
||||
}
|
||||
|
||||
@media (max-width: $phone-max-width) {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.navigation-menu__inner {
|
||||
display: flex;
|
||||
flex: 1;
|
||||
flex-wrap: wrap;
|
||||
list-style: none;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
|
||||
@media (max-width: $phone-max-width) {
|
||||
flex-direction: column;
|
||||
align-items: flex-start;
|
||||
padding: 0;
|
||||
|
||||
li {
|
||||
flex: 0 0 auto;
|
||||
}
|
||||
|
||||
li:not(:last-of-type) {
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
.navigation-menu__inner li {
|
||||
margin: 0;
|
||||
padding: 5px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.navigation-menu__inner > li {
|
||||
flex: 0 0 auto;
|
||||
margin-bottom: 10px;
|
||||
white-space: nowrap;
|
||||
|
||||
@media (max-width: $phone-max-width) {
|
||||
margin: 0;
|
||||
padding: 5px;
|
||||
}
|
||||
}
|
||||
|
||||
.navigation-menu__inner > li:not(:last-of-type) {
|
||||
margin-right: 20px;
|
||||
}
|
||||
|
||||
.navigation-menu .spacer {
|
||||
flex-grow: 1 !important;
|
||||
}
|
||||
|
||||
.menu {
|
||||
display: flex;
|
||||
position: relative;
|
||||
list-style: none;
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.menu__trigger {
|
||||
all: unset;
|
||||
cursor: pointer;
|
||||
background-color: var(--color-theme-background) !important;
|
||||
margin-right: 0 !important;
|
||||
padding-left: 5px;
|
||||
padding-right: 5px;
|
||||
color: var(--color-theme-menu);
|
||||
user-select: none;
|
||||
border: none;
|
||||
display: inline-flex;
|
||||
|
||||
@media (max-width: $phone-max-width) {
|
||||
padding-left: 10px;
|
||||
padding-right: 10px;
|
||||
margin-bottom: 0 !important;
|
||||
outline: none;
|
||||
-webkit-tap-highlight-color: transparent;
|
||||
}
|
||||
}
|
||||
|
||||
.menu__dropdown {
|
||||
display: none;
|
||||
flex-direction: column;
|
||||
position: absolute;
|
||||
background: var(--color-theme-background);
|
||||
box-shadow: 0 10px var(--color-theme-background), -10px 10px var(--color-theme-background), 10px 10px var(--color-theme-background);
|
||||
color: var(--color-theme-accent);
|
||||
border: 2px solid var(--color-theme-menu);
|
||||
margin: 0;
|
||||
padding: 5px;
|
||||
top: 25px;
|
||||
list-style: none;
|
||||
z-index: 99;
|
||||
|
||||
@media (max-width: $phone-max-width) {
|
||||
left: auto;
|
||||
right: 0;
|
||||
}
|
||||
}
|
||||
|
||||
.menu__dropdown > li {
|
||||
flex: 0 0 auto;
|
||||
}
|
||||
|
||||
.menu__dropdown > li:not(:last-of-type) {
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
.menu__dropdown > li a {
|
||||
display: flex;
|
||||
padding: 5px;
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
.sub-menu {
|
||||
display: flex;
|
||||
}
|
||||
|
||||
.sub-menu:hover .menu__dropdown,
|
||||
.sub-menu:active .menu__dropdown {
|
||||
display: flex !important;
|
||||
opacity: 1;
|
||||
visibility: visible;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
.moment-media {
|
||||
display: grid;
|
||||
gap: 0.5rem;
|
||||
margin: 1rem 0;
|
||||
width: 80%;
|
||||
}
|
||||
|
||||
.moment-media video {
|
||||
width: 100%;
|
||||
height: 200px;
|
||||
object-fit: cover;
|
||||
border-radius: 8px;
|
||||
transition: transform 0.3s ease;
|
||||
}
|
||||
@@ -0,0 +1,117 @@
|
||||
@import "variables";
|
||||
|
||||
.pagination {
|
||||
margin-top: 10px;
|
||||
|
||||
.pagination__title {
|
||||
display: flex;
|
||||
text-align: center;
|
||||
position: relative;
|
||||
margin: 10px 0 10px;
|
||||
}
|
||||
|
||||
.pagination__title-h {
|
||||
text-align: center;
|
||||
margin: 0 auto;
|
||||
padding: 5px 10px;
|
||||
background: var(--color-theme-background);
|
||||
color: color-mix(in srgb, var(--color-theme-foreground) 65%, transparent);
|
||||
font-size: calc(var(--font-size) * 0.8);
|
||||
text-transform: uppercase;
|
||||
text-decoration: none;
|
||||
letter-spacing: 0.1em;
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
.pagination__title hr {
|
||||
position: absolute;
|
||||
background-color: var(--color-theme-foreground);
|
||||
left: 0;
|
||||
right: 0;
|
||||
width: 100%;
|
||||
margin-top: 15px;
|
||||
z-index: 0;
|
||||
}
|
||||
|
||||
.pagination__buttons {
|
||||
display: flex;
|
||||
align-items: flex-start;
|
||||
justify-content: space-between;
|
||||
gap: 20px;
|
||||
|
||||
@media (min-width: calc(#{$phone-max-width} + 1px)) {
|
||||
flex-direction: row;
|
||||
}
|
||||
|
||||
@media (max-width: $phone-max-width) {
|
||||
flex-direction: column;
|
||||
gap: 15px;
|
||||
}
|
||||
|
||||
span {
|
||||
display: flex;
|
||||
|
||||
@media (min-width: calc(#{$phone-max-width} + 1px)) {
|
||||
&:first-child {
|
||||
margin-right: auto;
|
||||
}
|
||||
&:last-child {
|
||||
margin-left: auto;
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: $phone-max-width) {
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
a {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
max-width: 100%;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-decoration: none;
|
||||
color: var(--color-theme-foreground);
|
||||
|
||||
@media (max-width: $phone-max-width) {
|
||||
width: 100%;
|
||||
justify-content: flex-start;
|
||||
}
|
||||
}
|
||||
|
||||
.button {
|
||||
position: relative;
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
font-size: inherit;
|
||||
padding: 0;
|
||||
appearance: none;
|
||||
}
|
||||
}
|
||||
|
||||
.button__text {
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.next .button__icon {
|
||||
margin-left: 8px;
|
||||
}
|
||||
|
||||
.prev .button__icon {
|
||||
margin-right: 8px;
|
||||
}
|
||||
|
||||
.pagination__buttons:has(span:only-child) {
|
||||
justify-content: center;
|
||||
}
|
||||
}
|
||||
|
||||
@media print {
|
||||
.pagination {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,160 @@
|
||||
@import "variables";
|
||||
|
||||
.index-content {
|
||||
margin: 25px 0;
|
||||
}
|
||||
|
||||
.framed {
|
||||
border: 1px solid var(--color-theme-framed);
|
||||
padding: 20px;
|
||||
}
|
||||
|
||||
.framed *:first-child {
|
||||
margin-top: 0;
|
||||
}
|
||||
|
||||
.framed *:last-child {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
.posts {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.post {
|
||||
width: 100%;
|
||||
text-align: left;
|
||||
padding: 30px 0;
|
||||
}
|
||||
|
||||
.post:not(:last-of-type) {
|
||||
border-bottom: 1px solid color-mix(in srgb, var(--color-theme-foreground) 10%, transparent);
|
||||
}
|
||||
|
||||
.post-meta {
|
||||
font-size: inherit;
|
||||
margin-bottom: 10px;
|
||||
color: color-mix(in srgb, var(--color-theme-meta) 65%, transparent);
|
||||
}
|
||||
|
||||
.post-meta > *:not(:first-child)::before {
|
||||
content: "::";
|
||||
display: inline-block;
|
||||
margin: 0 8px;
|
||||
}
|
||||
|
||||
.post-title {
|
||||
position: relative;
|
||||
color: var(--color-theme-title);
|
||||
margin-top: 0 !important;
|
||||
margin-bottom: 15px !important;
|
||||
padding-bottom: 15px;
|
||||
border-bottom: 3px dotted var(--color-theme-accent);
|
||||
text-decoration: none !important;
|
||||
}
|
||||
|
||||
.post-title::after {
|
||||
content: "";
|
||||
position: absolute;
|
||||
bottom: 2px;
|
||||
display: block;
|
||||
width: 100%;
|
||||
border-bottom: 3px dotted var(--color-theme-accent);
|
||||
}
|
||||
|
||||
.post-title a {
|
||||
text-decoration: none;
|
||||
color: var(--color-theme-title);
|
||||
}
|
||||
|
||||
.post-tags {
|
||||
display: block;
|
||||
margin-bottom: 20px;
|
||||
font-size: inherit;
|
||||
}
|
||||
|
||||
.post-tag {
|
||||
color: var(--color-theme-tag);
|
||||
|
||||
a {
|
||||
color: inherit;
|
||||
}
|
||||
}
|
||||
|
||||
.table-of-contents {
|
||||
margin: 40px 0;
|
||||
}
|
||||
|
||||
.post-content {
|
||||
margin-top: 25px;
|
||||
}
|
||||
|
||||
.post-cover {
|
||||
margin: 25px 0;
|
||||
}
|
||||
|
||||
.post ul {
|
||||
list-style: none;
|
||||
}
|
||||
|
||||
.post ul li:not(:empty)::before {
|
||||
content: var(--list-marker);
|
||||
position: absolute;
|
||||
left: -20px;
|
||||
color: var(--color-theme-foreground);
|
||||
}
|
||||
|
||||
.post--regulation h1 {
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.post--regulation h2 {
|
||||
justify-content: center;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
.post--regulation h2 + h2 {
|
||||
margin-top: -10px;
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
.hanchor {
|
||||
position: absolute;
|
||||
color: var(--color-theme-accent);
|
||||
text-decoration: none;
|
||||
margin-left: 10px;
|
||||
visibility: hidden;
|
||||
}
|
||||
|
||||
h1:hover .hanchor,
|
||||
h2:hover .hanchor,
|
||||
h3:hover .hanchor,
|
||||
h4:hover .hanchor,
|
||||
h5:hover .hanchor,
|
||||
h6:hover .hanchor {
|
||||
visibility: visible;
|
||||
}
|
||||
|
||||
.footnotes {
|
||||
color: color-mix(in srgb, var(--color-theme-foreground) 50%, transparent);
|
||||
}
|
||||
|
||||
.footnotes hr {
|
||||
background: color-mix(in srgb, var(--color-theme-foreground) 50%, transparent);
|
||||
}
|
||||
|
||||
.post-list {
|
||||
|
||||
padding: .25rem 0;
|
||||
|
||||
a {
|
||||
text-decoration: none;
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: $phone-max-width) {
|
||||
.post-cover {
|
||||
padding: 10px;
|
||||
border-width: 10px;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
search-modal {
|
||||
--halo-search-widget-base-font-family: var(--font-theme-default) !important;
|
||||
--halo-search-widget-base-bg-color: var(--color-theme-background) !important;
|
||||
--halo-search-widget-primary-color: var(--color-theme-accent) !important;
|
||||
--halo-search-widget-muted-color: var(--color-theme-foreground) !important;
|
||||
--halo-search-widget-content-color: var(--color-theme-accent) !important;
|
||||
--halo-search-widget-hit-bg-color: var(--color-theme-background) !important;
|
||||
--halo-search-widget-modal-bg-color: var(--color-theme-background) !important;
|
||||
--halo-search-widget-modal-layer-color: #000000cc !important;
|
||||
--halo-search-widget-divider-color: var(--color-theme-accent) !important;
|
||||
--halo-search-widget-kbd-border-color: var(--color-theme-accent) !important;
|
||||
--halo-search-widget-kbd-shadow: none !important;
|
||||
--halo-search-widget-color-form-input-bg: var(--color-theme-background) !important;
|
||||
--halo-search-widget-color-form-input: var(--color-theme-foreground);
|
||||
--halo-search-widget-color-form-input-placeholder: var(--color-theme-accent) !important;
|
||||
--halo-search-widget-color-form-divider: var(--color-theme-accent) !important;
|
||||
--halo-search-widget-color-result-empty: var(--color-theme-accent) !important;
|
||||
--halo-search-widget-color-result-item-bg: var(--color-theme-background) !important;
|
||||
--halo-search-widget-color-result-item-hover-bg: var(--color-theme-background) !important;
|
||||
--halo-search-widget-color-result-item-title: var(--color-theme-accent) !important;
|
||||
--halo-search-widget-color-result-item-content: var(--color-theme-accent) !important;
|
||||
--halo-search-widget-color-command-kbd-item: var(--color-theme-accent) !important;
|
||||
--halo-search-widget-color-command-kbd-borde: var(--color-theme-accent) !important;
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
@import "buttons";
|
||||
@import "comment";
|
||||
@import "fonts";
|
||||
@import "footer";
|
||||
@import "header";
|
||||
@import "icons";
|
||||
@import "links";
|
||||
@import "main";
|
||||
@import "menu";
|
||||
@import "moment";
|
||||
@import "pagination";
|
||||
@import "post";
|
||||
@import "search";
|
||||
@import "theme";
|
||||
@import "toc";
|
||||
@import "typed-text";
|
||||
@@ -0,0 +1,121 @@
|
||||
html[theme-color-scheme='day'] {
|
||||
--color-theme-background: #f4f4f4;
|
||||
--color-theme-foreground: #3e3e3e;
|
||||
--color-theme-accent: #003e8a;
|
||||
--color-theme-tag: #07962a;
|
||||
--color-theme-title: #003e8a;
|
||||
--color-theme-meta: #2e6cba;
|
||||
--color-theme-framed: #970b16;
|
||||
--color-theme-menu: #3e3e3e;
|
||||
--color-theme-header: #3e3e3e;
|
||||
}
|
||||
|
||||
html[theme-color-scheme='night'] {
|
||||
--color-theme-background: #101216;
|
||||
--color-theme-foreground: #8b949e;
|
||||
--color-theme-accent: #6ca4f8;
|
||||
--color-theme-tag: #56d364;
|
||||
--color-theme-title: #6ca4f8;
|
||||
--color-theme-meta: #6ca4f8;
|
||||
--color-theme-framed: #f78166;
|
||||
--color-theme-menu: #8b949e;
|
||||
--color-theme-header: #8b949e;
|
||||
}
|
||||
|
||||
html[theme-color-scheme='niello'] {
|
||||
--color-theme-background: #1a170f;
|
||||
--color-theme-foreground: #eceae5;
|
||||
--color-theme-accent: #eec35e;
|
||||
--color-theme-tag: #eec35e;
|
||||
--color-theme-title: #eec35e;
|
||||
--color-theme-meta: #eceae5;
|
||||
--color-theme-framed: #eec35e;
|
||||
--color-theme-menu: #eec35e;
|
||||
--color-theme-header: #eec35e;
|
||||
}
|
||||
|
||||
html[theme-color-scheme='matrix'] {
|
||||
--color-theme-background: #000000;
|
||||
--color-theme-foreground: #4eee85;
|
||||
--color-theme-accent: #4eee85;
|
||||
--color-theme-tag: #4eee85;
|
||||
--color-theme-title: #4eee85;
|
||||
--color-theme-meta: #4eee85;
|
||||
--color-theme-framed: #4eee85;
|
||||
--color-theme-menu: #4eee85;
|
||||
--color-theme-header: #4eee85;
|
||||
}
|
||||
|
||||
html[theme-color-scheme='ink'] {
|
||||
--color-theme-background: #000000;
|
||||
--color-theme-foreground: #FFFFFF;
|
||||
--color-theme-accent: #FFFFFF;
|
||||
--color-theme-tag: #FFFFFF;
|
||||
--color-theme-title: #FFFFFF;
|
||||
--color-theme-meta: #FFFFFF;
|
||||
--color-theme-framed: #FFFFFF;
|
||||
--color-theme-menu: #FFFFFF;
|
||||
--color-theme-header: #FFFFFF;
|
||||
}
|
||||
|
||||
html[theme-color-scheme='hopbush'] {
|
||||
--color-theme-background: #fff6f6;
|
||||
--color-theme-foreground: #462d2d;
|
||||
--color-theme-accent: #cc6099;
|
||||
--color-theme-tag: #cc6099;
|
||||
--color-theme-title: #cc6099;
|
||||
--color-theme-meta: #462d2d;
|
||||
--color-theme-framed: #cc6099;
|
||||
--color-theme-menu: #cc6099;
|
||||
--color-theme-header: #cc6099;
|
||||
}
|
||||
|
||||
html[theme-color-scheme='pistachio'] {
|
||||
--color-theme-background: #1d2021;
|
||||
--color-theme-foreground: #ebdbb2;
|
||||
--color-theme-accent: #8ec07c;
|
||||
--color-theme-tag: #8ec07c;
|
||||
--color-theme-title: #8ec07c;
|
||||
--color-theme-meta: #ebdbb2;
|
||||
--color-theme-framed: #8ec07c;
|
||||
--color-theme-menu: #8ec07c;
|
||||
--color-theme-header: #8ec07c;
|
||||
}
|
||||
|
||||
html[theme-color-scheme='blue'] {
|
||||
--color-theme-background: #153489;
|
||||
--color-theme-foreground: #eceae5;
|
||||
--color-theme-accent: #5ea5ee;
|
||||
--color-theme-tag: #5ea5ee;
|
||||
--color-theme-title: #5ea5ee;
|
||||
--color-theme-meta: #eceae5;
|
||||
--color-theme-framed: #5ea5ee;
|
||||
--color-theme-menu: #5ea5ee;
|
||||
--color-theme-header: #5ea5ee;
|
||||
}
|
||||
|
||||
html[theme-color-scheme='vanilla'] {
|
||||
--color-theme-background: #fff4f2;
|
||||
--color-theme-foreground: #424140;
|
||||
--color-theme-accent: #8f6a5e;
|
||||
--color-theme-tag: #8f6a5e;
|
||||
--color-theme-title: #8f6a5e;
|
||||
--color-theme-meta: #424140;
|
||||
--color-theme-framed: #8f6a5e;
|
||||
--color-theme-menu: #8f6a5e;
|
||||
--color-theme-header: #8f6a5e;
|
||||
}
|
||||
|
||||
html[theme-color-scheme='studio'] {
|
||||
--color-theme-background: #f7f4ff;
|
||||
--color-theme-foreground: #403352;
|
||||
--color-theme-accent: #6f49ab;
|
||||
--color-theme-tag: #6f49ab;
|
||||
--color-theme-title: #6f49ab;
|
||||
--color-theme-meta: #403352;
|
||||
--color-theme-framed: #6f49ab;
|
||||
--color-theme-menu: #6f49ab;
|
||||
--color-theme-header: #6f49ab;
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,73 @@
|
||||
.toc {
|
||||
margin-left: 12px;
|
||||
max-height: 60vh;
|
||||
overflow-y: auto;
|
||||
background: var(--color-theme-background);
|
||||
border: 1px solid var(--color-theme-foreground);
|
||||
padding: 12px;
|
||||
position: fixed;
|
||||
display: none;
|
||||
|
||||
&::-webkit-scrollbar {
|
||||
width: 6px;
|
||||
}
|
||||
|
||||
&::-webkit-scrollbar-track {
|
||||
background: transparent;
|
||||
}
|
||||
|
||||
&::-webkit-scrollbar-thumb {
|
||||
background: var(--color-theme-foreground);
|
||||
border-radius: 3px;
|
||||
|
||||
&:hover {
|
||||
background: var(--color-theme-background);
|
||||
}
|
||||
}
|
||||
|
||||
.toc-list {
|
||||
list-style: none;
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.toc-list-item {
|
||||
margin: 4px 0;
|
||||
|
||||
.toc-list {
|
||||
margin-left: 16px;
|
||||
border-left: 1px solid var(--color-theme-foreground);
|
||||
padding-left: 8px;
|
||||
}
|
||||
}
|
||||
|
||||
.toc-link {
|
||||
display: block;
|
||||
padding: 4px 8px;
|
||||
text-decoration: none;
|
||||
color: var(--color-theme-foreground);
|
||||
font-size: 0.875rem;
|
||||
border-radius: 3px;
|
||||
transition: all 0.2s ease;
|
||||
|
||||
&:hover {
|
||||
background: var(--color-theme-background);
|
||||
color: var(--color-theme-accent);
|
||||
}
|
||||
|
||||
&.is-active-link {
|
||||
background: var(--color-theme-background);
|
||||
color: var(--color-theme-accent);
|
||||
font-weight: bold;
|
||||
position: relative;
|
||||
}
|
||||
}
|
||||
|
||||
.is-active-li {
|
||||
> .toc-link {
|
||||
background: var(--color-theme-background);
|
||||
color: var(--color-theme-accent);
|
||||
font-weight: bold;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
.typed-text {
|
||||
color: var(--color-theme-framed);
|
||||
}
|
||||
|
||||
.typed-text::after {
|
||||
content: '|';
|
||||
display: inline-block;
|
||||
opacity: 0;
|
||||
animation: blink 0.7s infinite alternate;
|
||||
vertical-align: text-bottom;
|
||||
}
|
||||
|
||||
@keyframes blink {
|
||||
to {
|
||||
opacity: 1;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
$phone-max-width: 684px;
|
||||
$phone-min-width: 695px;
|
||||
$tablet-max-width: 899px;
|
||||
@@ -0,0 +1,26 @@
|
||||
export class Terminal {
|
||||
constructor() {
|
||||
this._refreshFunctions = [];
|
||||
this._initFunctions = [];
|
||||
this.initialized = false;
|
||||
}
|
||||
|
||||
registerRefresh(func) {
|
||||
this._refreshFunctions.push(func);
|
||||
}
|
||||
|
||||
registerInitFunc(func) {
|
||||
this._initFunctions.push(func);
|
||||
}
|
||||
|
||||
refresh() {
|
||||
if (!this.initialized) {
|
||||
this._initFunctions.forEach(func => func());
|
||||
this.initialized = true;
|
||||
}
|
||||
this._refreshFunctions.forEach(func => func());
|
||||
}
|
||||
}
|
||||
|
||||
export var terminal = new Terminal();
|
||||
window.terminal = terminal;
|
||||
@@ -0,0 +1,43 @@
|
||||
<!DOCTYPE html>
|
||||
<html
|
||||
xmlns:th="https://www.thymeleaf.org"
|
||||
th:replace="~{modules/layout :: html(title = |#{page.archives.title} - ${site.title}|, header = null, content = ~{::content}, footer = null)}"
|
||||
>
|
||||
<th:block th:fragment="content">
|
||||
<article class="post">
|
||||
<header>
|
||||
<h1 class="post-title">Archives</h1>
|
||||
</header>
|
||||
<section>
|
||||
<th:block th:each="archive : ${archives.items}">
|
||||
<ul>
|
||||
<th:block th:each="month : ${archive.months}">
|
||||
<li class="post-list" th:each="post : ${month.posts}">
|
||||
<a data-pjax th:href="@{${post.status.permalink}}">
|
||||
<span th:text="${#dates.format(post.spec.publishTime,'yyyy-MM-dd')}">Publish Time</span>
|
||||
<span> :: </span>
|
||||
<span class="post-list-title" th:text="${post.spec.title}">Post Title</span>
|
||||
</a>
|
||||
</li>
|
||||
</th:block>
|
||||
</ul>
|
||||
</th:block>
|
||||
</section>
|
||||
</article>
|
||||
<div class="pagination" th:if="${archives.hasPrevious() || archives.hasNext()}">
|
||||
<div class="pagination__buttons">
|
||||
<span th:if="${archives.hasPrevious()}">
|
||||
<a data-pjax th:href="@{${archives.prevUrl}}" class="button prev inline">
|
||||
<span class="button__text">< Prev</span>
|
||||
</a>
|
||||
</span>
|
||||
<span th:if="${archives.hasNext()}">
|
||||
<a data-pjax th:href="@{${archives.nextUrl}}" class="button next inline">
|
||||
<span class="button__text">Next</span>
|
||||
<span class="button__icon"> ></span>
|
||||
</a>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</th:block>
|
||||
</html>
|
||||
@@ -0,0 +1,18 @@
|
||||
<!DOCTYPE html>
|
||||
<html
|
||||
xmlns:th="https://www.thymeleaf.org"
|
||||
th:replace="~{modules/layout :: html(title = |#{page.categories.title} - ${site.title}|, header = null, content = ~{::content}, footer = null)}"
|
||||
>
|
||||
<th:block th:fragment="content">
|
||||
<article class="post">
|
||||
<header>
|
||||
<h1 class="post-title">Categories</h1>
|
||||
</header>
|
||||
<section class="post-content">
|
||||
<ul>
|
||||
<li th:replace="~{modules/category-tree :: single(categories=${categories})}"></li>
|
||||
</ul>
|
||||
</section>
|
||||
</article>
|
||||
</th:block>
|
||||
</html>
|
||||
@@ -0,0 +1,42 @@
|
||||
<!DOCTYPE html>
|
||||
<html
|
||||
xmlns:th="https://www.thymeleaf.org"
|
||||
th:replace="~{modules/layout :: html(title = |#{page.category.title(${category.spec.displayName})} - ${site.title}|, header = null, content = ~{::content}, footer = null)}"
|
||||
>
|
||||
<th:block th:fragment="content">
|
||||
<article class="post">
|
||||
<header>
|
||||
<h1
|
||||
class="post-title"
|
||||
th:text="'Category: '+${category.spec.displayName}+' ['+${category.status.visiblePostCount?:0}+']'">
|
||||
Category: Category name [n]
|
||||
</h1>
|
||||
</header>
|
||||
<section class="post-content">
|
||||
<ul>
|
||||
<li class="post-list" th:each="post : ${posts.items}">
|
||||
<a data-pjax th:href="@{${post.status.permalink}}">
|
||||
<span th:text="${#dates.format(post.spec.publishTime,'yyyy-MM-dd')}">Publish Time</span>
|
||||
<span> :: </span>
|
||||
<span class="post-list-title" th:text="${post.spec.title}">Post Title</span>
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</section>
|
||||
</article>
|
||||
<section class="pagination" th:if="${posts.hasPrevious() || posts.hasNext()}">
|
||||
<div class="pagination__buttons" th:with="postCursor=${postFinder.cursor(post.metadata?.name)}">
|
||||
<span th:if="${postCursor.hasPrevious()}">
|
||||
<a data-pjax th:href="@{${postCursor.previous?.status?.permalink}}" class="button prev inline">
|
||||
<span class="button__text" th:text="|< ${postCursor.previous?.spec?.title}|">prevPost</span>
|
||||
</a>
|
||||
</span>
|
||||
<span th:if="${postCursor.hasNext()}">
|
||||
<a data-pjax th:href="@{${postCursor.next?.status?.permalink}}" class="button next inline">
|
||||
<span class="button__text" th:text="|${postCursor.next?.spec?.title} >|">nextPost</span>
|
||||
</a>
|
||||
</span>
|
||||
</div>
|
||||
</section>
|
||||
</th:block>
|
||||
</html>
|
||||
@@ -0,0 +1,19 @@
|
||||
<!doctype html>
|
||||
<html
|
||||
xmlns:th="https://www.thymeleaf.org"
|
||||
th:replace="~{modules/layout :: html(title = |${singlePage.spec.title} - ${site.title}|, header = null, content = ~{::content}, footer = null)}"
|
||||
>
|
||||
<th:block th:fragment="content">
|
||||
<div class="content">
|
||||
<div class="post">
|
||||
<h1 class="post-title" th:text="${error.title}">404</h1>
|
||||
<div class="post-content">
|
||||
<p th:text="${error?.detail}"></p>
|
||||
</div>
|
||||
<button th:onclick="'location.href=\'' + @{/} + '\''">
|
||||
Back to home page
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</th:block>
|
||||
</html>
|
||||
@@ -0,0 +1,19 @@
|
||||
<!doctype html>
|
||||
<html
|
||||
xmlns:th="https://www.thymeleaf.org"
|
||||
th:replace="~{modules/layout :: html(title = |${singlePage.spec.title} - ${site.title}|, header = null, content = ~{::content}, footer = null)}"
|
||||
>
|
||||
<th:block th:fragment="content">
|
||||
<div class="content">
|
||||
<div class="post">
|
||||
<h1 class="post-title" th:text="${error.title}">5xx</h1>
|
||||
<div class="post-content">
|
||||
<p th:text="${error?.detail}"></p>
|
||||
</div>
|
||||
<button th:onclick="'location.href=\'' + @{/} + '\''">
|
||||
Back to home page
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</th:block>
|
||||
</html>
|
||||
@@ -0,0 +1,63 @@
|
||||
<!DOCTYPE html>
|
||||
<html
|
||||
xmlns:th="https://www.thymeleaf.org"
|
||||
th:replace="~{modules/layout :: html(title = ${site.title}, header = null, content = ~{::content}, footer = null)}"
|
||||
>
|
||||
<th:block th:fragment="content">
|
||||
<section class="index-content framed">
|
||||
<h1 class="typed-text" th:text="${theme.config.basic.index_notice_title}"></h1>
|
||||
<div th:utext="${theme.config.basic.index_notice_content}"></div>
|
||||
</section>
|
||||
<section class="posts">
|
||||
<article class="post on-list" th:each="post : ${posts.items}">
|
||||
<header>
|
||||
<h1 class="post-title">
|
||||
<a data-pjax th:text="${post.spec.title}" th:href="@{${post.status.permalink}}">Post Title</a>
|
||||
</h1>
|
||||
<div class="post-meta">
|
||||
<span class="post-date" th:text="${#dates.format(post.spec.publishTime,'yyyy-MM-dd')}">
|
||||
Publish Time
|
||||
</span>
|
||||
<span
|
||||
class="post-author"
|
||||
th:with="contributor = ${post.contributors[0]}"
|
||||
th:text="${contributor.displayName}"
|
||||
>Author</span
|
||||
>
|
||||
</div>
|
||||
<span class="post-tags">
|
||||
<span class="post-tag" th:each="tag : ${post.tags}">
|
||||
<a data-pjax
|
||||
th:href="@{${tag.status.permalink}}"
|
||||
th:title="${tag.spec.displayName}"
|
||||
th:text="'#'+${tag.spec.displayName}"
|
||||
>#Tag
|
||||
</a>
|
||||
</span>
|
||||
</span>
|
||||
</header>
|
||||
<section class="post-content">
|
||||
<p th:text="${post.status.excerpt}">Post Excerpt...</p>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<a data-pjax class="read-more button inline" th:href="@{${post.status.permalink}}">[Read more]</a>
|
||||
</section>
|
||||
</article>
|
||||
</section>
|
||||
<section class="pagination" th:if="${posts.hasPrevious() || posts.hasNext()}">
|
||||
<div class="pagination__buttons">
|
||||
<span th:if="${posts.hasPrevious()}">
|
||||
<a data-pjax th:href="@{${posts.prevUrl}}" class="button inline prev">
|
||||
<span class="button__text">< Prev</span>
|
||||
</a>
|
||||
</span>
|
||||
<span th:if="${posts.hasNext()}">
|
||||
<a data-pjax th:href="@{${posts.nextUrl}}" class="button inline next">
|
||||
<span class="button__text">Next ></span>
|
||||
</a>
|
||||
</span>
|
||||
</div>
|
||||
</section>
|
||||
</th:block>
|
||||
</html>
|
||||
@@ -0,0 +1,39 @@
|
||||
<!DOCTYPE html>
|
||||
<html xmlns:th="https://www.thymeleaf.org"
|
||||
th:replace="~{modules/layout :: html(title = |#{page.links.title} - ${site.title}|, header = null, content = ~{::content}, footer = null)}">
|
||||
<th:block th:fragment="content">
|
||||
<article class="post">
|
||||
<header>
|
||||
<h1 class="post-title">Links</h1>
|
||||
</header>
|
||||
<section class="post-content link-section" th:each="group : ${groups}">
|
||||
<h2 th:text="${!#strings.isEmpty(group.spec.displayName) ? group.spec.displayName:'links'}">
|
||||
Links
|
||||
</h2>
|
||||
<table class="link-table">
|
||||
<tbody>
|
||||
<tr th:each="link : ${group.links}">
|
||||
<td>
|
||||
<a th:href="${link.spec.url}" target="_blank" class="link-item">
|
||||
<div class="link-container">
|
||||
<div>
|
||||
<img class="link-logo" src="" th:src="${link.spec.logo}"
|
||||
th:alt="${link.spec.displayName}">
|
||||
</div>
|
||||
<div class="link-content">
|
||||
<div class="link-title">
|
||||
<span th:text="${link.spec.displayName}"></span>
|
||||
<span class="link-url" th:text="|(${link.spec.url})|"></span>
|
||||
</div>
|
||||
<div class="link-description" th:text="${link.spec.description}"></div>
|
||||
</div>
|
||||
</div>
|
||||
</a>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</section>
|
||||
</article>
|
||||
</th:block>
|
||||
</html>
|
||||
@@ -0,0 +1,11 @@
|
||||
<ul th:fragment="next (categories)">
|
||||
<li th:fragment="single (categories)" th:each="category : ${categories}">
|
||||
<a th:href="@{${category.status.permalink}}">
|
||||
<span th:text="${category.spec.displayName}"></span>
|
||||
</a>
|
||||
<span th:text="' ['+${category.status.visiblePostCount?:0}+']'"></span>
|
||||
<th:block th:if="${not #lists.isEmpty(category.children)}">
|
||||
<th:block th:replace="~{modules/category-tree :: next (categories=${category.children})}"></th:block>
|
||||
</th:block>
|
||||
</li>
|
||||
</ul>
|
||||
@@ -0,0 +1,37 @@
|
||||
<th:block th:fragment="footer">
|
||||
<halo:footer/>
|
||||
<div class="footer-inner">
|
||||
<section class="footer-copyright-engine">
|
||||
<span>Powered by </span>
|
||||
<span>
|
||||
<a target="_blank" href="http://www.halo.run">Halo</a>
|
||||
</span>
|
||||
<span> :: </span>
|
||||
<span>Theme </span>
|
||||
<a href="https://github.com/Erzbir/halo-theme-terminal">Terminal</a>
|
||||
</section>
|
||||
<section class="footer-copyright-site">
|
||||
<div class="footer-user">
|
||||
<span>© </span>
|
||||
<span th:text="${#dates.year(#dates.createNow())}">2025</span>
|
||||
<span> </span>
|
||||
<span th:text="${site.title}"></span>
|
||||
</div>
|
||||
<div class="footer-icp">
|
||||
<p>
|
||||
<span th:if="${not #strings.isEmpty(theme.config.icp.icp_text)}">
|
||||
<a target="_blank" href="https://beian.miit.gov.cn/"
|
||||
th:href="${theme.config.icp.icp_link}"
|
||||
th:text="${theme.config.icp.icp_text}"></a>
|
||||
</span>
|
||||
<span th:if="${not #strings.isEmpty(theme.config.icp.filing_text)}">
|
||||
<a target="_blank" href="https://www.beian.gov.cn/"
|
||||
th:href="${theme.config.icp.filing_link}"
|
||||
th:text="${theme.config.icp.filing_text}"></a>
|
||||
</span>
|
||||
</p>
|
||||
</div>
|
||||
|
||||
</section>
|
||||
</div>
|
||||
</th:block>
|
||||
@@ -0,0 +1,84 @@
|
||||
<th:block th:fragment="header" th:with="menu = ${menuFinder.getPrimary()}">
|
||||
<div class="header__inner">
|
||||
<div class="header__logo">
|
||||
<a data-pjax href="/">
|
||||
<div class="logo" th:text="${site.title}">Blog Title</div>
|
||||
</a>
|
||||
</div>
|
||||
<button
|
||||
id="search-button"
|
||||
type="button"
|
||||
th:if="${pluginFinder.available('PluginSearchWidget')}"
|
||||
onclick="SearchWidget.open()">
|
||||
<svg class="icon-regular" xmlns="http://www.w3.org/2000/svg" width="1.5rem" height="1.5rem"
|
||||
viewBox="0 0 24 24">
|
||||
<path
|
||||
fill="currentColor"
|
||||
d="m19.6 21l-6.3-6.3q-.75.6-1.725.95T9.5 16q-2.725 0-4.612-1.888T3 9.5q0-2.725 1.888-4.612T9.5 3q2.725 0 4.612 1.888T16 9.5q0 1.1-.35 2.075T14.7 13.3l6.3 6.3l-1.4 1.4ZM9.5 14q1.875 0 3.188-1.313T14 9.5q0-1.875-1.313-3.188T9.5 5Q7.625 5 6.312 6.313T5 9.5q0 1.875 1.313 3.188T9.5 14Z"
|
||||
/>
|
||||
</svg>
|
||||
<svg class="icon-pixel" xmlns="http://www.w3.org/2000/svg" width="1.5rem" height="1.5rem"
|
||||
viewBox="0 0 24 24">
|
||||
<path fill="currentColor"
|
||||
d="M6 2h8v2H6zM4 6V4h2v2zm0 8H2V6h2zm2 2H4v-2h2zm8 0v2H6v-2zm2-2h-2v2h2v2h2v2h2v2h2v-2h-2v-2h-2v-2h-2zm0-8h2v8h-2zm0 0V4h-2v2z"/>
|
||||
</svg>
|
||||
</button>
|
||||
<button id="theme-toggle" type="button">
|
||||
<svg
|
||||
class="icon-regular"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
style="vertical-align: -0.125em"
|
||||
width="1.5rem"
|
||||
height="1.5rem"
|
||||
preserveAspectRatio="xMidYMid meet"
|
||||
viewBox="0 0 24 24"
|
||||
>
|
||||
<path
|
||||
fill="currentColor"
|
||||
d="M7.5 2c-1.79 1.15-3 3.18-3 5.5s1.21 4.35 3.03 5.5C4.46 13 2 10.54 2 7.5A5.5 5.5 0 0 1 7.5 2m11.57 1.5l1.43 1.43L4.93 20.5L3.5 19.07L19.07 3.5m-6.18 2.43L11.41 5L9.97 6l.42-1.7L9 3.24l1.75-.12l.58-1.65L12 3.1l1.73.03l-1.35 1.13l.51 1.67m-3.3 3.61l-1.16-.73l-1.12.78l.34-1.32l-1.09-.83l1.36-.09l.45-1.29l.51 1.27l1.36.03l-1.05.87l.4 1.31M19 13.5a5.5 5.5 0 0 1-5.5 5.5c-1.22 0-2.35-.4-3.26-1.07l7.69-7.69c.67.91 1.07 2.04 1.07 3.26m-4.4 6.58l2.77-1.15l-.24 3.35l-2.53-2.2m4.33-2.7l1.15-2.77l2.2 2.54l-3.35.23m1.15-4.96l-1.14-2.78l3.34.24l-2.2 2.54M9.63 18.93l2.77 1.15l-2.53 2.19l-.24-3.34Z"
|
||||
/>
|
||||
</svg>
|
||||
<svg
|
||||
class="icon-pixel"
|
||||
xmlns="http://www.w3.org/2000/svg" width="1.5rem" height="1.5rem" viewBox="0 0 24 24">
|
||||
<path fill="currentColor"
|
||||
d="M11 0h2v4h-2zm1 12H8v2H4v2H2v4h2v2h10v-2h2v-4h-2v-2h-2zm0 2v2h2v4H4v-4h4v2h2v-2H8v-2zM8 6h6v2H8zm0 2v2H6V8zm8 2h-2V8h2zm0 0h2v2h-2zm4-8h2v2h-2zm0 2v2h-2V4zM2 2h2v2H2zm2 2h2v2H4zm20 7h-4v2h4z"/>
|
||||
</svg>
|
||||
</button>
|
||||
<button id="pixel-toggle" type="button">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="1.5rem" height="1.5rem" viewBox="0 0 24 24">
|
||||
<path fill="currentColor"
|
||||
d="M22 17h2v2h-2Zm-1 2h1v2h-1Zm1-6V9h1V6h-4v3h2v4h1zm-3 8h2v1h-2Zm0-8h2v1h-2Zm-1 9h1v2h-1Zm0-8h1v1h-1Zm-1 1h1v1h-1Zm-1 1h1v8h-1Zm1-3V3h1V0h-3v3h1v10ZM16 1h1v1h-1Zm-1 12h1v1h-1Zm-1 1h1v10h-1Zm-4-3h1v13h2V11h1V8h-4v3zm-1 3h1v10H9Zm-1-1h1v1H8Zm-1 5h1v6H7ZM8 7h1V3H6v4h1v6h1V7zM6 17h1v1H6Zm-1 5h1v2H5Zm0-6h1v1H5Zm1-1v-4H2v4h1v1h2v-1Zm-3-1v-1h2v1Zm0 7h2v1H3Zm-1-2h1v2H2Zm-2-2h2v2H0Z"/>
|
||||
</svg>
|
||||
</button>
|
||||
</div>
|
||||
<nav class="navigation-menu">
|
||||
<ul th:if="${menu != null} and ${not #lists.isEmpty(menu.menuItems)}"
|
||||
class="navigation-menu__inner menu--desktop">
|
||||
<li th:each="menuItem : ${menu.menuItems}">
|
||||
<div th:if="${#lists.isEmpty(menuItem.children)}">
|
||||
<a data-pjax th:href="@{${menuItem.status.href}}"
|
||||
th:text="${menuItem.status.displayName}"></a>
|
||||
</div>
|
||||
|
||||
<div th:if="${not #lists.isEmpty(menuItem.children)}" class="menu">
|
||||
<a data-pjax th:href="@{${menuItem.status.href}}">
|
||||
<span th:text="${menuItem.status.displayName}"></span>
|
||||
</a>
|
||||
<div class="sub-menu">
|
||||
<div class="menu__trigger">▾</div>
|
||||
<ul class="menu__dropdown">
|
||||
<li th:each="childMenuItem : ${menuItem.children}">
|
||||
<a data-pjax
|
||||
th:href="@{${childMenuItem.status.href}}">
|
||||
<span th:text="${childMenuItem.status.displayName}"></span>
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
</th:block>
|
||||
|
||||
@@ -0,0 +1,39 @@
|
||||
<!DOCTYPE html>
|
||||
<html
|
||||
xmlns:th="https://www.thymeleaf.org"
|
||||
th:lang="${#locale.toLanguageTag}"
|
||||
th:fragment="html (header, content, footer)"
|
||||
lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8"/>
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
|
||||
<title th:text="${title}"></title>
|
||||
<script no-pjax th:inline="javascript">
|
||||
const dark_theme = /*[[${theme.config.style.dark_color_schema}]]*/;
|
||||
const light_theme = /*[[${theme.config.style.light_color_schema}]]*/;
|
||||
const default_mode = /*[[${theme.config.style.default_schema_mode}]]*/;
|
||||
const pixel_status = /*[[${theme.config.style.pixel_style}]]*/;
|
||||
</script>
|
||||
<link no-pjax rel="stylesheet" th:href="@{/assets/dist/main.css?v={version}(version=${theme.spec.version})}"/>
|
||||
<script no-pjax type="module" th:src="@{/assets/dist/main.js?v={version}(version=${theme.spec.version})}"></script>
|
||||
<script no-pjax type="module" th:if="${theme.config.basic.pjax}"
|
||||
th:src="@{/assets/dist/libs/pjax.js?v={version}(version=${theme.spec.version})}"></script>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<section class="center container">
|
||||
<header class="header">
|
||||
<th:block th:replace="~{modules/header :: header(isHome = true)}"/>
|
||||
</header>
|
||||
<main>
|
||||
<div class="content">
|
||||
<th:block th:replace="${content}"/>
|
||||
</div>
|
||||
</main>
|
||||
</section>
|
||||
<footer class="footer">
|
||||
<th:block th:replace="~{modules/footer}"/>
|
||||
</footer>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,59 @@
|
||||
<!DOCTYPE html>
|
||||
<html
|
||||
xmlns:th="https://www.thymeleaf.org"
|
||||
th:replace="~{modules/layout :: html(title = |#{page.moments.title} - ${site.title}|, header = null, content = ~{::content}, footer = null)}"
|
||||
>
|
||||
<th:block th:fragment="content">
|
||||
<article
|
||||
class="moment on-list post"
|
||||
th:each="moment,iterStat : ${moments.items}"
|
||||
th:with="content=${moment.spec.content}"
|
||||
th:attr="x-data=|{name:'${moment.metadata.name}',showComment:false}|">
|
||||
<header>
|
||||
<div class="post-meta">
|
||||
<span class="post-date" th:text="${#dates.format(moment.spec.releaseTime,'yyyy-MM-dd')}">
|
||||
Moment CreateTime
|
||||
</span>
|
||||
<span class="post-author" th:with="owner = ${moment.owner}" th:text="${owner.displayName}">
|
||||
Author
|
||||
</span>
|
||||
</div>
|
||||
</header>
|
||||
<section class="post-content" th:utext="${content.html}">Moment Content...</section>
|
||||
<th:block th:with="medium=${moment.spec.content.medium}">
|
||||
<div
|
||||
th:unless="${#lists.isEmpty(moments)}"
|
||||
class="moment-media"
|
||||
th:classappend="${(#lists.size(medium) > 4 ? 'grid-cols-3' : '') + (#lists.size(medium) == 1 ? 'grid-cols-1' :'') + ((#lists.size(medium) > 1 && #lists.size(medium) < 5) ? 'grid-cols-2' :'')}"
|
||||
>
|
||||
<div class="" th:each="media : ${medium}">
|
||||
<a th:class="|glightbox|" th:data-gallery="|gallery${iterStat.count}|" th:href="${media.url}">
|
||||
<img
|
||||
th:if="${#strings.equals(media.type,'PHOTO')}"
|
||||
class="transform-gpu rounded-lg object-cover"
|
||||
th:src="${media.url}"
|
||||
/>
|
||||
</a>
|
||||
<div th:if="${#strings.equals(media.type,'VIDEO')}">
|
||||
<video controls th:src="${media.url}"></video>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</th:block>
|
||||
</article>
|
||||
<section class="pagination" th:if="${moments.hasPrevious() || moments.hasNext()}">
|
||||
<div class="pagination__buttons">
|
||||
<span th:if="${moments.hasPrevious()}">
|
||||
<a data-pjax th:href="@{${moments.prevUrl}}" class="button inline prev">
|
||||
<span class="button__text">< Prev</span>
|
||||
</a>
|
||||
</span>
|
||||
<span th:if="${moments.hasNext()}">
|
||||
<a data-pjax th:href="@{${moments.nextUrl}}" class="button inline next">
|
||||
<span class="button__text">Next </span>
|
||||
</a>
|
||||
</span>
|
||||
</div>
|
||||
</section>
|
||||
</th:block>
|
||||
</html>
|
||||
@@ -0,0 +1,20 @@
|
||||
<!DOCTYPE html>
|
||||
<html
|
||||
xmlns:th="https://www.thymeleaf.org"
|
||||
th:replace="~{modules/layout :: html(title = |${singlePage.spec.title} - ${site.title}|, header = null, content = ~{::content}, footer = null)}"
|
||||
>
|
||||
<th:block th:fragment="content">
|
||||
<article class="post">
|
||||
<header>
|
||||
<h1 class="post-title" th:text="${singlePage.spec.title}">Post Title</h1>
|
||||
</header>
|
||||
<section class="post-content">
|
||||
<div th:utext="${singlePage.content.content}">Post Content</div>
|
||||
</section>
|
||||
</article>
|
||||
<section class="comment" th:if="${haloCommentEnabled}">
|
||||
<h2>Comments</h2>
|
||||
<halo:comment group="content.halo.run" kind="SinglePage" th:attr="name=${singlePage.metadata.name}"/>
|
||||
</section>
|
||||
</th:block>
|
||||
</html>
|
||||
@@ -0,0 +1,54 @@
|
||||
<!DOCTYPE html>
|
||||
<html
|
||||
xmlns:th="https://www.thymeleaf.org"
|
||||
th:replace="~{modules/layout :: html(title = |${post.spec.title} - ${site.title}|, header = null, content = ~{::content}, footer = null)}"
|
||||
>
|
||||
<th:block th:fragment="content">
|
||||
<article class="post">
|
||||
<header>
|
||||
<h1 class="post-title" th:text="${post.spec.title}">Post Title</h1>
|
||||
<div class="post-meta">
|
||||
<span class="post-date"
|
||||
th:text="${#dates.format(post.spec.publishTime,'yyyy-MM-dd')}">Publish Time</span>
|
||||
<span class="post-author" th:text="${post.owner.displayName}">Author</span>
|
||||
</div>
|
||||
<span class="post-tags">
|
||||
<span class="post-tag" th:each="tag : ${post.tags}">
|
||||
<a data-pjax
|
||||
th:href="@{${tag.status.permalink}}"
|
||||
th:title="${tag.spec.displayName}"
|
||||
th:text="'#'+${tag.spec.displayName}"
|
||||
>#Tag
|
||||
</a>
|
||||
</span>
|
||||
</span>
|
||||
</header>
|
||||
<section class="post-content">
|
||||
<div th:utext="${post.content.content}" id="content">Post Content</div>
|
||||
</section>
|
||||
</article>
|
||||
<section class="toc" th:if="${theme.config.basic.show_toc}"></section>
|
||||
<section class="pagination">
|
||||
<div class="pagination__title">
|
||||
<span class="pagination__title-h">Read other posts</span>
|
||||
<hr/>
|
||||
</div>
|
||||
<div class="pagination__buttons" th:with="postCursor=${postFinder.cursor(post.metadata?.name)}">
|
||||
<span th:if="${postCursor.hasPrevious()}">
|
||||
<a data-pjax th:href="@{${postCursor.previous?.status?.permalink}}" class="button prev inline">
|
||||
<span class="button__text" th:text="|< ${postCursor.previous?.spec?.title}|">prevPost</span>
|
||||
</a>
|
||||
</span>
|
||||
<span th:if="${postCursor.hasNext()}">
|
||||
<a data-pjax th:href="@{${postCursor.next?.status?.permalink}}" class="button next inline">
|
||||
<span class="button__text" th:text="|${postCursor.next?.spec?.title} >|">nextPost</span>
|
||||
</a>
|
||||
</span>
|
||||
</div>
|
||||
</section>
|
||||
<section class="comment" th:if="${haloCommentEnabled}">
|
||||
<h2>Comments</h2>
|
||||
<halo:comment group="content.halo.run" kind="Post" th:attr="name=${post.metadata.name}"/>
|
||||
</section>
|
||||
</th:block>
|
||||
</html>
|
||||
@@ -0,0 +1,41 @@
|
||||
<!DOCTYPE html>
|
||||
<html
|
||||
xmlns:th="https://www.thymeleaf.org"
|
||||
th:replace="~{modules/layout :: html(title = |#{page.tag.title(${tag.spec.displayName})} - ${site.title}|, header = null, content = ~{::content}, footer = null)}"
|
||||
>
|
||||
<th:block th:fragment="content">
|
||||
<article class="post">
|
||||
<header>
|
||||
<h1 class="post-title"
|
||||
th:text="'Tag:'+${tag.spec.displayName}+' ['+${tag.status.visiblePostCount?:0}+']'">
|
||||
Tag: [n]
|
||||
</h1>
|
||||
</header>
|
||||
<section class="post-content">
|
||||
<ul>
|
||||
<li class="post-list" th:each="post : ${posts.items}">
|
||||
<a data-pjax th:href="@{${post.status.permalink}}">
|
||||
<span th:text="${#dates.format(post.spec.publishTime,'yyyy-MM-dd')}">Publish Time</span>
|
||||
<span> :: </span>
|
||||
<span class="post-list-title" th:text="${post.spec.title}">Post Title</span>
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</section>
|
||||
</article>
|
||||
<section class="pagination" th:if="${posts.hasPrevious() || posts.hasNext()}">
|
||||
<div class="pagination__buttons">
|
||||
<span th:if="${posts.hasPrevious()}">
|
||||
<a data-pjax th:href="@{${posts.prevUrl}}" class="button inline prev">
|
||||
<span class="button__text">< Prev</span>
|
||||
</a>
|
||||
</span>
|
||||
<span th:if="${posts.hasNext()}">
|
||||
<a data-pjax th:href="@{${posts.nextUrl}}" class="button inline next">
|
||||
<span class="button__text">Next ></span>
|
||||
</a>
|
||||
</span>
|
||||
</div>
|
||||
</section>
|
||||
</th:block>
|
||||
</html>
|
||||
@@ -0,0 +1,23 @@
|
||||
<!DOCTYPE html>
|
||||
<html
|
||||
xmlns:th="https://www.thymeleaf.org"
|
||||
th:replace="~{modules/layout :: html(title = |#{page.tags.title} - ${site.title}|, header = null, content = ~{::content}, footer = null)}"
|
||||
>
|
||||
<th:block th:fragment="content">
|
||||
<article class="post">
|
||||
<header>
|
||||
<h1 class="post-title">Tags</h1>
|
||||
</header>
|
||||
<section class="post-content">
|
||||
<ul class="post-tags">
|
||||
<li th:each="tag: ${tags}">
|
||||
<a data-pjax class="post-tag" th:href="@{${tag.status.permalink}}"
|
||||
th:text="${tag.spec.displayName}">
|
||||
</a>
|
||||
<span th:text="' ['+${tag.status.visiblePostCount?:0}+']'"></span>
|
||||
</li>
|
||||
</ul>
|
||||
</section>
|
||||
</article>
|
||||
</th:block>
|
||||
</html>
|
||||
@@ -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"
|
||||