Merge pull request #518 from chengzhongxue/main

移除我的装备模板,改为插件方式
This commit is contained in:
困困鱼 2023-10-13 00:26:24 +08:00 committed by GitHub
commit bd9cb5f8a9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
14 changed files with 117 additions and 99 deletions

View File

@ -135,3 +135,41 @@ spec:
- $formkit: "textarea"
name: "description"
label: "分组描述"
---
apiVersion: v1alpha1
kind: AnnotationSetting
metadata:
generateName: annotation-setting-
spec:
targetRef:
group: core.halo.run
kind: EquipmentGroup
formSchema:
- $formkit: "textarea"
name: "description"
label: "分组描述"
---
apiVersion: v1alpha1
kind: AnnotationSetting
metadata:
generateName: annotation-setting-
spec:
targetRef:
group: core.halo.run
kind: Equipment
formSchema:
- $formkit: "text"
name: "model"
label: "装备型号/版本"
- $formkit: "text"
name: "button"
label: "左下角按钮显示文字"
value: "详情"
- $formkit: "text"
name: "link"
label: "左下角按钮跳转链接"

View File

@ -1,11 +1,11 @@
<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org"
th:replace="~{modules/layouts/layout :: layout(content = ~{::content}, htmlType = 'page',title = ${singlePage.spec.title + ' | ' + site.title}, head = ~{::head})}">
th:replace="~{modules/layouts/layout :: layout(content = ~{::content}, htmlType = 'equipments',title = ${title + ' | ' + site.title}, head = ~{::head},_title = ${title})}">
<th:block th:fragment="head">
<th:block th:replace="~{modules/common/open-graph :: open-graph(_title = ${singlePage.spec.title},
_permalink = ${singlePage.status.permalink},
_cover = ${singlePage.spec.cover},
_excerpt = ${singlePage.status.excerpt},
<th:block th:replace="~{modules/common/open-graph :: open-graph(_title = ${_title},
_permalink = '/equipments',
_cover = ${theme.config.other.opengraph.image},
_excerpt = ${site.seo.description},
_type = 'website')}"></th:block>
</th:block>
<th:block th:fragment="content">
@ -14,7 +14,7 @@
<!-- 头部导航栏 -->
<header class="not-top-img" id="page-header">
<nav th:replace="~{modules/nav :: nav(title = ${singlePage.spec.title})}"></nav>
<nav th:replace="~{modules/nav :: nav(title = ${_title})}"></nav>
</header>
<main class="layout hide-aside" id="content-inner">
<div id="page">
@ -24,36 +24,35 @@
detail = ${theme.config.equipment.detail},
buttonUrl = '',
buttonTitle = '')}" ></div>
<div id="equipment" th:if="${not #lists.isEmpty(theme.config.equipment.category_list)}"
th:with="categoryList = ${theme.config.equipment.category_list}">
<th:block th:each="category : ${categoryList}">
<div id="equipment" th:if="${not #lists.isEmpty(groups)}">
<th:block th:each="group : ${groups}">
<div class="equipment-item">
<h2 class="equipment-item-title">[[${category.category_name}]]</h2>
<div class="equipment-item-description">[[${category.description}]]</div>
<div class="equipment-item-content" th:with="equipmentList = ${category.equipment_list}">
<h2 class="equipment-item-title">[[${group.spec.displayName}]]</h2>
<div class="equipment-item-description">[[${#annotations.get(group, 'description')}]]</div>
<div class="equipment-item-content" th:with="equipmentList = ${group.equipments}">
<div class="equipment-item-content-item" th:each="equipment : ${equipmentList}">
<div class="equipment-item-content-item-cover">
<img class="equipment-item-content-item-image"
th:alt="${equipment.name}"
th:src="${isLazyload ? loadingImg : equipment.img}"
th:data-lazy-src="${ isLazyload ? equipment.img : ''}">
th:alt="${equipment.spec.displayName}"
th:src="${isLazyload ? loadingImg : equipment.spec.url}"
th:data-lazy-src="${ isLazyload ? equipment.spec.url : ''}">
</div>
<div class="equipment-item-content-item-info">
<div class="equipment-item-content-item-name"
th:onclick="rm.rightmenuCopyText([[${equipment.name}]]);btf.snackbarShow('已复制装备名称');">
[[${equipment.name}]]
th:onclick="rm.rightmenuCopyText([[${equipment.spec.displayName}]]);btf.snackbarShow('已复制装备名称');">
[[${equipment.spec.displayName}]]
</div>
<div class="equipment-item-content-item-specification">[[${equipment.model}]]
<div class="equipment-item-content-item-specification">[[${#annotations.get(equipment, 'model')}]]
</div>
<div class="equipment-item-content-item-description">
[[${equipment.description}]]
[[${equipment.spec.description}]]
</div>
<div class="equipment-item-content-item-toolbar">
<a class="equipment-item-content-item-link" th:href="${equipment.url}"
target="_blank">[[${equipment.button}]]</a>
<a class="equipment-item-content-item-link" th:href="${#annotations.get(equipment, 'link')}"
target="_blank">[[${#annotations.get(equipment, 'button')}]]</a>
<a class="bber-reply"
th:onclick="rightMenuCommentText([['&quot;'+${equipment.name}+' '+${equipment.model}+' '+${equipment.description}+'&quot;']]);"
th:onclick="rightMenuCommentText([['&quot;'+${equipment.spec.displayName}+' '+${#annotations.get(equipment, 'model')}+' '+${equipment.spec.description}+'&quot;']]);"
data-pjax-state="">
<i class="haofont hao-icon-message" style="font-size: 17px;"></i>
</a>
@ -197,8 +196,8 @@
<th:block
th:replace="~{modules/comment :: comment(group = 'content.halo.run',
kind = 'SinglePage',
name = ${singlePage.metadata.name},
allowComment = ${singlePage.spec.allowComment})}"/>
name = 'equipment',
allowComment = true)}"/>
</div>
</main>

View File

@ -1,5 +1,5 @@
<!DOCTYPE html>
<html lang="en" th:replace="~{modules/layouts/layout :: layout(content = ~{::content}, htmlType = '404', title = '404')}"
<html lang="en" th:replace="~{modules/layouts/layout :: layout(content = ~{::content}, htmlType = '404', title = '404', head = null)}"
xmlns:th="http://www.thymeleaf.org">
<th:block th:fragment="content">

View File

@ -1,5 +1,5 @@
<!DOCTYPE html>
<html lang="en" th:replace="~{modules/layouts/layout :: layout(content = ~{::content}, htmlType = '500', title = '500')}"
<html lang="en" th:replace="~{modules/layouts/layout :: layout(content = ~{::content}, htmlType = '500', title = '500', head = null)}"
xmlns:th="http://www.thymeleaf.org">
<th:block th:fragment="content">

View File

@ -55,8 +55,8 @@
<div class="title-h2-a-right"><span>以下内容自动生成,未经过审核</span></div>
</div>
<div id="hexo-circle-of-friends-root"></div>
<script>
let UserConfig = {
<script type="text/javascript">
var UserConfig = {
// 填写你的api地址
private_api_url: "[(${theme.config.fcircle.apiurl})]",
// 点击加载更多时一次最多加载几篇文章默认10

View File

@ -5,7 +5,7 @@
<th:block th:replace="~{modules/common/open-graph :: open-graph(_title = ${site.title},
_permalink = '',
_cover = ${theme.config.other.opengraph.image},
_excerpt = '',
_excerpt = ${site.seo.description},
_type = 'website')}"></th:block>
</th:block>
<th:block th:fragment="content">

View File

@ -157,7 +157,7 @@
</script>
<!-- 动态加载条 -->
<script data-pace-options='{ "restartOnRequestAfter":false,"eventLag":false}'
<script data-pace-options="{ &quot;restartOnRequestAfter&quot;:false,&quot;eventLag&quot;:false}"
th:src="${assets_link + '/libs/pace/pace.min.js'}"
th:if="${theme.config.other.loadingBoxs.loadProgressBar}">
</script>
@ -165,10 +165,6 @@
<!-- 复制 https://githubfast.com/zenorocha/clipboard.js -->
<script th:src="${assets_link + '/libs/clipboard/clipboard.min.js'}"></script>
<!-- 全局图片预览-->
<script src="https://lf6-cdn-tos.bytecdntp.com/cdn/expire-1-M/fancybox/3.5.7/jquery.fancybox.min.js"></script>
<link rel="stylesheet" href="https://lf3-cdn-tos.bytecdntp.com/cdn/expire-1-M/fancybox/3.5.7/jquery.fancybox.min.css">
<!-- 关于统计-->
<script th:if="${#strings.contains(theme.config.about.widgets,'statistics-map')}" th:src="${assets_link + '/libs/countup/countup.js'}"></script>

View File

@ -26,7 +26,7 @@
<body>
<!-- loading 页面 -->
<div th:replace="~{modules/loading-box :: loading-box}"></div>
<th:block th:replace="~{modules/loading-box :: loading-box}"></th:block>
<!-- 网站背景 -->
<div id="web_bg"></div>
@ -68,6 +68,21 @@
<!-- todo head 中有它的 css应该可以写一块并改成后台可配置的功能代码中应该还有他的 js -->
<script src="https://lf3-cdn-tos.bytecdntp.com/cdn/expire-1-M/node-snackbar/0.1.16/snackbar.min.js"></script>
<div class="js-pjax">
<!-- 动态标题 -->
<script th:replace="~{modules/common/diytitle :: diytitle}"></script>
</div>
<!-- 评论 -->
<th:block th:if="${theme.config.comments.use!='commentWidget' && theme.config.comments.commentsEnable }"
th:with="use = ${theme.config.comments.use}">
<th:block th:replace="~{'modules/comment/' + ${use}}"></th:block>
<script th:if="${theme.config.comments.visitorMail.visitorMailEnable}">var visitorMail = "[(${theme.config.comments.visitorMail.mail})]";</script>
</th:block>
<!--音乐-->
<script>var meting_api = "[(${theme.config.tool.nav_music.meting_api})]"; </script>
<!-- 深色模式下添加粒子效果canvas -->
<canvas th:if="${theme.config.style.universe}" id="universe" width="1312" height="880"></canvas>
<script th:if="${theme.config.style.universe}" async="" th:src="${assets_link + '/libs/canvas/dark.js'}"></script>
@ -76,12 +91,6 @@
<!-- 应该是文章页分享使用 -->
<script data-pjax src="https://lf3-cdn-tos.bytecdntp.com/cdn/expire-1-M/qrcodejs/1.0.0/qrcode.min.js"></script>
<!-- 评论 -->
<th:block th:if="${theme.config.comments.use!='commentWidget' && theme.config.comments.commentsEnable }"
th:with="use = ${theme.config.comments.use}">
<th:block th:replace="~{'modules/comment/' + ${use}}"></th:block>
<script th:if="${theme.config.comments.visitorMail.visitorMailEnable}">var visitorMail = "[(${theme.config.comments.visitorMail.mail})]";</script>
</th:block>
<!-- https://raphamorim.io/waterfall.js/ 应该是这个 还有相关的 js 代码 是否可以调整-->
<script th:src="${assets_link + '/libs/waterfall/waterfall.min.js'}"></script>
@ -91,9 +100,6 @@
<script th:src="${assets_link + '/libs/view-image/view-image.min.js'}"></script>
<!--音乐-->
<script>var meting_api = "[(${theme.config.tool.nav_music.meting_api})]"; </script>
<link rel="stylesheet" href="https://lf6-cdn-tos.bytecdntp.com/cdn/expire-1-M/aplayer/1.10.1/APlayer.min.css" media="all" onload="this.media='all'">
<script th:src="${assets_link + '/libs/aplayer/APlayer.min.js'}"></script>
@ -125,15 +131,8 @@
<!--官方评论插件js-->
<script th:if="${pluginFinder.available('PluginCommentWidget')}" src="/plugins/PluginCommentWidget/assets/static/comment-widget.iife.js"></script>
<div class="js-pjax">
<!-- 动态标题 -->
<script th:replace="~{modules/common/diytitle :: diytitle}"></script>
</div>
<script th:if="${theme.config.envelope_comment.enable_danmu}" th:src="${assets_link + '/libs/twikoo/easy-Danmaku.min.js'}" id="Danmaku"></script>
<script>
let pjaxSelectors = ['title', '#config-diff', '#body-wrap', '#rightside-config-hide', '#rightside-config-show', '.js-pjax','#site-config']

View File

@ -1,30 +1,9 @@
<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<!-- loading 页面todo 这块都可以不要,后面删除,先精简代码,后续考虑组件添加 -->
<div id="loading-box" onclick="heo.hideLoading()"
th:fragment="loading-box"
th:if="${theme.config.other.loadingBoxs.loadingBoxEnable} and not ${#strings.isEmpty(theme.config.other.loadingBoxs.loadingBoxImg)}">
<!-- loading页面 -->
<th:block th:fragment="loading-box"
th:if="${theme.config.other.loadingBoxs.loadingBoxEnable} and not ${#strings.isEmpty(theme.config.other.loadingBoxs.loadingBoxImg)}">
<style type="text/css">
#loading-box .loading-image-dot {
width: 30px;
height: 30px;
background: #6bdf8f;
position: absolute;
border-radius: 50%;
border: 6px solid #fff;
top: 50%;
left: 50%;
-webkit-transform: translate(18px, 24px);
-moz-transform: translate(18px, 24px);
-o-transform: translate(18px, 24px);
-ms-transform: translate(18px, 24px);
transform: translate(18px, 24px);
}
#loading-box {
-webkit-user-select: none;
}
@ -34,7 +13,7 @@
width: 100%;
height: 100%;
position: fixed;
background: var(--heo-background);
background: var(--heo-card-bg);
z-index: 1999;
opacity: 1;
transition: 0.2s;
@ -57,11 +36,26 @@
animation-direction: alternate;
}
#loading-box .loading-image-dot {
width: 30px;
height: 30px;
background: #6bdf8f;
position: absolute;
border-radius: 50%;
border: 6px solid #fff;
top: 50%;
left: 50%;
-webkit-transform: translate(18px, 24px);
-moz-transform: translate(18px, 24px);
-o-transform: translate(18px, 24px);
-ms-transform: translate(18px, 24px);
transform: translate(18px, 24px);
}
@keyframes loadingAction {
from {
opacity: 1;
}
to {
opacity: 0.6;
}
@ -71,7 +65,6 @@
from {
opacity: 1;
}
to {
opacity: 0;
}
@ -81,20 +74,18 @@
from {
opacity: 0;
}
to {
opacity: 1;
}
}
</style>
<div class="loading-bg">
<img class="loading-img" style="border-radius: 50%;" th:src="${theme.config.other.loadingBoxs.loadingBoxImg}">
<div class="loading-image-dot"></div>
<div id="loading-box" onclick="heo.hideLoading()">
<div class="loading-bg">
<img class="loading-img" style="border-radius: 50%;" th:src="${theme.config.other.loadingBoxs.loadingBoxImg}">
<div class="loading-image-dot"></div>
</div>
</div>
<script>
var preloader = {
endLoading: () => {
//- document.body.style.overflow = 'auto';
@ -109,9 +100,8 @@
setTimeout(function () {
preloader.endLoading();
}, 3000)
</script>
</div>
</th:block>
</html>

View File

@ -13,7 +13,7 @@
th:with="newcommentnumber = ${#conversions.convert(theme.config.sidebar.newcomment.newcommentnumber, 'java.lang.Integer') >= 0 ? theme.config.sidebar.newcommentnumber : 5}">
<div th:each="comment,iterStat : ${commentFinder.list(null, 1, newcommentnumber)}" class="aside-list-item"
th:with="page = ${comment.spec.subjectRef.kind == 'Post' ? postFinder.getByName(comment.spec.subjectRef.name) :
comment.spec.subjectRef.kind == 'SinglePage' && not #strings.contains('photos,links,moments', comment.spec.subjectRef.name) ? singlePageFinder.getByName(comment.spec.subjectRef.name) : null},
comment.spec.subjectRef.kind == 'SinglePage' && not #strings.contains('photos,links,moments,equipment', comment.spec.subjectRef.name) ? singlePageFinder.getByName(comment.spec.subjectRef.name) : null},
url = ${page == null? '/' : page.status.permalink + '#comment-' + comment.metadata.name}">
<span th:text="${commentIndex}"></span>
<a class="thumbnail" th:href="${url}" data-pjax-state="">

View File

@ -1,8 +1,8 @@
<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org"
th:replace="~{modules/layouts/layout :: layout(content = ~{::content}, htmlType = 'moments',title = ${title + ' | ' + site.title}, head = ~{::head})}">
th:replace="~{modules/layouts/layout :: layout(content = ~{::content}, htmlType = 'moments',title = ${title + ' | ' + site.title}, head = ~{::head}, _title = ${title})}">
<th:block th:fragment="head">
<th:block th:replace="~{modules/common/open-graph :: open-graph(_title = '瞬间',
<th:block th:replace="~{modules/common/open-graph :: open-graph(_title = ${_title},
_permalink = '/moments',
_cover = ${theme.config.other.opengraph.image},
_excerpt = ${site.seo.description},
@ -14,7 +14,7 @@
<!-- 头部导航栏 -->
<header class="not-top-img" id="page-header">
<nav th:replace="~{modules/nav :: nav(title = '瞬间')}"></nav>
<nav th:replace="~{modules/nav :: nav(title = ${_title})}"></nav>
</header>
<main class="layout hide-aside" id="content-inner">
<div id="page">

View File

@ -53,7 +53,7 @@
<script data-pjax th:inline="javascript">
var postsData = [[${ postFinder.listAll() }]];
var pageData = [[${ singlePageFinder.list(1, 50) }]];
var articles = [{ path: '/links', title: '友链' }, { path: '/bangumis', title: '追番' }, { path: '/moments', title: '瞬间' }, { path: '/photos', title: '图库' }];
var articles = [{ path: '/links', title: '友链' }, { path: '/bangumis', title: '追番' }, { path: '/equipment', title: '我的装备' }, { path: '/moments', title: '瞬间' }, { path: '/photos', title: '图库' }];
if (postsData.length > 0) {
postsData.map((item) => {

View File

@ -1,8 +1,8 @@
<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org"
th:replace="~{modules/layouts/layout :: layout(content = ~{::content},htmlType = 'photos',title = ${title + ' | ' + site.title}, head = ~{::head})}">
th:replace="~{modules/layouts/layout :: layout(content = ~{::content},htmlType = 'photos',title = ${title + ' | ' + site.title}, head = ~{::head},_title = ${title})}">
<th:block th:fragment="head">
<th:block th:replace="~{modules/common/open-graph :: open-graph(_title = '图库',
<th:block th:replace="~{modules/common/open-graph :: open-graph(_title = ${_title},
_permalink = '/photos',
_cover = ${theme.config.other.opengraph.image},
_excerpt = ${site.seo.description},
@ -13,7 +13,7 @@
<div class="page" id="body-wrap">
<!-- 头部导航栏 -->
<header class="not-top-img" id="page-header">
<nav th:replace="~{modules/nav :: nav(title = '图库')}"></nav>
<nav th:replace="~{modules/nav :: nav(title = ${_title})}"></nav>
</header>
<main class="layout hide-aside" id="content-inner">
<div id="page">

View File

@ -37,10 +37,6 @@ spec:
description: 待办清单页面
screenshot:
file: todolist.html
- name: 我的装备页面模版
description: 我的装备页面
screenshot:
file: equipment.html
- name: 相册页面模版
description: 相册页面
screenshot: