Merge remote-tracking branch 'origin/main' into main

# Conflicts:
#	templates/modules/head.html
This commit is contained in:
1152958806@qq.com 2023-08-24 17:40:42 +08:00
commit 8c7cf5eb17
16 changed files with 223 additions and 77 deletions

View File

@ -47,7 +47,6 @@ spec:
label: 导航栏右侧 label: 导航栏右侧
value: value:
travelling: true travelling: true
travellingUrl: https://travellings.cn/go.html
article: true article: true
darkMode: true darkMode: true
children: children:
@ -61,12 +60,6 @@ spec:
value: true value: true
- label: 隐藏 - label: 隐藏
value: false value: false
- $formkit: url
if: $get(travelling).value
name: travellingUrl
label: 开往链接
placeholder: 请输入开往链接
help: 开往项目https://github.com/travellings-link/travellings
- $formkit: radio - $formkit: radio
name: article name: article
label: 随机文章 label: 随机文章

View File

@ -41,6 +41,9 @@
</div> </div>
<!-- 关于统计-->
<script th:src="${assets_link + '/libs/countup/countup.js' + theme_version}"></script>
<div class="author-content"> <div class="author-content">
<div class="create-site-post author-content-item single" th:utext="${theme.config.about.xjlc}"> <div class="create-site-post author-content-item single" th:utext="${theme.config.about.xjlc}">

View File

@ -192,23 +192,22 @@ var btf = {
} }
}, },
snackbarShow: (text, showAction, duration) => { snackbarShow: (text, showActionFunction = false, duration = 2000, actionText = false) => {
const sa = (typeof showAction !== 'undefined') ? showAction : false const { position, bgLight, bgDark } = GLOBAL_CONFIG.Snackbar;
const dur = (typeof duration !== 'undefined') ? duration : 5000 const bg = document.documentElement.getAttribute("data-theme") === "light" ? bgLight : bgDark;
const position = GLOBAL_CONFIG.Snackbar.position const root = document.querySelector(":root");
const bg = document.documentElement.getAttribute('data-theme') === 'light' ? GLOBAL_CONFIG.Snackbar.bgLight : GLOBAL_CONFIG.Snackbar.bgDark root.style.setProperty("--heo-snackbar-time", duration + "ms");
const style = document.createElement('style');
document.head.appendChild(style);
const styleSheet = style.sheet;
styleSheet.insertRule(`:root{--heo-snackbar-time: ${dur}ms!important}`, styleSheet.cssRules.length);
Snackbar.show({ Snackbar.show({
text: text, text: text,
backgroundColor: bg, backgroundColor: bg,
showAction: sa, onActionClick: showActionFunction,
duration: dur, actionText: actionText,
pos: position showAction: actionText,
}) duration: duration,
pos: position,
customClass: "snackbar-css",
});
}, },
initJustifiedGallery: function (selector) { initJustifiedGallery: function (selector) {

View File

@ -163,16 +163,19 @@ function HaoPostAI(AI_option) {
Referer: Referers Referer: Referers
}; };
var url = window.location.href;
const title = document.title;
const truncateDescription = getTitleAndContent(num); const truncateDescription = getTitleAndContent(num);
const queryParams = `key=${options.key}&content=${truncateDescription}&url=${url}&title=${title}`; const requestBody = {
key: options.key,
content: truncateDescription,
url: location.href,
};
const requestOptions = { const requestOptions = {
method: "GET", method: "POST",
headers: { headers: {
"Content-Type": "application/json", "Content-Type": "application/json",
Referer: options.Referer Referer: options.Referer
}, },
body: JSON.stringify(requestBody),
}; };
try { try {
let animationInterval = null let animationInterval = null
@ -182,7 +185,7 @@ function HaoPostAI(AI_option) {
explanation.innerHTML = animationText; explanation.innerHTML = animationText;
j = (j % 3) + 1; // 在 1、2、3 之间循环 j = (j % 3) + 1; // 在 1、2、3 之间循环
}, 500); }, 500);
const response = await fetch(`https://summary.tianli0.top/?${queryParams}`, requestOptions); const response = await fetch(`https://summary.tianli0.top/`, requestOptions);
let result; let result;
if (response.status === 403) { if (response.status === 403) {
result = { result = {
@ -199,11 +202,16 @@ function HaoPostAI(AI_option) {
setTimeout(() => { setTimeout(() => {
aiTitleRefreshIcon.style.opacity = "1"; aiTitleRefreshIcon.style.opacity = "1";
}, 300) }, 300)
startAI(summary); if (summary) {
startAI(summary);
} else {
startAI("摘要获取失败!!!请检查Tianli服务是否正常!!!");
}
clearInterval(animationInterval) clearInterval(animationInterval)
} catch (error) { } catch (error) {
console.error(error); console.error(error);
explanation.innerHTML = "发生异常" + error;
} }
} else { } else {
const strArr = ai.split(",").map(item => item.trim()); // 将字符串转换为数组,去除每个字符串前后的空格 const strArr = ai.split(",").map(item => item.trim()); // 将字符串转换为数组,去除每个字符串前后的空格
@ -425,4 +433,4 @@ function HaoPostAI(AI_option) {
aiAbstract(); aiAbstract();
showAiBtn() showAiBtn()
} }

View File

@ -435,11 +435,14 @@ function toforeverblog() {
} }
//前往开往项目 //前往开往项目
function totraveling() { function totraveling () {
btf.snackbarShow('即将跳转到「开往」项目的成员博客,不保证跳转网站的安全性和可用性', false, 5000); btf.snackbarShow("即将跳转到「开往」项目的成员博客,不保证跳转网站的安全性和可用性", function(element) {
setTimeout(function () { element.style.opacity = 0,
window.open('https://travellings.link/'); travellingsTimer && clearTimeout(travellingsTimer)
}, "5000"); }, 5000, "取消"),
travellingsTimer = setTimeout(function() {
window.open("https://www.travellings.cn/go.html", "_blank")
}, "5000")
} }
// 移除加载动画 // 移除加载动画
@ -651,24 +654,24 @@ function listenToPageInputPress() {
function initBlog() { function initBlog() {
// 图片主色 // 图片主色
GLOBAL_CONFIG.source.post.dynamicBackground && coverColor(), GLOBAL_CONFIG.source.post.dynamicBackground && coverColor(),
percent(), percent(),
heo.topCategoriesBarScroll(), heo.topCategoriesBarScroll(),
heo.initIndexEssay(), heo.initIndexEssay(),
setBodyDataType(), setBodyDataType(),
listenToPageInputPress(), listenToPageInputPress(),
heo.topPostScroll(), heo.topPostScroll(),
heo.sayhi(), heo.sayhi(),
heo.qrcodeCreate(), heo.qrcodeCreate(),
//右下角 snackbar 弹窗 //右下角 snackbar 弹窗
GLOBAL_CONFIG.source.tool.switch && heo.hidecookie(), GLOBAL_CONFIG.source.tool.switch && heo.hidecookie(),
heo.stopImgRightDrag(), heo.stopImgRightDrag(),
heo.onlyHome(), heo.onlyHome(),
heo.addNavBackgroundInit(), heo.addNavBackgroundInit(),
heo.darkModeStatus(), heo.darkModeStatus(),
heo.initThemeColor(), heo.initThemeColor(),
//隐藏加载动画 //隐藏加载动画
GLOBAL_CONFIG.loadingBox && heo.hideLoading(), GLOBAL_CONFIG.loadingBox && heo.hideLoading(),
checkUrlAndAddHideBanner() checkUrlAndAddHideBanner()
} }

View File

@ -29,6 +29,7 @@
--style-border-hover: 1px solid var(--heo-main); --style-border-hover: 1px solid var(--heo-main);
--style-border-hover-always: 1px solid var(--heo-main); --style-border-hover-always: 1px solid var(--heo-main);
--style-border-dashed: 1px dashed var(--heo-theme-op); --style-border-dashed: 1px dashed var(--heo-theme-op);
--heo-radius-full: 50px;
} }
::selection { ::selection {
@ -2644,6 +2645,115 @@ blockquote footer cite::before {
text-shadow: none; text-shadow: none;
} }
#page-header.not-top-img #travellings_button::after {
background: var(--heo-main)!important;
}
#body-wrap .nav-fixed #travellings_button::after {
background: var(--heo-main)!important
}
#body-wrap #travellings_button {
display: -webkit-box;
display: -moz-box;
display: -webkit-flex;
display: -ms-flexbox;
display: box;
display: flex
}
#body-wrap #travellings_button:hover::after {
opacity: 1;
-ms-filter: none;
filter: none;
-webkit-transform: none;
-moz-transform: none;
-o-transform: none;
-ms-transform: none;
transform: none;
visibility: visible
}
#body-wrap #travellings_button:hover a {
background: var(--heo-main);
-webkit-box-shadow: var(--heo-shadow-main);
-webkit-box-shadow: var(--heo-shadow-main);
box-shadow: var(--heo-shadow-main)
}
#body-wrap #travellings_button:hover a i {
color: var(--heo-white)
}
#body-wrap #travellings_button::after {
--height: 1.8rem;
content: attr(title);
position: fixed;
display: -webkit-box;
display: -moz-box;
display: -webkit-flex;
display: -ms-flexbox;
display: box;
display: flex;
-webkit-box-pack: center;
-moz-box-pack: center;
-o-box-pack: center;
-ms-flex-pack: center;
-webkit-justify-content: center;
justify-content: center;
-webkit-box-align: center;
-moz-box-align: center;
-o-box-align: center;
-ms-flex-align: center;
-webkit-align-items: center;
align-items: center;
color: var(--heo-white);
background: var(--heo-white-op)!important;
-webkit-box-shadow: var(--heo-shadow-nav);
box-shadow: var(--heo-shadow-nav);
border-radius: var(--heo-radius-full);
width: fit-content;
height: var(--height);
font-size: var(--global-font-size);
white-space: nowrap;
margin: auto;
padding: 0 4em;
top: calc((60px - var(--height))/ 2);
right: 0;
left: 0;
line-height: 0;
opacity: 0;
-ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=0)";
filter: alpha(opacity=0);
z-index: 1;
visibility: hidden;
-webkit-transform: scaleX(1.1);
-moz-transform: scaleX(1.1);
-o-transform: scaleX(1.1);
-ms-transform: scaleX(1.1);
transform: scaleX(1.1);
pointer-events: none;
-webkit-transition: .5s;
-moz-transition: .5s;
-o-transition: .5s;
-ms-transition: .5s;
transition: .5s
}
@media screen and (max-width: 900px) {
#body-wrap #travellings_button::after {
padding:0 2em;
}
}
#body-wrap:has(#travellings_button:hover) #nav #menus,#body-wrap:has(#travellings_button:hover) #page-name {
display: none
}
#body-wrap .page #travellings_button:hover::after {
background: var(--heo-main)!important
}
#page-header.nav-fixed #nav { #page-header.nav-fixed #nav {
position: fixed; position: fixed;
top: -60px; top: -60px;
@ -5587,6 +5697,9 @@ html {
#page-header.not-top-img:not(.nav-fixed) #nav { #page-header.not-top-img:not(.nav-fixed) #nav {
background: var(--heo-background) !important; background: var(--heo-background) !important;
} }
div#travellings_button {
display: none!important
}
} }
@ -6885,7 +6998,7 @@ img.footer_mini_logo:hover {
} }
#rightMenu .rightMenu-line { #rightMenu .rightMenu-line {
border-top: 1px dashed var(--heo-theme-op); border-top: 2px dashed var(--heo-theme-op);
} }
#rightMenu .rightMenu-group.rightMenu-small { #rightMenu .rightMenu-group.rightMenu-small {

View File

@ -1,13 +1,13 @@
<!DOCTYPE html> <!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org" <html lang="en" xmlns:th="http://www.thymeleaf.org"
th:replace="~{modules/layouts/layout :: layout(content = ~{::content}, htmlType = 'index', title = ${site.title})}"> th:replace="~{modules/layouts/layout :: layout(content = ~{::content}, htmlType = 'index', title = null)}">
<th:block th:fragment="content"> <th:block th:fragment="content">
<div class="page" id="body-wrap"> <div class="page" id="body-wrap">
<!-- 头部导航栏 --> <!-- 头部导航栏 -->
<header th:class="${theme.config.top.above.enable_above ? 'full_page' : 'not-top-img'}" id="page-header"> <header th:class="${theme.config.top.above.enable_above ? 'full_page' : 'not-top-img'}" id="page-header">
<nav th:replace="~{modules/nav :: nav(title = ${siteSubtitle})}"></nav> <nav th:replace="~{modules/nav :: nav(title = ${siteTitle})}"></nav>
<!-- 问候语 --> <!-- 问候语 -->
<th:block th:replace="~{modules/header/greeting :: greeting}"></th:block> <th:block th:replace="~{modules/header/greeting :: greeting}"></th:block>
<!-- 第一屏 --> <!-- 第一屏 -->

View File

@ -5,7 +5,7 @@
th:if="${theme.config.other.diytitle.diytitleEnable}"> th:if="${theme.config.other.diytitle.diytitleEnable}">
var leaveTitle = '[[${theme.config.other.diytitle.leaveTitle}]]'; var leaveTitle = '[[${theme.config.other.diytitle.leaveTitle}]]';
var backTitle = '[[${theme.config.other.diytitle.backTitle}]]'; var backTitle = '[[${theme.config.other.diytitle.backTitle}]]';
var OriginTitile = "[(${title})]" var OriginTitile = "[(${siteTitle})]"
var titleTime var titleTime
document.addEventListener('visibilitychange', function () { document.addEventListener('visibilitychange', function () {
if (document.hidden) { if (document.hidden) {

View File

@ -13,7 +13,10 @@
</th:block> </th:block>
<img th:if="${not #strings.isEmpty(theme.config.footer.social_media.centerImg)}" class="footer_mini_logo" <img th:if="${not #strings.isEmpty(theme.config.footer.social_media.centerImg)}" class="footer_mini_logo"
th:src="@{${theme.config.footer.social_media.centerImg}}" title="返回顶部" onclick="btf.scrollToDest(0, 500)"> th:with="img = @{${theme.config.footer.social_media.centerImg}}"
th:src="${isLazyload ? '' : img}"
th:data-lazy-src="${ isLazyload ? img : ''}"
title="返回顶部" onclick="btf.scrollToDest(0, 500)">
<th:block th:with="socialMedias = ${theme.config.footer.social_media.socialMediaRight}"> <th:block th:with="socialMedias = ${theme.config.footer.social_media.socialMediaRight}">
<a class="deal_link" rel="external nofollow" target="_blank" th:each="socialMedia : ${socialMedias}" <a class="deal_link" rel="external nofollow" target="_blank" th:each="socialMedia : ${socialMedias}"
th:href="${socialMedia.url}" th:title="${socialMedia.name}"> th:href="${socialMedia.url}" th:title="${socialMedia.name}">
@ -109,7 +112,9 @@
<a class="github-badge" th:each="data : ${bdageitem}" target="_blank" <a class="github-badge" th:each="data : ${bdageitem}" target="_blank"
th:href="@{${data.link}}" style="margin-inline:5px" th:href="@{${data.link}}" style="margin-inline:5px"
th:title="${data.message}"> th:title="${data.message}">
<img th:src="@{${data.shields}}" <img th:with=" img = @{${data.shields}}"
th:src="${isLazyload ? '' : img}"
th:data-lazy-src="${ isLazyload ? img : ''}"
th:alt="${data.message}" /> th:alt="${data.message}" />
</a> </a>
</p> </p>

View File

@ -7,6 +7,7 @@
<meta content="width=device-width,initial-scale=1" name="viewport"> <meta content="width=device-width,initial-scale=1" name="viewport">
<meta content="telephone=no" name="format-detection"> <meta content="telephone=no" name="format-detection">
<meta content="var(--heo-card-bg)" name="theme-color"> <meta content="var(--heo-card-bg)" name="theme-color">
<title th:text="${siteTitle}"></title>
<link rel="shortcut icon" <link rel="shortcut icon"
th:href="@{${#strings.isEmpty(site.favicon) ? assets_link + '/images/hao-logo.jpg' : site.favicon}}"/> th:href="@{${#strings.isEmpty(site.favicon) ? assets_link + '/images/hao-logo.jpg' : site.favicon}}"/>
<script src="https://lf6-cdn-tos.bytecdntp.com/cdn/expire-1-M/jquery/3.6.0/jquery.min.js"></script> <script src="https://lf6-cdn-tos.bytecdntp.com/cdn/expire-1-M/jquery/3.6.0/jquery.min.js"></script>

View File

@ -5,13 +5,13 @@
theme.config.other.staticResource.use == 'custom' ? theme.config.other.staticResource.cdn_link : #theme.assets('/')}, theme.config.other.staticResource.use == 'custom' ? theme.config.other.staticResource.cdn_link : #theme.assets('/')},
theme_version = ${ theme.config.other.staticResource.use == 'local' ? '?v='+ theme.spec.version : ''}, theme_version = ${ theme.config.other.staticResource.use == 'local' ? '?v='+ theme.spec.version : ''},
isLazyload = ${theme.config.other.vanillaLazyload.enable}, isLazyload = ${theme.config.other.vanillaLazyload.enable},
loadingImg = ${theme.config.other.vanillaLazyload.loadingImg}"> loadingImg = ${theme.config.other.vanillaLazyload.loadingImg},
siteTitle = ${not #strings.isEmpty(title) ? title : #strings.isEmpty(site.subtitle) ? site.title : site.title +' - ' +site.subtitle }">
<!-- head 中自定义的 --> <!-- head 中自定义的 -->
<head> <head>
<th:block th:replace="~{modules/head :: head(htmlType = ${htmlType})}"/> <th:block th:replace="~{modules/head :: head(htmlType = ${htmlType})}"/>
<title th:text="${title}"></title>
</head> </head>
<body> <body>

View File

@ -99,6 +99,11 @@
<i class="iconfont icon-link"></i> <i class="iconfont icon-link"></i>
<span>复制地址</span> <span>复制地址</span>
</div> </div>
<div class="rightMenu-item" id="menu-commentBarrage"
rel="external nofollow noreferrer" draggable="false" style="display: flex;">
<i class="haofont hao-icon-message"></i>
<span class="menu-commentBarrage-text">关闭热评</span>
</div>
<div class="rightMenu-item" id="menu-darkmode"> <div class="rightMenu-item" id="menu-darkmode">
<i class="haofont hao-icon-circle-half-stroke"></i> <i class="haofont hao-icon-circle-half-stroke"></i>
<span class="menu-darkmode-text">显示模式</span> <span class="menu-darkmode-text">显示模式</span>

View File

@ -6,15 +6,20 @@
<div class="aside-list" id="newcomm"> <div class="aside-list" id="newcomm">
<th:block th:if="${#strings.equals(theme.config.comments.use, 'commentWidget') }"> <th:block th:if="${#strings.equals(theme.config.comments.use, 'commentWidget') }">
<div class="aside-list-item" th:each="comment,iterStat : ${commentFinder.list(null, 1, 20)}" <div class="aside-list-item" th:each="comment,iterStat : ${commentFinder.list(null, 1, 20)}"
th:with="page = ${comment.spec.subjectRef.kind == 'Post' ? postFinder.getByName(comment.spec.subjectRef.name) : null}" th:with="page = ${comment.spec.subjectRef.kind == 'Post' ? postFinder.getByName(comment.spec.subjectRef.name) :
comment.spec.subjectRef.kind == 'SinglePage' ? singlePageFinder.getByName(comment.spec.subjectRef.name) : null},
url = ${page == null? '/' : page.status.permalink + '#comment-' + comment.metadata.name}"
th:if="${iterStat.index < theme.config.sidebar.newcommentnumber}"> th:if="${iterStat.index < theme.config.sidebar.newcommentnumber}">
<span th:text="${commentIndex}"></span> <span th:text="${commentIndex}"></span>
<a class="thumbnail" th:href="${page == null? '/' : page.status.permalink + '#comment-' + comment.metadata.name}" data-pjax-state=""> <a class="thumbnail" th:href="${url}" data-pjax-state="">
<img loading="lazy" alt="头像" th:src="${#strings.isEmpty(comment.owner.avatar)?'https://cravatar.cn/avatar/?d=mp':comment.owner.avatar}" data-ll-status="loading" class="entered loading"> <img alt="头像"
th:with=" img =${#strings.isEmpty(comment.owner.avatar)?'https://cravatar.cn/avatar/?d=mp':comment.owner.avatar}"
th:src="${isLazyload ? loadingImg : img}"
th:data-lazy-src="${ isLazyload ? img : ''}">
</a> </a>
<div class="content" > <div class="content" >
<a class="comment" style="display: -webkit-box;-webkit-line-clamp: 2;-webkit-box-orient: vertical;overflow: hidden;" <a class="comment" style="display: -webkit-box;-webkit-line-clamp: 2;-webkit-box-orient: vertical;overflow: hidden;"
th:href="${page == null? '/' : page.status.permalink + '#comment-' + comment.metadata.name}" th:title="${comment.spec.content}" th:text="${comment.spec.content}" data-pjax-state=""> th:href="${url}" th:title="${comment.spec.content}" th:text="${comment.spec.content}" data-pjax-state="">
</a> </a>
<div class="name"> <div class="name">
@ -38,10 +43,14 @@
includeReply: false // 是否包括最新回复默认false includeReply: false // 是否包括最新回复默认false
}).then(function (res) { }).then(function (res) {
let commenthtml = ''; let commenthtml = '';
let name = 'src'
if([[${isLazyload}]]){
name = 'data-lazy-src'
}
res.forEach((items)=>{ res.forEach((items)=>{
commenthtml += `<div class="aside-list-item"> commenthtml += `<div class="aside-list-item">
<a class="thumbnail" href="${items.url + '#' + items.id}"> <a class="thumbnail" href="${items.url + '#' + items.id}">
<img loading="lazy" alt="dasda" src="${items.avatar}"> <img alt="dasda" ${name}="${items.avatar}">
</a> </a>
<div class="content"> <div class="content">
<a class="comment" style="display: -webkit-box;-webkit-line-clamp: 2;-webkit-box-orient: vertical;overflow: hidden;" href="${items.url + '#' + items.id}" title="test"> <a class="comment" style="display: -webkit-box;-webkit-line-clamp: 2;-webkit-box-orient: vertical;overflow: hidden;" href="${items.url + '#' + items.id}" title="test">

View File

@ -63,7 +63,10 @@
result += '<div class=\'aside-list-item\'>' result += '<div class=\'aside-list-item\'>'
if (true) { if (true) {
const name = 'src' let name = 'src'
if([[${isLazyload}]]){
name = 'data-lazy-src'
}
result += `<a href='${array[i].url}' class='thumbnail'><img ${name}='${array[i].avatar}' alt='${array[i].nick}'><div class='name'><span>${array[i].nick}</span></div></a>` result += `<a href='${array[i].url}' class='thumbnail'><img ${name}='${array[i].avatar}' alt='${array[i].nick}'><div class='name'><span>${array[i].nick}</span></div></a>`
} }

View File

@ -17,18 +17,22 @@
<div class="aside-list"> <div class="aside-list">
<th:block th:if="${#strings.equals(theme.config.comments.use, 'commentWidget') }"> <th:block th:if="${#strings.equals(theme.config.comments.use, 'commentWidget') }">
<!-- BUG由于当前的列出所有评论API无过滤功能非文章页的评论无法查询到页面信息所以非文章评论跳转至首页--> <!-- BUG由于当前的列出所有评论API无过滤功能非文章页的评论无法查询到页面信息所以非文章评论跳转至首页-->
<div class="aside-list-item" th:each="comment,iterStat : ${commentFinder.list(null, 1, 20)}" <div class="aside-list-item" th:each="comment,iterStat : ${commentFinder.list(null, 1, 20)}"
th:with="page = ${comment.spec.subjectRef.kind == 'Post' ? postFinder.getByName(comment.spec.subjectRef.name) : null}" th:with="page = ${comment.spec.subjectRef.kind == 'Post' ? postFinder.getByName(comment.spec.subjectRef.name) :
th:if="${iterStat.index < 6}" > comment.spec.subjectRef.kind == 'SinglePage' ? singlePageFinder.getByName(comment.spec.subjectRef.name) : null},
<a th:href="${page == null? '/' : page.status.permalink + '#comment-' + comment.metadata.name}" class="thumbnail" data-pjax-state=""> url = ${page == null? '/' : page.status.permalink + '#comment-' + comment.metadata.name}"
<img th:src="${#strings.isEmpty(comment.owner.avatar)?'https://cravatar.cn/avatar/?d=mp':comment.owner.avatar}" th:if="${iterStat.index < 6}" >
th:alt="${comment.owner.displayName}" data-ll-status="loaded" class="entered loaded"> <a th:href="${url}" class="thumbnail" data-pjax-state="">
<img th:with="img = ${#strings.isEmpty(comment.owner.avatar)?'https://cravatar.cn/avatar/?d=mp':comment.owner.avatar}"
th:src="${isLazyload ? loadingImg : img}"
th:data-lazy-src="${ isLazyload ? img : ''}"
th:alt="${comment.owner.displayName}">
<div class="name"><span>stonewu</span></div> <div class="name"><span>stonewu</span></div>
</a> </a>
<div class="content"> <div class="content">
<a class="comment" th:href="${page == null? '/' : page.status.permalink + '#comment-' + comment.metadata.name}" th:title="${comment.spec.content}" data-pjax-state="" th:text="${comment.spec.content}"></a> <a class="comment" th:href="${url}" th:title="${comment.spec.content}" data-pjax-state="" th:text="${comment.spec.content}"></a>
<time th:datetime="${#dates.format(comment.metadata.creationTimestamp, 'yyyy-MM-dd HH:mm:ss')}"></time> <time th:datetime="${#dates.format(comment.metadata.creationTimestamp, 'yyyy-MM-dd HH:mm:ss')}"></time>
</div> </div>
</div> </div>
<script data-pjax> <script data-pjax>
window.addEventListener('load', () => { window.addEventListener('load', () => {

View File

@ -7,14 +7,14 @@
<!-- 功能都需要添加开关 --> <!-- 功能都需要添加开关 -->
<!-- 随机前往一个开往项目网站 --> <!-- 随机前往一个开往项目网站 -->
<div class="nav-button only-home" id="travellings_button" th:if="${theme.config.nav.right.travelling}"> <div class="nav-button" id="travellings_button" title="随机前往一个开往项目网站" th:if="${theme.config.nav.right.travelling}">
<a class="site-page" th:href="@{${theme.config.nav.right.travellingUrl}}" target="_blank" rel="external nofollow" <a class="site-page" onclick="totraveling()" href="javascript:void(0);" rel="external nofollow"
title="随机前往一个开往项目网站"> title="随机前往一个开往项目网站">
<i class="haofont hao-icon-train" style="font-size: 1rem; font-weight: 700; "></i> <i class="haofont hao-icon-train" style="font-size: 1rem; font-weight: 700; "></i>
</a> </a>
</div> </div>
<div class="nav-button only-home" th:if="${theme.config.nav.right.article}"> <div class="nav-button" th:if="${theme.config.nav.right.article}">
<a class="site-page" href="javascript:void(0);" onclick="toRandomPost()" title="随机文章"> <a class="site-page" href="javascript:void(0);" onclick="toRandomPost()" title="随机文章">
<i class="haofont hao-icon-dice" style="font-size: 1rem; font-weight: 700;"></i> <i class="haofont hao-icon-dice" style="font-size: 1rem; font-weight: 700;"></i>
</a> </a>