页脚友链开关,tag样式修改,优化加载动画问题,评论样式
This commit is contained in:
parent
1b4366c216
commit
e12e987295
|
@ -180,7 +180,7 @@ spec:
|
|||
name: recommendPostCustom
|
||||
label: 自定义文章
|
||||
help: "建议设置六篇文章"
|
||||
value: [ ]
|
||||
value: []
|
||||
children:
|
||||
- $formkit: url
|
||||
name: url
|
||||
|
@ -356,7 +356,7 @@ spec:
|
|||
name: socialMedia
|
||||
label: 社交媒体
|
||||
help: 侧栏社交媒体建议只设置两个
|
||||
value: [ ]
|
||||
value: []
|
||||
children:
|
||||
- $formkit: select
|
||||
name: icon
|
||||
|
@ -466,11 +466,11 @@ spec:
|
|||
name: centerImg
|
||||
label: 社交媒体中间logo
|
||||
help: logo图片链接
|
||||
placeholder: 请填写logo图片链接
|
||||
placeholder: 请填写logo图片链接
|
||||
- $formkit: repeater
|
||||
name: socialMediaLeft
|
||||
label: 社交媒体(左)
|
||||
value: [ ]
|
||||
value: []
|
||||
children:
|
||||
- $formkit: select
|
||||
name: icon
|
||||
|
@ -551,7 +551,7 @@ spec:
|
|||
- $formkit: repeater
|
||||
name: socialMediaRight
|
||||
label: 社交媒体(右)
|
||||
value: [ ]
|
||||
value: []
|
||||
children:
|
||||
- $formkit: select
|
||||
name: icon
|
||||
|
@ -628,10 +628,25 @@ spec:
|
|||
- label: 跳转链接
|
||||
value: normal
|
||||
- label: 图片
|
||||
value: image
|
||||
value: image
|
||||
- $formkit: menuRadio
|
||||
name: menu
|
||||
label: 底部相关链接
|
||||
- $formkit: radio
|
||||
name: enable_footer_group
|
||||
label: 启用页脚友链
|
||||
value: true
|
||||
options:
|
||||
- label: 启用
|
||||
value: true
|
||||
- label: 禁用
|
||||
value: false
|
||||
- $formkit: url
|
||||
name: fetchUrl
|
||||
value: "`https://moments.0206.ink/randomfriend?num=3`"
|
||||
label: 页脚友链地址
|
||||
placeholder: 请输入页脚友链地址
|
||||
help: 注意格式 (`友链地址`)
|
||||
|
||||
- group: post
|
||||
label: 文章
|
||||
|
@ -803,7 +818,7 @@ spec:
|
|||
- $formkit: attachment
|
||||
name: authorCareersBackground
|
||||
label: 职业生涯背景图
|
||||
placeholder: 建议找个透明图
|
||||
placeholder: 建议找个透明图
|
||||
- $formkit: select
|
||||
name: personalities
|
||||
label: 人格
|
||||
|
@ -894,7 +909,7 @@ spec:
|
|||
label: 爱好游戏背景
|
||||
placeholder: 请输入内容
|
||||
value: https://img.zhheo.com/i/2022/08/31/630efa7ae39fe.webp
|
||||
|
||||
|
||||
- $formkit: group
|
||||
name: game2
|
||||
label: 爱好游戏2相关配置
|
||||
|
@ -976,7 +991,7 @@ spec:
|
|||
name: music_link
|
||||
label: 音乐偏好按钮链接
|
||||
placeholder: 请输入内容
|
||||
value:
|
||||
value:
|
||||
- $formkit: attachment
|
||||
name: music_bg
|
||||
label: 音乐偏好背景
|
||||
|
@ -1024,7 +1039,7 @@ spec:
|
|||
- $formkit: color
|
||||
name: authorInfoColor
|
||||
label: 内容颜色
|
||||
placeholder: 请输入内容
|
||||
placeholder: 请输入内容
|
||||
- $formkit: textarea
|
||||
name: xjlc
|
||||
label: 心路历程
|
||||
|
@ -1051,7 +1066,7 @@ spec:
|
|||
name:
|
||||
content:
|
||||
wxPay:
|
||||
alipay:
|
||||
alipay:
|
||||
children:
|
||||
- $formkit: radio
|
||||
name: enable_reward
|
||||
|
@ -1108,7 +1123,7 @@ spec:
|
|||
value: "Y"
|
||||
- label: 否
|
||||
value: "N"
|
||||
|
||||
|
||||
- group: style
|
||||
label: 样式(WIP)
|
||||
formSchema:
|
||||
|
@ -1260,14 +1275,9 @@ spec:
|
|||
name: apiurl
|
||||
value: "`https://moments.0206.ink/`"
|
||||
label: token地址
|
||||
placeholder: 请输入token地址
|
||||
help: 注意格式 (`token地址`)
|
||||
- $formkit: url
|
||||
name: fetchUrl
|
||||
value: "`https://moments.0206.ink/randomfriend?num=3`"
|
||||
label: 页脚友链地址
|
||||
placeholder: 请输入页脚友链地址
|
||||
help: 注意格式 (`友链地址`)
|
||||
placeholder: 请输入token地址
|
||||
help: 注意格式 (`token地址`)
|
||||
|
||||
- group: comments
|
||||
label: 评论
|
||||
formSchema:
|
||||
|
|
|
@ -38,7 +38,7 @@
|
|||
<div class="article-sort-item-tags">
|
||||
<a class="article-meta__tags"
|
||||
th:each="tag : ${post.tags}" th:href="@{${tag.status.permalink}}">
|
||||
<span class="tags-punctuation">#</span>[[${tag.spec.displayName}]]
|
||||
<span class="tags-punctuation">[[${tag.spec.displayName}]]</span>
|
||||
</a>
|
||||
<span class="article-meta__link">•</span>
|
||||
</div>
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
let halo = {
|
||||
darkComment: () => {
|
||||
if (document.querySelector('#comment div').shadowRoot.querySelector('.halo-comment-widget').classList != null) {
|
||||
let commentDOMclass = document.querySelector('#comment div').shadowRoot.querySelector('.halo-comment-widget').classList
|
||||
if (commentDOMclass.contains('light'))
|
||||
commentDOMclass.replace('light', 'dark')
|
||||
darkComment : ()=>{
|
||||
if(document.querySelector('#comment div').shadowRoot.querySelector('.halo-comment-widget').classList != null){
|
||||
let commentDOMclass = document.querySelector('#comment div').shadowRoot.querySelector('.halo-comment-widget').classList
|
||||
if(commentDOMclass.contains('light'))
|
||||
commentDOMclass.replace('light','dark')
|
||||
else
|
||||
commentDOMclass.replace('dark', 'light')
|
||||
commentDOMclass.replace('dark','light')
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
|
@ -31,9 +31,9 @@ var heo = {
|
|||
// },
|
||||
|
||||
// 首页bb
|
||||
initIndexEssay: function () {
|
||||
initIndexEssay: function() {
|
||||
if (document.querySelector("#bber-talk"))
|
||||
new Swiper(".swiper-container", {
|
||||
new Swiper(".swiper-container",{
|
||||
direction: "vertical",
|
||||
loop: !0,
|
||||
autoplay: {
|
||||
|
@ -67,14 +67,14 @@ var heo = {
|
|||
|
||||
|
||||
//监测是否在页面开头
|
||||
addNavBackgroundInit: function () {
|
||||
addNavBackgroundInit: function() {
|
||||
var e = 0
|
||||
, t = 0;
|
||||
, t = 0;
|
||||
document.body && (e = document.body.scrollTop),
|
||||
document.documentElement && (t = document.documentElement.scrollTop),
|
||||
0 != (e - t > 0 ? e : t) && (document.getElementById("page-header").classList.add("nav-fixed"),
|
||||
document.getElementById("page-header").classList.add("nav-visible"),
|
||||
$("#cookies-window").hide())
|
||||
document.getElementById("page-header").classList.add("nav-visible"),
|
||||
$("#cookies-window").hide())
|
||||
},
|
||||
|
||||
// 标签页面
|
||||
|
@ -221,11 +221,11 @@ var heo = {
|
|||
},
|
||||
|
||||
// 刷新即刻短文瀑布流
|
||||
reflashEssayWaterFall: function () {
|
||||
document.querySelector("#waterfall") && setTimeout((function () {
|
||||
waterfall("#waterfall"),
|
||||
document.getElementById("waterfall").classList.add("show")
|
||||
}
|
||||
reflashEssayWaterFall: function() {
|
||||
document.querySelector("#waterfall") && setTimeout((function() {
|
||||
waterfall("#waterfall"),
|
||||
document.getElementById("waterfall").classList.add("show")
|
||||
}
|
||||
), 500)
|
||||
},
|
||||
|
||||
|
@ -290,14 +290,14 @@ var heo = {
|
|||
},
|
||||
|
||||
//隐藏cookie窗口
|
||||
hidecookie: function () {
|
||||
heo_cookiesTime = setTimeout((() => {
|
||||
document.getElementById("cookies-window").classList.add("cw-hide"),
|
||||
setTimeout((() => {
|
||||
$("#cookies-window").hide()
|
||||
}
|
||||
), 1e3)
|
||||
hidecookie: function() {
|
||||
heo_cookiesTime = setTimeout((()=>{
|
||||
document.getElementById("cookies-window").classList.add("cw-hide"),
|
||||
setTimeout((()=>{
|
||||
$("#cookies-window").hide()
|
||||
}
|
||||
), 1e3)
|
||||
}
|
||||
), 3e3)
|
||||
},
|
||||
|
||||
|
@ -403,7 +403,7 @@ var heo = {
|
|||
//显示中控台
|
||||
showConsole: function () {
|
||||
document.querySelector("#console").classList.add("show");
|
||||
|
||||
|
||||
},
|
||||
|
||||
//隐藏中控台
|
||||
|
@ -434,11 +434,11 @@ var heo = {
|
|||
hideAsideBtn: () => { // Hide aside
|
||||
const $htmlDom = document.documentElement.classList
|
||||
$htmlDom.contains('hide-aside')
|
||||
? saveToLocal.set('aside-status', 'show', 2)
|
||||
: saveToLocal.set('aside-status', 'hide', 2)
|
||||
? saveToLocal.set('aside-status', 'show', 2)
|
||||
: saveToLocal.set('aside-status', 'hide', 2)
|
||||
$htmlDom.toggle('hide-aside')
|
||||
},
|
||||
|
||||
},
|
||||
|
||||
|
||||
//初始化console图标
|
||||
initConsoleState: function () {
|
||||
|
|
|
@ -268,8 +268,8 @@ document.addEventListener('DOMContentLoaded', function () {
|
|||
// }
|
||||
|
||||
/**
|
||||
* fancybox和 mediumZoom
|
||||
*/
|
||||
* fancybox和 mediumZoom
|
||||
*/
|
||||
const addFancybox = function (ele) {
|
||||
const runFancybox = (ele) => {
|
||||
ele.each(function (i, o) {
|
||||
|
@ -308,26 +308,26 @@ document.addEventListener('DOMContentLoaded', function () {
|
|||
const addMediumZoom = () => {
|
||||
const zoom = mediumZoom(document.querySelectorAll('#article-container :not(a)>img'))
|
||||
zoom.on('open', e => {
|
||||
const photoBg = document.documentElement.getAttribute('data-theme') === 'dark' ? '#121212' : '#fff'
|
||||
zoom.update({
|
||||
background: photoBg
|
||||
})
|
||||
const photoBg = document.documentElement.getAttribute('data-theme') === 'dark' ? '#121212' : '#fff'
|
||||
zoom.update({
|
||||
background: photoBg
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
const jqLoadAndRun = () => {
|
||||
const $fancyboxEle = GLOBAL_CONFIG.lightbox === 'fancybox'
|
||||
? document.querySelectorAll('#article-container :not(a):not(.gallery-group) > img, #article-container > img,.bber-content-img > img')
|
||||
: []
|
||||
? document.querySelectorAll('#article-container :not(a):not(.gallery-group) > img, #article-container > img,.bber-content-img > img')
|
||||
: []
|
||||
const fbLengthNoZero = $fancyboxEle.length > 0
|
||||
const $jgEle = document.querySelectorAll('#article-container .justified-gallery')
|
||||
const jgLengthNoZero = $jgEle.length > 0
|
||||
|
||||
|
||||
if (jgLengthNoZero || fbLengthNoZero) {
|
||||
btf.isJqueryLoad(() => {
|
||||
jgLengthNoZero && runJustifiedGallery($jgEle)
|
||||
fbLengthNoZero && addFancybox($fancyboxEle)
|
||||
})
|
||||
btf.isJqueryLoad(() => {
|
||||
jgLengthNoZero && runJustifiedGallery($jgEle)
|
||||
fbLengthNoZero && addFancybox($fancyboxEle)
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -338,13 +338,13 @@ document.addEventListener('DOMContentLoaded', function () {
|
|||
const $rightside = document.getElementById('rightside')
|
||||
const innerHeight = window.innerHeight + 0
|
||||
// console.log("滚动处理运行");
|
||||
|
||||
|
||||
// 當滾動條小于 0 的時候
|
||||
if (document.body.scrollHeight <= innerHeight) {
|
||||
$rightside.style.cssText = 'opacity: 1; transform: translateX(-38px)'
|
||||
return
|
||||
$rightside.style.cssText = 'opacity: 1; transform: translateX(-38px)'
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
let initTop = 0
|
||||
let isChatShow = true
|
||||
const $header = document.getElementById('page-header')
|
||||
|
@ -353,48 +353,48 @@ document.addEventListener('DOMContentLoaded', function () {
|
|||
const isChatBtnHide = typeof chatBtnHide === 'function'
|
||||
const isChatBtnShow = typeof chatBtnShow === 'function'
|
||||
window.addEventListener('scroll', btf.throttle(function (e) {
|
||||
const currentTop = window.scrollY || document.documentElement.scrollTop
|
||||
const isDown = scrollDirection(currentTop)
|
||||
if (currentTop > 0) {
|
||||
if (isDown) {
|
||||
if ($header.classList.contains('nav-visible')) $header.classList.remove('nav-visible')
|
||||
if (isChatBtnShow && isChatShow === true) {
|
||||
chatBtnHide()
|
||||
isChatShow = false
|
||||
}
|
||||
} else {
|
||||
if (!$header.classList.contains('nav-visible')) $header.classList.add('nav-visible')
|
||||
if (isChatBtnHide && isChatShow === false) {
|
||||
chatBtnShow()
|
||||
isChatShow = true
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$header.classList.add('nav-fixed')
|
||||
if ($cookies_window != null && $cookies_window != '') {
|
||||
$cookies_window.classList.add('cw-hide')
|
||||
}
|
||||
if (window.getComputedStyle($rightside).getPropertyValue('opacity') === '0') {
|
||||
$rightside.style.cssText = 'opacity: 1; transform: translateX(-38px)'
|
||||
}
|
||||
const currentTop = window.scrollY || document.documentElement.scrollTop
|
||||
const isDown = scrollDirection(currentTop)
|
||||
if (currentTop > 0) {
|
||||
if (isDown) {
|
||||
if ($header.classList.contains('nav-visible')) $header.classList.remove('nav-visible')
|
||||
if (isChatBtnShow && isChatShow === true) {
|
||||
chatBtnHide()
|
||||
isChatShow = false
|
||||
}
|
||||
} else {
|
||||
if (currentTop === 0) {
|
||||
$header.classList.remove('nav-fixed', 'nav-visible')
|
||||
}
|
||||
$rightside.style.cssText = "opacity: ''; transform: ''"
|
||||
if (!$header.classList.contains('nav-visible')) $header.classList.add('nav-visible')
|
||||
if (isChatBtnHide && isChatShow === false) {
|
||||
chatBtnShow()
|
||||
isChatShow = true
|
||||
}
|
||||
}
|
||||
|
||||
if (document.body.scrollHeight <= innerHeight) {
|
||||
$rightside.style.cssText = 'opacity: 1; transform: translateX(-38px)'
|
||||
|
||||
$header.classList.add('nav-fixed')
|
||||
if($cookies_window!=null && $cookies_window!=''){
|
||||
$cookies_window.classList.add('cw-hide')
|
||||
}
|
||||
if (window.getComputedStyle($rightside).getPropertyValue('opacity') === '0') {
|
||||
$rightside.style.cssText = 'opacity: 1; transform: translateX(-38px)'
|
||||
}
|
||||
} else {
|
||||
if (currentTop === 0) {
|
||||
$header.classList.remove('nav-fixed', 'nav-visible')
|
||||
}
|
||||
$rightside.style.cssText = "opacity: ''; transform: ''"
|
||||
}
|
||||
|
||||
if (document.body.scrollHeight <= innerHeight) {
|
||||
$rightside.style.cssText = 'opacity: 1; transform: translateX(-38px)'
|
||||
}
|
||||
}, 200))
|
||||
|
||||
|
||||
// find the scroll direction
|
||||
function scrollDirection(currentTop) {
|
||||
const result = currentTop > initTop // true is down & false is up
|
||||
initTop = currentTop
|
||||
return result
|
||||
function scrollDirection (currentTop) {
|
||||
const result = currentTop > initTop // true is down & false is up
|
||||
initTop = currentTop
|
||||
return result
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -516,18 +516,14 @@ document.addEventListener('DOMContentLoaded', function () {
|
|||
if (isAnchor) updateAnchor(currentId)
|
||||
|
||||
if (currentId === '') {
|
||||
$cardToc.querySelectorAll('.active').forEach(i => {
|
||||
i.classList.remove('active')
|
||||
})
|
||||
$cardToc.querySelectorAll('.active').forEach(i => { i.classList.remove('active') })
|
||||
detectItem = currentIndex
|
||||
return
|
||||
}
|
||||
|
||||
detectItem = currentIndex
|
||||
|
||||
$cardToc.querySelectorAll('.active').forEach(item => {
|
||||
item.classList.remove('active')
|
||||
})
|
||||
$cardToc.querySelectorAll('.active').forEach(item => { item.classList.remove('active') })
|
||||
const currentActive = $tocLink[currentIndex]
|
||||
currentActive.classList.add('active')
|
||||
|
||||
|
@ -700,8 +696,7 @@ document.addEventListener('DOMContentLoaded', function () {
|
|||
const addRuntime = () => {
|
||||
const $runtimeCount = document.getElementById('runtimeshow');
|
||||
if ($runtimeCount) {
|
||||
var s1 = $runtimeCount.innerText;
|
||||
;//建站时间
|
||||
var s1 = $runtimeCount.innerText;;//建站时间
|
||||
if (s1) {
|
||||
s1 = new Date(s1.replace(/-/g, "/"));
|
||||
s2 = new Date();
|
||||
|
@ -872,7 +867,7 @@ document.addEventListener('DOMContentLoaded', function () {
|
|||
})
|
||||
|
||||
clickFnOfSubMenu()
|
||||
|
||||
|
||||
GLOBAL_CONFIG.copyright !== undefined && addCopyright()
|
||||
}
|
||||
|
||||
|
|
|
@ -1,18 +1,19 @@
|
|||
var btf = {
|
||||
|
||||
|
||||
|
||||
// 修改时间显示"最近"
|
||||
diffDate: function (d, more = false) {
|
||||
const dateNow = new Date();
|
||||
const datePost = new Date(d);
|
||||
const dateDiff = dateNow.getTime() - datePost.getTime();
|
||||
const minute = 1000 * 60;
|
||||
const hour = minute * 60;
|
||||
const day = hour * 24;
|
||||
const month = day * 30;
|
||||
const dateNow = new Date();
|
||||
const datePost = new Date(d);
|
||||
const dateDiff = dateNow.getTime() - datePost.getTime();
|
||||
const minute = 1000 * 60;
|
||||
const hour = minute * 60;
|
||||
const day = hour * 24;
|
||||
const month = day * 30;
|
||||
|
||||
let result;
|
||||
if (more) {
|
||||
let result;
|
||||
if (more) {
|
||||
const monthCount = dateDiff / month;
|
||||
const dayCount = dateDiff / day;
|
||||
const hourCount = dateDiff / hour;
|
||||
|
@ -29,48 +30,48 @@ var btf = {
|
|||
} else {
|
||||
result = GLOBAL_CONFIG.date_suffix.just;
|
||||
}
|
||||
} else {
|
||||
result = parseInt(dateDiff / day);
|
||||
} else {
|
||||
result = parseInt(dateDiff / day);
|
||||
}
|
||||
return result;
|
||||
},
|
||||
|
||||
loadLightbox: ele => {
|
||||
const service = GLOBAL_CONFIG.lightbox;
|
||||
|
||||
|
||||
if (service === "mediumZoom") {
|
||||
const zoom = mediumZoom(ele);
|
||||
zoom.on("open", e => {
|
||||
const photoBg = document.documentElement.getAttribute("data-theme") === "dark" ? "#121212" : "#fff";
|
||||
zoom.update({
|
||||
background: photoBg,
|
||||
});
|
||||
const zoom = mediumZoom(ele);
|
||||
zoom.on("open", e => {
|
||||
const photoBg = document.documentElement.getAttribute("data-theme") === "dark" ? "#121212" : "#fff";
|
||||
zoom.update({
|
||||
background: photoBg,
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
if (service === "fancybox") {
|
||||
ele.forEach(i => {
|
||||
if (i.parentNode.tagName !== "A") {
|
||||
const dataSrc = i.dataset.lazySrc || i.src;
|
||||
const dataCaption = i.title || i.alt || "";
|
||||
anzhiyu.wrap(i, "a", {
|
||||
href: dataSrc,
|
||||
"data-fancybox": "gallery",
|
||||
"data-caption": dataCaption,
|
||||
"data-thumb": dataSrc,
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
if (!window.fancyboxRun) {
|
||||
Fancybox.bind("[data-fancybox]", {
|
||||
Hash: false,
|
||||
Thumbs: {
|
||||
autoStart: false,
|
||||
},
|
||||
});
|
||||
window.fancyboxRun = true;
|
||||
ele.forEach(i => {
|
||||
if (i.parentNode.tagName !== "A") {
|
||||
const dataSrc = i.dataset.lazySrc || i.src;
|
||||
const dataCaption = i.title || i.alt || "";
|
||||
btf.wrap(i, "a", {
|
||||
href: dataSrc,
|
||||
"data-fancybox": "gallery",
|
||||
"data-caption": dataCaption,
|
||||
"data-thumb": dataSrc,
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
if (!window.fancyboxRun) {
|
||||
Fancybox.bind("[data-fancybox]", {
|
||||
Hash: false,
|
||||
Thumbs: {
|
||||
autoStart: false,
|
||||
},
|
||||
});
|
||||
window.fancyboxRun = true;
|
||||
}
|
||||
}
|
||||
},
|
||||
debounce: function (func, wait, immediate) {
|
||||
|
@ -216,32 +217,32 @@ var btf = {
|
|||
}
|
||||
},
|
||||
|
||||
|
||||
scrollToDest: (e, t) => {
|
||||
|
||||
scrollToDest: (e,t)=>{
|
||||
if (e < 0 || t < 0)
|
||||
return;
|
||||
const n = window.scrollY || window.screenTop;
|
||||
if (e -= 70,
|
||||
"CSS" in window && CSS.supports("scroll-behavior", "smooth"))
|
||||
"CSS"in window && CSS.supports("scroll-behavior", "smooth"))
|
||||
return void window.scrollTo({
|
||||
top: e,
|
||||
behavior: "smooth"
|
||||
});
|
||||
let o = null;
|
||||
t = t || 500,
|
||||
window.requestAnimationFrame((function i(s) {
|
||||
if (o = o || s,
|
||||
n < e) {
|
||||
const r = s - o;
|
||||
window.scrollTo(0, (e - n) * r / t + n),
|
||||
r < t ? window.requestAnimationFrame(i) : window.scrollTo(0, e)
|
||||
} else {
|
||||
const r = s - o;
|
||||
window.scrollTo(0, n - (n - e) * r / t),
|
||||
r < t ? window.requestAnimationFrame(i) : window.scrollTo(0, e)
|
||||
}
|
||||
}
|
||||
))
|
||||
window.requestAnimationFrame((function i(s) {
|
||||
if (o = o || s,
|
||||
n < e) {
|
||||
const r = s - o;
|
||||
window.scrollTo(0, (e - n) * r / t + n),
|
||||
r < t ? window.requestAnimationFrame(i) : window.scrollTo(0, e)
|
||||
} else {
|
||||
const r = s - o;
|
||||
window.scrollTo(0, n - (n - e) * r / t),
|
||||
r < t ? window.requestAnimationFrame(i) : window.scrollTo(0, e)
|
||||
}
|
||||
}
|
||||
))
|
||||
},
|
||||
|
||||
fadeIn: (ele, time) => {
|
||||
|
|
|
@ -20,7 +20,7 @@ function coverColor() {
|
|||
// 获取颜色 https://github.com/fast-average-color/fast-average-color
|
||||
const fac = new FastAverageColor();
|
||||
|
||||
fac.getColorAsync(path, {
|
||||
fac.getColorAsync(path,{
|
||||
// 忽略白色
|
||||
ignoredColor: [255, 255, 255, 255]
|
||||
})
|
||||
|
@ -166,9 +166,9 @@ function getContrastYIQ(hexcolor) {
|
|||
function navTitle() {
|
||||
var titlevalue = document.title;
|
||||
var postName = document.getElementsByClassName("post-title")[0];
|
||||
if (postName == null || postName == '') {
|
||||
document.getElementById("page-name-text").innerHTML = titlevalue;
|
||||
} else {
|
||||
if(postName==null || postName==''){
|
||||
document.getElementById("page-name-text").innerHTML = titlevalue;
|
||||
}else{
|
||||
document.getElementById("page-name-text").innerHTML = postName?.innerText;
|
||||
}
|
||||
}
|
||||
|
@ -316,6 +316,7 @@ function AddRewardMask() {
|
|||
}
|
||||
|
||||
|
||||
|
||||
//监听蒙版关闭
|
||||
document.addEventListener('touchstart', e => {
|
||||
RemoveRewardMask()
|
||||
|
|
|
@ -20,7 +20,7 @@ function coverColor() {
|
|||
// 获取颜色 https://github.com/fast-average-color/fast-average-color
|
||||
const fac = new FastAverageColor();
|
||||
|
||||
fac.getColorAsync(path, {
|
||||
fac.getColorAsync(path,{
|
||||
// 忽略白色
|
||||
ignoredColor: [255, 255, 255, 255]
|
||||
})
|
||||
|
@ -166,9 +166,9 @@ function getContrastYIQ(hexcolor) {
|
|||
function navTitle() {
|
||||
var titlevalue = document.title;
|
||||
var postName = document.getElementsByClassName("post-title")[0];
|
||||
if (postName == null || postName == '') {
|
||||
document.getElementById("page-name-text").innerHTML = titlevalue;
|
||||
} else {
|
||||
if(postName==null || postName==''){
|
||||
document.getElementById("page-name-text").innerHTML = titlevalue;
|
||||
}else{
|
||||
document.getElementById("page-name-text").innerHTML = postName?.innerText;
|
||||
}
|
||||
}
|
||||
|
@ -316,6 +316,7 @@ function AddRewardMask() {
|
|||
}
|
||||
|
||||
|
||||
|
||||
//监听蒙版关闭
|
||||
document.addEventListener('touchstart', e => {
|
||||
RemoveRewardMask()
|
||||
|
@ -467,9 +468,9 @@ document.querySelector('#console').addEventListener('wheel', (e) => {
|
|||
// })
|
||||
|
||||
//自动调整即刻短文尺寸
|
||||
window.addEventListener("resize", (function () {
|
||||
document.querySelector("#waterfall") && heo.reflashEssayWaterFall()
|
||||
}
|
||||
window.addEventListener("resize", (function() {
|
||||
document.querySelector("#waterfall") && heo.reflashEssayWaterFall()
|
||||
}
|
||||
));
|
||||
|
||||
//首页大卡片恢复显示
|
||||
|
@ -562,21 +563,21 @@ function owoBig() {
|
|||
// }, 200));
|
||||
|
||||
|
||||
|
||||
// 页面百分比
|
||||
function percent() {
|
||||
let e = document.documentElement.scrollTop || window.pageYOffset
|
||||
,
|
||||
t = Math.max(document.body.scrollHeight, document.documentElement.scrollHeight, document.body.offsetHeight, document.documentElement.offsetHeight, document.body.clientHeight, document.documentElement.clientHeight) - document.documentElement.clientHeight
|
||||
, o = Math.round(e / t * 100)
|
||||
, n = document.querySelector("#percent");
|
||||
, t = Math.max(document.body.scrollHeight, document.documentElement.scrollHeight, document.body.offsetHeight, document.documentElement.offsetHeight, document.body.clientHeight, document.documentElement.clientHeight) - document.documentElement.clientHeight
|
||||
, o = Math.round(e / t * 100)
|
||||
, n = document.querySelector("#percent");
|
||||
var a = window.scrollY + document.documentElement.clientHeight
|
||||
, i = document.getElementById("post-tools") || document.getElementById("footer");
|
||||
, i = document.getElementById("post-tools") || document.getElementById("footer");
|
||||
i.offsetTop + i.offsetHeight / 2 < a || o > 90 ? (document.querySelector("#nav-totop").classList.add("long"),
|
||||
n.innerHTML = "返回顶部") : (document.querySelector("#nav-totop").classList.remove("long"),
|
||||
n.innerHTML = "返回顶部") : (document.querySelector("#nav-totop").classList.remove("long"),
|
||||
o >= 0 && (n.innerHTML = o)),
|
||||
endresult = t - e,
|
||||
endresult < 100 ? $(".needEndHide").addClass("hide") : $(".needEndHide").removeClass("hide"),
|
||||
window.onscroll = percent
|
||||
endresult = t - e,
|
||||
endresult < 100 ? $(".needEndHide").addClass("hide") : $(".needEndHide").removeClass("hide"),
|
||||
window.onscroll = percent
|
||||
}
|
||||
|
||||
//检查是否开启快捷键
|
||||
|
@ -758,8 +759,17 @@ if (getCookie('browsertc') != 1) {
|
|||
|
||||
//注入函数
|
||||
document.addEventListener('pjax:send', function () {
|
||||
Pace.restart();
|
||||
heo.showLoading();
|
||||
|
||||
//显示加载进度条
|
||||
if(GLOBAL_CONFIG.loadProgressBar){
|
||||
Pace.restart();
|
||||
}
|
||||
//显示加载动画
|
||||
if(GLOBAL_CONFIG.loadingBox){
|
||||
heo.showLoading();
|
||||
}
|
||||
|
||||
|
||||
})
|
||||
|
||||
document.addEventListener('DOMContentLoaded', function () {
|
||||
|
@ -771,10 +781,13 @@ document.addEventListener('DOMContentLoaded', function () {
|
|||
heo.sayhi()
|
||||
heo.addTag()
|
||||
heo.stopImgRightDrag()
|
||||
link.addFriendLinksInFooter()
|
||||
//页脚友联
|
||||
if(GLOBAL_CONFIG.isFriendLinksInFooter){
|
||||
link.addFriendLinksInFooter()
|
||||
}
|
||||
heo.qrcodeCreate()
|
||||
heo.onlyHome()
|
||||
|
||||
|
||||
heo.addNavBackgroundInit()
|
||||
heo.initIndexEssay()
|
||||
// heo.changeTimeInEssay()
|
||||
|
@ -783,7 +796,10 @@ document.addEventListener('DOMContentLoaded', function () {
|
|||
heo.darkModeStatus()
|
||||
// heo.categoriesBarActive()
|
||||
heo.initThemeColor()
|
||||
heo.hideLoading()
|
||||
//隐藏加载动画
|
||||
if(GLOBAL_CONFIG.loadingBox){
|
||||
heo.hideLoading()
|
||||
}
|
||||
// heo.tagPageActive()
|
||||
})
|
||||
window.onscroll = function () {
|
||||
|
|
|
@ -4,23 +4,23 @@
|
|||
} */
|
||||
|
||||
/* 代码块纯黑色背景 */
|
||||
code[class*=" language-"], pre[class*=" language-"] {
|
||||
code[class*=" language-"], pre[class*=" language-"]{
|
||||
background: #18171d;
|
||||
}
|
||||
|
||||
/* banner 字体图标大小及位置 */
|
||||
i.iconfont.icon-arrow-right.banner-righticon {
|
||||
i.iconfont.icon-arrow-right.banner-righticon{
|
||||
font-size: 66px;
|
||||
}
|
||||
|
||||
span.bannerText {
|
||||
span.bannerText{
|
||||
display: block;
|
||||
margin-top: 35px;
|
||||
}
|
||||
|
||||
/* 自我介绍渐变色背景 */
|
||||
#aside-content > .card-widget.card-info::before {
|
||||
background: linear-gradient(-25deg, #0084ff, #031764, #67044d);
|
||||
background: linear-gradient(-25deg, var(--heo-main), #031764, var(--heo-main), #67044d);
|
||||
background-size: 400%;
|
||||
position: absolute;
|
||||
width: 100%;
|
||||
|
@ -36,7 +36,7 @@ ul li {
|
|||
font-size: 18px;
|
||||
}
|
||||
|
||||
#article-container ol li:not(.tab), #article-container ul li:not(.tab) {
|
||||
#article-container ol li:not(.tab), #article-container ul li:not(.tab){
|
||||
/* margin-left: 2em; */
|
||||
}
|
||||
|
||||
|
|
|
@ -1 +1 @@
|
|||
code[class*=" language-"],pre[class*=" language-"]{background:#18171d}i.iconfont.icon-arrow-right.banner-righticon{font-size:66px}span.bannerText{display:block;margin-top:35px}#aside-content>.card-widget.card-info::before{background:linear-gradient(-25deg,#0084ff,#031764,#67044d);background-size:400%;position:absolute;width:100%;height:100%;left:0;top:0;content:'';animation:gradient 15s ease infinite}ul li{font-size:18px}#article-container pre>code{background:0 0!important}
|
||||
code[class*=" language-"],pre[class*=" language-"]{background:#18171d}i.iconfont.icon-arrow-right.banner-righticon{font-size:66px}span.bannerText{display:block;margin-top:35px}#aside-content>.card-widget.card-info::before{background:linear-gradient(-25deg,var(--heo-main),#031764,var(--heo-main),#67044d);background-size:400%;position:absolute;width:100%;height:100%;left:0;top:0;content:'';animation:gradient 15s ease infinite}ul li{font-size:18px}#article-container pre>code{background:0 0!important}
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
|
@ -19,8 +19,8 @@
|
|||
th:each="categoryItem : ${categoryFinder.listAll()}"
|
||||
th:href="@{${categoryItem.status.permalink}}"
|
||||
th:id="${categoryItem.spec.displayName}">
|
||||
<span class="tags-punctuation">#</span>
|
||||
[[${categoryItem.spec.displayName}]]
|
||||
<span style="font-size: 22px;" class="tags-punctuation">[[${categoryItem.spec.displayName}]]</span>
|
||||
|
||||
<span class="tagsPageCount">[[${categoryItem.status.visiblePostCount}]]</span></a>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -54,7 +54,7 @@
|
|||
<div class="article-sort-item-tags">
|
||||
<a class="article-meta__tags"
|
||||
th:each="tag : ${post.tags}" th:href="@{${tag.status.permalink}}">
|
||||
<span class="tags-punctuation">#</span>[[${tag.spec.displayName}]]
|
||||
<span class="tags-punctuation">[[${tag.spec.displayName}]]</span>
|
||||
</a>
|
||||
<span class="article-meta__link">•</span>
|
||||
</div>
|
||||
|
|
|
@ -17,12 +17,12 @@
|
|||
<script th:src="@{/assets/js/halo.js}"></script>
|
||||
|
||||
<link rel="stylesheet" th:href="@{/assets/zhheo/zhheoblog.css}">
|
||||
|
||||
|
||||
<link rel="stylesheet" th:href="@{/assets/zhheo/custom.css}">
|
||||
|
||||
<link rel="stylesheet" th:href="@{/assets/zhheo/commentBarrage.css}">
|
||||
|
||||
|
||||
|
||||
|
||||
<link media="print"
|
||||
onload='this.media="all"'
|
||||
rel="stylesheet"
|
||||
|
@ -36,11 +36,10 @@
|
|||
media="print"
|
||||
onload='this.media="all"'
|
||||
rel="stylesheet"
|
||||
/>
|
||||
/>
|
||||
|
||||
|
||||
|
||||
<link rel="stylesheet" href="https://cdn.staticfile.org/font-awesome/6.2.0/css/all.min.css" media="all"
|
||||
onload="this.media='all'">
|
||||
<link rel="stylesheet" href="https://cdn.staticfile.org/font-awesome/6.2.0/css/all.min.css" media="all" onload="this.media='all'">
|
||||
|
||||
<script>
|
||||
(win => {
|
||||
|
@ -119,9 +118,9 @@
|
|||
} else if (t === 'light') activateLightMode()
|
||||
else activateDarkMode()
|
||||
|
||||
if ("[[${theme.config.style.colorScheme}]]" === 'dark')
|
||||
if("[[${theme.config.style.colorScheme}]]" === 'dark')
|
||||
activateDarkMode()
|
||||
if ("[[${theme.config.style.colorScheme}]]" === 'light')
|
||||
if("[[${theme.config.style.colorScheme}]]" === 'light')
|
||||
activateLightMode()
|
||||
|
||||
const asideStatus = saveToLocal.get('aside-status')
|
||||
|
@ -152,8 +151,7 @@
|
|||
|
||||
|
||||
<!-- icon图标 -->
|
||||
<link rel="preload" as="style" onload="this.rel='stylesheet'"
|
||||
th:href="@{/assets/icon/fontawesome/fontawesome.min.css}">
|
||||
<link rel="preload" as="style" onload="this.rel='stylesheet'" th:href="@{/assets/icon/fontawesome/fontawesome.min.css}">
|
||||
<link rel="stylesheet" href="https://npm.elemecdn.com/anzhiyu-theme-static@1.1.0/icon/ali_iconfont_css.css">
|
||||
|
||||
<!-- 声明一些公共信息 -->
|
||||
|
@ -171,6 +169,9 @@
|
|||
copyright: undefined,
|
||||
lightbox: 'fancybox',
|
||||
lazyload: {enable: true, error: "/themes/theme-hao/assets/images/404s.gif"},
|
||||
isFriendLinksInFooter: [[${theme.config.footer.enable_footer_group}]],
|
||||
loadingBox: [[${theme.config.other.loadingBox}]],
|
||||
loadProgressBar: [[${theme.config.other.loadProgressBar}]],
|
||||
date_suffix: {
|
||||
just: '刚刚',
|
||||
min: '分钟前',
|
||||
|
@ -191,7 +192,7 @@
|
|||
};
|
||||
|
||||
// 根据htmlType设置页面title
|
||||
setTitle = () => {
|
||||
setTitle = () => {
|
||||
let title = ''
|
||||
|
||||
switch ([[${ htmlType }]]) {
|
||||
|
@ -233,10 +234,12 @@
|
|||
setTitle()
|
||||
})()
|
||||
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
|
||||
|
||||
|
||||
</head>
|
||||
|
||||
</html>
|
||||
|
|
|
@ -9,269 +9,275 @@
|
|||
|
||||
<body>
|
||||
|
||||
<!-- loading 页面 -->
|
||||
<div th:replace="~{modules/loading-box :: loading-box}"></div>
|
||||
<!-- loading 页面 -->
|
||||
<div th:replace="~{modules/loading-box :: loading-box}"></div>
|
||||
|
||||
<!-- 网站背景 -->
|
||||
<div id="web_bg"></div>
|
||||
<!-- 网站背景 -->
|
||||
<div id="web_bg"></div>
|
||||
|
||||
<!-- 控制台 -->
|
||||
<div th:replace="~{modules/widgets/console :: console}"></div>
|
||||
<!-- 控制台 -->
|
||||
<div th:replace="~{modules/widgets/console :: console}"></div>
|
||||
|
||||
<div th:replace="~{modules/sidebar :: sidebar}"></div>
|
||||
<div th:replace="~{modules/sidebar :: sidebar}"></div>
|
||||
|
||||
<!-- 内容 -->
|
||||
<th:block th:replace="${content}"></th:block>
|
||||
<!-- 内容 -->
|
||||
<th:block th:replace="${content}"></th:block>
|
||||
|
||||
<!-- todo 暂时没显示,是右下角悬浮操作按钮 -->
|
||||
<div id="rightside">
|
||||
<div id="rightside-config-hide">
|
||||
<button id="translateLink" title="简繁转换" type="button">简</button>
|
||||
<button id="darkmode" title="浅色和深色模式转换" type="button"><i class="fas fa-adjust"></i></button>
|
||||
<button id="hide-aside-btn" title="单栏和双栏切换" type="button"><i class="fas fa-arrows-alt-h"></i></button>
|
||||
<!-- todo 暂时没显示,是右下角悬浮操作按钮 -->
|
||||
<div id="rightside">
|
||||
<div id="rightside-config-hide">
|
||||
<button id="translateLink" title="简繁转换" type="button">简</button>
|
||||
<button id="darkmode" title="浅色和深色模式转换" type="button"><i class="fas fa-adjust"></i></button>
|
||||
<button id="hide-aside-btn" title="单栏和双栏切换" type="button"><i class="fas fa-arrows-alt-h"></i></button>
|
||||
</div>
|
||||
<div id="rightside-config-show">
|
||||
<button id="rightside_config" title="设置" type="button"><i class="fas fa-cog fa-spin"></i></button>
|
||||
<button id="go-up" title="回到顶部" type="button"><i class="fas fa-arrow-up"></i></button>
|
||||
</div>
|
||||
</div>
|
||||
<div id="rightside-config-show">
|
||||
<button id="rightside_config" title="设置" type="button"><i class="fas fa-cog fa-spin"></i></button>
|
||||
<button id="go-up" title="回到顶部" type="button"><i class="fas fa-arrow-up"></i></button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div th:replace="~{modules/right-menu :: right-menu}"></div>
|
||||
<div th:replace="~{modules/right-menu :: right-menu}"></div>
|
||||
|
||||
<div>
|
||||
<script th:src="@{/assets/js/utils.js}"></script>
|
||||
<script th:src="@{/assets/js/main.js}"></script>
|
||||
<script charset="utf-8" data-pjax th:src="@{/assets/zhheo/blogex.js}"></script>
|
||||
<div>
|
||||
<script th:src="@{/assets/js/utils.js}"></script>
|
||||
<script th:src="@{/assets/js/main.js}"></script>
|
||||
<script charset="utf-8" data-pjax th:src="@{/assets/zhheo/blogex.js}"></script>
|
||||
|
||||
<!-- https://instant.page/ 网站预加载, 放在 </body> 之前 -->
|
||||
<script th:src="@{/assets/libs/instantpage/instantpage.min.js}" type="module"></script>
|
||||
<!-- https://instant.page/ 网站预加载, 放在 </body> 之前 -->
|
||||
<script th:src="@{/assets/libs/instantpage/instantpage.min.js}" type="module"></script>
|
||||
|
||||
<script th:src="@{/assets/libs/lazyload/lazyload.iife.min.js}"></script>
|
||||
<script th:src="@{/assets/libs/lazyload/lazyload.iife.min.js}"></script>
|
||||
|
||||
<!-- 右下角通知 https://www.polonel.com/snackbar/ -->
|
||||
<!-- todo head 中有它的 css,应该可以写一块,并改成后台可配置的功能,代码中应该还有他的 js -->
|
||||
<script th:src="@{/assets/libs/snackbar/snackbar.min.js}"></script>
|
||||
<!-- 右下角通知 https://www.polonel.com/snackbar/ -->
|
||||
<!-- todo head 中有它的 css,应该可以写一块,并改成后台可配置的功能,代码中应该还有他的 js -->
|
||||
<script th:src="@{/assets/libs/snackbar/snackbar.min.js}"></script>
|
||||
|
||||
<!-- https://davidshimjs.github.io/qrcodejs/ 生成二维码 -->
|
||||
<!-- 应该是文章页分享使用 -->
|
||||
<script data-pjax src="https://lf3-cdn-tos.bytecdntp.com/cdn/expire-1-M/qrcodejs/1.0.0/qrcode.min.js"></script>
|
||||
<!-- https://davidshimjs.github.io/qrcodejs/ 生成二维码 -->
|
||||
<!-- 应该是文章页分享使用 -->
|
||||
<script data-pjax src="https://lf3-cdn-tos.bytecdntp.com/cdn/expire-1-M/qrcodejs/1.0.0/qrcode.min.js"></script>
|
||||
|
||||
<!-- https://raphamorim.io/waterfall.js/ 应该是这个 还有相关的 js 代码 是否可以调整-->
|
||||
<script th:src="@{/assets/libs/waterfall/waterfall.min.js}"></script>
|
||||
<!-- https://raphamorim.io/waterfall.js/ 应该是这个 还有相关的 js 代码 是否可以调整-->
|
||||
<script th:src="@{/assets/libs/waterfall/waterfall.min.js}"></script>
|
||||
|
||||
<!-- 获取主色 https://lokeshdhakar.com/projects/color-thief/ -->
|
||||
<!--<script th:src="@{/assets/libs/color-thief/color-thief.umd.js}"></script>-->
|
||||
<script th:src="@{/assets/libs/fast-average-color/index.browser.min.js}"></script>
|
||||
<!-- 获取主色 https://lokeshdhakar.com/projects/color-thief/ -->
|
||||
<!--<script th:src="@{/assets/libs/color-thief/color-thief.umd.js}"></script>-->
|
||||
<script th:src="@{/assets/libs/fast-average-color/index.browser.min.js}"></script>
|
||||
|
||||
<script th:src="@{/assets/libs/view-image/view-image.min.js}"></script>
|
||||
<script th:src="@{/assets/libs/view-image/view-image.min.js}"></script>
|
||||
|
||||
<script th:src="@{/assets/libs/pjax/pjax.min.js}"></script>
|
||||
<script th:src="@{/assets/libs/pjax/pjax.min.js}"></script>
|
||||
|
||||
<!-- swiper 在瞬间滚动时会使用 -->
|
||||
<script data-pjax th:src="@{/assets/libs/swiper/swiper-bundle.min.js}"></script>
|
||||
<!-- swiper 在瞬间滚动时会使用 -->
|
||||
<script data-pjax th:src="@{/assets/libs/swiper/swiper-bundle.min.js}"></script>
|
||||
|
||||
<!-- 评论弹幕 -->
|
||||
<script th:replace="~{modules/commentBarrage :: commentBarrage}"></script>
|
||||
<!-- 评论弹幕 -->
|
||||
<script th:replace="~{modules/commentBarrage :: commentBarrage}"></script>
|
||||
|
||||
<!-- Tocbot 目录生成 start -->
|
||||
<script th:src="@{/assets/libs/tocbot/4.18.2/tocbot.min.js}"></script>
|
||||
<link th:href="@{/assets/libs/tocbot/4.18.2/tocbot.css}" rel="stylesheet">
|
||||
<!-- Tocbot 目录生成 start -->
|
||||
<script th:src="@{/assets/libs/tocbot/4.18.2/tocbot.min.js}"></script>
|
||||
<link th:href="@{/assets/libs/tocbot/4.18.2/tocbot.css}" rel="stylesheet">
|
||||
|
||||
<script>
|
||||
document.addEventListener("DOMContentLoaded", function () {
|
||||
<script>
|
||||
document.addEventListener("DOMContentLoaded", function() {
|
||||
|
||||
const postContent = document.querySelector('.post-content');
|
||||
|
||||
if (postContent == null) return;
|
||||
|
||||
const headers = postContent.querySelectorAll('h1,h2,h3,h4,h5,h6');
|
||||
// 没有 toc 目录,则直接移除
|
||||
if (headers.length === 0) {
|
||||
document.getElementById("card-toc").remove();
|
||||
} else {
|
||||
tocbot.init({
|
||||
tocSelector: '.toc-content',
|
||||
contentSelector: '.post-content',
|
||||
headingSelector: 'h1,h2,h3,h4,h5,h6',
|
||||
hasInnerContainers: true
|
||||
});
|
||||
|
||||
}
|
||||
})
|
||||
document.addEventListener('pjax:complete', function () {
|
||||
|
||||
const postContent = document.querySelector('.post-content');
|
||||
|
||||
const postContent = document.querySelector('.post-content');
|
||||
if (postContent == null) return;
|
||||
|
||||
if (postContent == null) return;
|
||||
|
||||
const headers = postContent.querySelectorAll('h1,h2,h3,h4,h5,h6');
|
||||
// 没有 toc 目录,则直接移除
|
||||
if (headers.length === 0) {
|
||||
document.getElementById("card-toc").remove();
|
||||
} else {
|
||||
tocbot.init({
|
||||
const headers = postContent.querySelectorAll('h1,h2,h3,h4,h5,h6');
|
||||
// 没有 toc 目录,则直接移除
|
||||
if (headers.length === 0) {
|
||||
document.getElementById("card-toc").remove();
|
||||
} else {
|
||||
tocbot.init({
|
||||
tocSelector: '.toc-content',
|
||||
contentSelector: '.post-content',
|
||||
headingSelector: 'h1,h2,h3,h4,h5,h6',
|
||||
hasInnerContainers: true
|
||||
});
|
||||
|
||||
}
|
||||
})
|
||||
document.addEventListener('pjax:complete', function () {
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
const postContent = document.querySelector('.post-content');
|
||||
|
||||
if (postContent == null) return;
|
||||
|
||||
const headers = postContent.querySelectorAll('h1,h2,h3,h4,h5,h6');
|
||||
// 没有 toc 目录,则直接移除
|
||||
if (headers.length === 0) {
|
||||
document.getElementById("card-toc").remove();
|
||||
} else {
|
||||
tocbot.init({
|
||||
tocSelector: '.toc-content',
|
||||
contentSelector: '.post-content',
|
||||
headingSelector: 'h1,h2,h3,h4,h5,h6',
|
||||
hasInnerContainers: true
|
||||
});
|
||||
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
<!-- Tocbot 目录生成 end -->
|
||||
<!-- Tocbot 目录生成 end -->
|
||||
|
||||
|
||||
<script>
|
||||
var link = {
|
||||
// 页脚友链
|
||||
addFriendLinksInFooter: function () {
|
||||
|
||||
var fetchUrl = [[${theme.config.fcircle.fetchUrl}]]
|
||||
fetch(fetchUrl)
|
||||
.then(res => res.json())
|
||||
.then(json => {
|
||||
var randomFriendLinks = getArrayItems(json, 3);
|
||||
|
||||
var htmlText = '';
|
||||
for (let i = 0; i < randomFriendLinks.length; ++i) {
|
||||
var item = randomFriendLinks[i]
|
||||
htmlText += `<a class='footer-item' href='${item.link}' target="_blank" rel="noopener nofollow">${item.name}</a>`;
|
||||
}
|
||||
htmlText += `<a class='footer-item' href='/links'>更多</a>`
|
||||
document.getElementById("friend-links-in-footer").innerHTML = htmlText;
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
<div id="js-pjax"></div>
|
||||
|
||||
|
||||
|
||||
<script>
|
||||
let pjaxSelectors = ['title', '#config-diff', '#body-wrap', '#rightside-config-hide', '#rightside-config-show', '.js-pjax', '#site-config']
|
||||
<script >
|
||||
if(GLOBAL_CONFIG.isFriendLinksInFooter){
|
||||
var link = {
|
||||
// 页脚友链
|
||||
addFriendLinksInFooter: function () {
|
||||
|
||||
var fetchUrl = [[${theme.config.fcircle.fetchUrl}]]
|
||||
fetch(fetchUrl)
|
||||
.then(res => res.json())
|
||||
.then(json => {
|
||||
var randomFriendLinks = getArrayItems(json, 3);
|
||||
|
||||
if (false) {
|
||||
pjaxSelectors.unshift('meta[property="og:image"]', 'meta[property="og:title"]', 'meta[property="og:url"]')
|
||||
}
|
||||
|
||||
var pjax = new Pjax({
|
||||
elements: 'a:not([target="_blank"])',
|
||||
selectors: pjaxSelectors,
|
||||
cacheBust: false,
|
||||
analytics: false,
|
||||
scrollRestoration: false
|
||||
})
|
||||
|
||||
document.addEventListener('pjax:send', function () {
|
||||
|
||||
// removeEventListener toc scroll
|
||||
window.removeEventListener('scroll', window.tocScrollFn)
|
||||
|
||||
typeof preloader === 'object' && preloader.initLoading()
|
||||
|
||||
if (window.aplayers) {
|
||||
for (let i = 0; i < window.aplayers.length; i++) {
|
||||
if (!window.aplayers[i].options.fixed) {
|
||||
window.aplayers[i].destroy()
|
||||
var htmlText = '';
|
||||
for (let i = 0; i < randomFriendLinks.length; ++i) {
|
||||
var item = randomFriendLinks[i]
|
||||
htmlText += `<a class='footer-item' href='${item.link}' target="_blank" rel="noopener nofollow">${item.name}</a>`;
|
||||
}
|
||||
htmlText += `<a class='footer-item' href='/links'>更多</a>`
|
||||
document.getElementById("friend-links-in-footer").innerHTML = htmlText;
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
typeof typed === 'object' && typed.destroy()
|
||||
<div id="js-pjax"></div>
|
||||
|
||||
//reset readmode
|
||||
const $bodyClassList = document.body.classList
|
||||
$bodyClassList.contains('read-mode') && $bodyClassList.remove('read-mode')
|
||||
})
|
||||
|
||||
document.addEventListener('pjax:complete', function () {
|
||||
window.refreshFn()
|
||||
<script>
|
||||
let pjaxSelectors = ['title', '#config-diff', '#body-wrap', '#rightside-config-hide', '#rightside-config-show', '.js-pjax','#site-config']
|
||||
|
||||
document.querySelectorAll('script[data-pjax]').forEach(item => {
|
||||
if (false) {
|
||||
pjaxSelectors.unshift('meta[property="og:image"]', 'meta[property="og:title"]', 'meta[property="og:url"]')
|
||||
}
|
||||
|
||||
var pjax = new Pjax({
|
||||
elements: 'a:not([target="_blank"])',
|
||||
selectors: pjaxSelectors,
|
||||
cacheBust: false,
|
||||
analytics: false,
|
||||
scrollRestoration: false
|
||||
})
|
||||
|
||||
document.addEventListener('pjax:send', function () {
|
||||
|
||||
// removeEventListener toc scroll
|
||||
window.removeEventListener('scroll', window.tocScrollFn)
|
||||
|
||||
typeof preloader === 'object' && preloader.initLoading()
|
||||
|
||||
if (window.aplayers) {
|
||||
for (let i = 0; i < window.aplayers.length; i++) {
|
||||
if (!window.aplayers[i].options.fixed) {
|
||||
window.aplayers[i].destroy()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
typeof typed === 'object' && typed.destroy()
|
||||
|
||||
//reset readmode
|
||||
const $bodyClassList = document.body.classList
|
||||
$bodyClassList.contains('read-mode') && $bodyClassList.remove('read-mode')
|
||||
})
|
||||
|
||||
document.addEventListener('pjax:complete', function () {
|
||||
window.refreshFn()
|
||||
|
||||
document.querySelectorAll('script[data-pjax]').forEach(item => {
|
||||
const newScript = document.createElement('script')
|
||||
const content = item.text || item.textContent || item.innerHTML || ""
|
||||
Array.from(item.attributes).forEach(attr => newScript.setAttribute(attr.name, attr.value))
|
||||
newScript.appendChild(document.createTextNode(content))
|
||||
item.parentNode.replaceChild(newScript, item)
|
||||
}
|
||||
)
|
||||
)
|
||||
|
||||
GLOBAL_CONFIG.lazyload.enable && window.lazyLoadInstance.update()
|
||||
GLOBAL_CONFIG.lazyload.enable && window.lazyLoadInstance.update()
|
||||
|
||||
typeof chatBtnFn === 'function' && chatBtnFn()
|
||||
typeof panguInit === 'function' && panguInit()
|
||||
typeof chatBtnFn === 'function' && chatBtnFn()
|
||||
typeof panguInit === 'function' && panguInit()
|
||||
|
||||
// google analytics
|
||||
typeof gtag === 'function' && gtag('config', '', {
|
||||
'page_path': window.location.pathname
|
||||
});
|
||||
// google analytics
|
||||
typeof gtag === 'function' && gtag('config', '', {
|
||||
'page_path': window.location.pathname
|
||||
});
|
||||
|
||||
// baidu analytics
|
||||
typeof _hmt === 'object' && _hmt.push(['_trackPageview', window.location.pathname]);
|
||||
// baidu analytics
|
||||
typeof _hmt === 'object' && _hmt.push(['_trackPageview', window.location.pathname]);
|
||||
|
||||
typeof loadMeting === 'function' && document.getElementsByClassName('aplayer').length && loadMeting()
|
||||
typeof loadMeting === 'function' && document.getElementsByClassName('aplayer').length && loadMeting()
|
||||
|
||||
// Analytics
|
||||
if (false) {
|
||||
MtaH5.pgv()
|
||||
}
|
||||
// Analytics
|
||||
if (false) {
|
||||
MtaH5.pgv()
|
||||
}
|
||||
|
||||
// prismjs
|
||||
typeof Prism === 'object' && Prism.highlightAll()
|
||||
// prismjs
|
||||
typeof Prism === 'object' && Prism.highlightAll()
|
||||
|
||||
typeof preloader === 'object' && preloader.endLoading()
|
||||
})
|
||||
typeof preloader === 'object' && preloader.endLoading()
|
||||
})
|
||||
|
||||
document.addEventListener('pjax:error', (e) => {
|
||||
document.addEventListener('pjax:error', (e) => {
|
||||
if (e.request.status === 404) {
|
||||
pjax.loadUrl('/404')
|
||||
}
|
||||
}
|
||||
)
|
||||
)
|
||||
</script>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<script data-pjax="">
|
||||
|
||||
|
||||
if ([[${ theme.config.post.dynamicBackground }]]) {
|
||||
// 图片主色
|
||||
coverColor();
|
||||
}
|
||||
|
||||
if ([[${ theme.config.other.loadingBox }]]) {
|
||||
// 移除加载动画
|
||||
removeLoading();
|
||||
}
|
||||
navTitle();
|
||||
heo.topPostScroll();
|
||||
heo.topCategoriesBarScroll();
|
||||
heo.sayhi();
|
||||
heo.addTag();
|
||||
heo.stopImgRightDrag();
|
||||
heo.qrcodeCreate();
|
||||
heo.onlyHome();
|
||||
heo.addNavBackgroundInit();
|
||||
//heo.addMediumInEssay();
|
||||
heo.darkModeStatus();
|
||||
// heo.categoriesBarActive();
|
||||
heo.initThemeColor();
|
||||
//页脚友联
|
||||
if(GLOBAL_CONFIG.isFriendLinksInFooter){
|
||||
link.addFriendLinksInFooter()
|
||||
}
|
||||
|
||||
//右下角 snackbar 弹窗
|
||||
if ([[${ theme.config.snackbar.switch }]]) {
|
||||
heo.hidecookie()
|
||||
}
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<script data-pjax="">
|
||||
|
||||
|
||||
if ([[${ theme.config.post.dynamicBackground }]]) {
|
||||
// 图片主色
|
||||
coverColor();
|
||||
}
|
||||
|
||||
if ([[${ theme.config.other.loadingBox }]]) {
|
||||
// 移除加载动画
|
||||
removeLoading();
|
||||
}
|
||||
navTitle();
|
||||
heo.topPostScroll();
|
||||
heo.topCategoriesBarScroll();
|
||||
heo.sayhi();
|
||||
heo.addTag();
|
||||
heo.stopImgRightDrag();
|
||||
heo.qrcodeCreate();
|
||||
heo.onlyHome();
|
||||
heo.addNavBackgroundInit();
|
||||
//heo.addMediumInEssay();
|
||||
heo.darkModeStatus();
|
||||
// heo.categoriesBarActive();
|
||||
heo.initThemeColor();
|
||||
//页脚友链
|
||||
link.addFriendLinksInFooter();
|
||||
|
||||
//右下角 snackbar 弹窗
|
||||
if ([[${ theme.config.snackbar.switch }]]) {
|
||||
heo.hidecookie()
|
||||
}
|
||||
|
||||
|
||||
</script>
|
||||
</body>
|
||||
|
||||
</html>
|
|
@ -52,13 +52,12 @@
|
|||
th:each="tag : ${post.tags}"
|
||||
th:href="@{${tag.status.permalink}}"
|
||||
th:title="${tag.spec.displayName}">
|
||||
<span class="tags-punctuation">#</span>[[${#strings.trim(tag.spec.displayName)}]]
|
||||
<span class="tags-punctuation">[[${#strings.trim(tag.spec.displayName)}]]</span>
|
||||
</a>
|
||||
</span>
|
||||
</th:block>
|
||||
<!-- 创建时间 -->
|
||||
<span class="post-meta-date"
|
||||
th:with="days=${(new java.util.Date().getTime()-post.spec.publishTime.toEpochMilli())/86400000}">
|
||||
<span class="post-meta-date" th:with="days=${(new java.util.Date().getTime()-post.spec.publishTime.toEpochMilli())/86400000}">
|
||||
<i class="far fa-calendar-alt"></i>
|
||||
<time style="display: inline;"
|
||||
th:datetime="${post.spec.publishTime}"
|
||||
|
|
|
@ -1,15 +1,15 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en" th:replace="~{modules/layouts/layout :: layout(content = ~{::content}, htmlType = 'post')}"
|
||||
xmlns:th="http://www.thymeleaf.org">
|
||||
xmlns:th="http://www.thymeleaf.org">
|
||||
|
||||
<th:block th:fragment="content">
|
||||
<div class="post" id="body-wrap">
|
||||
|
||||
<header class="post-bg" id="page-header">
|
||||
<nav th:replace="~{modules/nav :: nav(title = ${post.spec.title})}"></nav>
|
||||
<div class="coverdiv" id="coverdiv">
|
||||
<div class="coverdiv loaded" id="coverdiv">
|
||||
<img alt="cover" class="nolazyload" id="post-cover"
|
||||
th:src="${#strings.isEmpty(post.spec.cover) ? theme.config.layout.postRandomImg : post.spec.cover}">
|
||||
th:src="${#strings.isEmpty(post.spec.cover) ? theme.config.layout.postRandomImg : post.spec.cover}">
|
||||
</div>
|
||||
|
||||
<div id="post-info">
|
||||
|
@ -18,16 +18,18 @@
|
|||
<!-- 这里要跳转到版权页 -->
|
||||
<!--<a class="post-meta-original" th:href="@{/cc}" title="该文章为原创文章,注意版权协议">原创</a>-->
|
||||
<span class="post-meta-categories" th:each="category : ${post.categories}"
|
||||
th:if="${not #lists.isEmpty(post.categories)}">
|
||||
th:if="${not #lists.isEmpty(post.categories)}">
|
||||
<a class="post-meta-categories" th:href="@{${category.status.permalink}}"
|
||||
th:text="${category.spec.displayName}" th:title="${category.spec.displayName}">
|
||||
th:text="${category.spec.displayName}" th:title="${category.spec.displayName}">
|
||||
</a>
|
||||
</span>
|
||||
<div class="tag_share" th:if="${not #lists.isEmpty(post.tags)}">
|
||||
<div class="post-meta__tag-list">
|
||||
<a class="post-meta__tags" th:each="tag : ${post.tags}"
|
||||
th:href="@{${tag.status.permalink}}" th:text="'#'+${tag.spec.displayName}"
|
||||
th:title="${tag.spec.displayName}"></a>
|
||||
th:href="@{${tag.status.permalink}}"
|
||||
th:title="${tag.spec.displayName}">
|
||||
<span class="tags-name tags-punctuation">[[${tag.spec.displayName}]]</span>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -38,13 +40,13 @@
|
|||
<span class="post-meta-date">
|
||||
<i class="iconfont icon-calendar-alt post-meta-icon"></i>
|
||||
<time th:attr="datetime=${#dates.format(post.spec.publishTime, 'yyyy-MM-dd')}"
|
||||
th:text="${#dates.format(post.spec.publishTime,'yyyy-MM-dd')}"
|
||||
th:title="${#dates.format(post.spec.publishTime,'yyyy-MM-dd')}">
|
||||
th:text="${#dates.format(post.spec.publishTime,'yyyy-MM-dd')}"
|
||||
th:title="${#dates.format(post.spec.publishTime,'yyyy-MM-dd')}">
|
||||
</time>
|
||||
</span>
|
||||
|
||||
<span class="post-meta-wordcount"
|
||||
th:with="wordCount = ${#strings.length(post.content.content)}">
|
||||
th:with="wordCount = ${#strings.length(post.content.content)}">
|
||||
<i class="iconfont icon-file-word post-meta-icon" title="字数"></i>
|
||||
<span class="post-meta-label">字数:</span>
|
||||
<span class="word-count" th:text="${{wordCount}}"></span>
|
||||
|
@ -61,13 +63,12 @@
|
|||
<span class="post-meta-label">热度:</span>
|
||||
<span id="visit" th:text="${post.stats.visit}"></span>
|
||||
</span>
|
||||
<span th:if="${post.spec.allowComment}" class="post-meta-commentcount"
|
||||
onclick="heo.scrollTo('#post-comment');" title="评论数">
|
||||
<span th:if="${post.spec.allowComment}" class="post-meta-commentcount" onclick="heo.scrollTo('#post-comment');" title="评论数">
|
||||
<i class="iconfont icon-comment-alt"></i>
|
||||
<span class="post-meta-label">评论:</span>
|
||||
<a th:if="${#strings.equals(theme.config.comments.use, 'commentWidget')}"
|
||||
href="#post-comment"><span id="comment-count"
|
||||
th:text="${post.stats.comment}"></span></a>
|
||||
href="#post-comment"><span id="comment-count"
|
||||
th:text="${post.stats.comment}"></span></a>
|
||||
|
||||
<a th:if="${#strings.equals(theme.config.comments.use, 'Twikoo')}" href="#post-comment">
|
||||
<span id="twikoo-count"></span></a>
|
||||
|
@ -78,11 +79,11 @@
|
|||
</div>
|
||||
<section class="main-hero-waves-area waves-area">
|
||||
<svg class="waves-svg" preserveAspectRatio="none" shape-rendering="auto" viewBox="0 24 150 28"
|
||||
xlink="http://www.w3.org/1999/xlink" xmlns="http://www.w3.org/2000/svg">
|
||||
xlink="http://www.w3.org/1999/xlink" xmlns="http://www.w3.org/2000/svg">
|
||||
<defs>
|
||||
<path
|
||||
d="M -160 44 c 30 0 58 -18 88 -18 s 58 18 88 18 s 58 -18 88 -18 s 58 18 88 18 v 44 h -352 Z"
|
||||
id="gentle-wave"></path>
|
||||
d="M -160 44 c 30 0 58 -18 88 -18 s 58 18 88 18 s 58 -18 88 -18 s 58 18 88 18 v 44 h -352 Z"
|
||||
id="gentle-wave"></path>
|
||||
</defs>
|
||||
<g class="parallax">
|
||||
<use href="#gentle-wave" x="48" y="0"></use>
|
||||
|
@ -445,7 +446,7 @@
|
|||
|
||||
<!-- 打赏 -->
|
||||
<div th:if="${theme.config.post.reward.enable_reward && (not #strings.isEmpty(theme.config.post.reward.wxPay) || not #strings.isEmpty(theme.config.post.reward.alipay))}"
|
||||
class="post-reward" onclick="AddRewardMask()">
|
||||
class="post-reward" onclick="AddRewardMask()">
|
||||
<div class="reward-button button--animated" title="赞赏作者"><i
|
||||
class="fas fa-hamburger"></i>
|
||||
打赏作者
|
||||
|
@ -454,20 +455,19 @@
|
|||
<ul class="reward-all"><span class="reward-title">感谢你赐予我前进的力量</span>
|
||||
<ul class="reward-group">
|
||||
<li class="reward-item"><a th:href="@{${theme.config.post.reward.wxPay}}"
|
||||
target="_blank">
|
||||
<img alt="微信" class="post-qr-code-img"
|
||||
th:src="${theme.config.post.reward.wxPay}"></a>
|
||||
target="_blank">
|
||||
<img alt="微信" class="post-qr-code-img"
|
||||
th:src="${theme.config.post.reward.wxPay}"></a>
|
||||
<div class="post-qr-code-desc">微信</div>
|
||||
</li>
|
||||
<li class="reward-item"><a th:href="@{${theme.config.post.reward.alipay}}"
|
||||
target="_blank"><img alt="支付宝"
|
||||
class="post-qr-code-img"
|
||||
th:src="${theme.config.post.reward.alipay}"></a>
|
||||
target="_blank"><img alt="支付宝" class="post-qr-code-img"
|
||||
th:src="${theme.config.post.reward.alipay}"></a>
|
||||
<div class="post-qr-code-desc">支付宝</div>
|
||||
</li>
|
||||
</ul>
|
||||
<a class="reward-main-btn" th:href="@{${theme.config.post.reward.reward_md_url}}"
|
||||
target="_blank">
|
||||
target="_blank">
|
||||
<div class="reward-text">赞赏者名单</div>
|
||||
<div class="reward-dec">因为你们的支持让我意识到写文章的价值🙏</div>
|
||||
</a>
|
||||
|
@ -478,14 +478,13 @@
|
|||
<!-- 说明 -->
|
||||
<div th:if="${theme.config.post.post_edit.enable_post_edit}" class="reward-link mode"><a
|
||||
class="reward-link-button" th:href="@{${theme.config.post.post_edit.post_edit_url}}">
|
||||
<i class="fas fa-seedling"></i>运营模式与责任</a>
|
||||
<i class="fas fa-seedling"></i>运营模式与责任</a>
|
||||
</div>
|
||||
|
||||
<!-- 分享 -->
|
||||
<div class="share-link mobile">
|
||||
<div class="share-qrcode">
|
||||
<div class="share-button" title="使用手机访问这篇文章"><i
|
||||
class="iconfont icon-qrcode"></i>
|
||||
<div class="share-button" title="使用手机访问这篇文章"><i class="iconfont icon-qrcode"></i>
|
||||
</div>
|
||||
<div class="share-main">
|
||||
<div class="share-main-all">
|
||||
|
@ -497,8 +496,8 @@
|
|||
</div>
|
||||
<div class="share-link weibo">
|
||||
<a class="share-button" rel="noopener external nofollow noreferrer noopener" target="_blank"
|
||||
th:href="'https://service.weibo.com/share/share.php?title=' + ${post.spec.title}"
|
||||
title="分享到微博">
|
||||
th:href="'https://service.weibo.com/share/share.php?title=' + ${post.spec.title}"
|
||||
title="分享到微博">
|
||||
<i class="iconfont icon-weibo" style="font-size:22px"></i></a>
|
||||
</div>
|
||||
<div class="share-link copyurl">
|
||||
|
@ -510,10 +509,9 @@
|
|||
<div class="tag_share">
|
||||
<div class="post-meta__tag-list">
|
||||
<a class="post-meta__tags" th:each="tag : ${post.tags}"
|
||||
th:href="@{${tag.status.permalink}}">
|
||||
<span class="tags-punctuation">#</span>
|
||||
<th:block th:text="${tag.spec.displayName}" th:title="${tag.spec.displayName}">
|
||||
</th:block>
|
||||
th:href="@{${tag.status.permalink}}">
|
||||
<span class="tags-punctuation">[[${tag.spec.displayName}]]</span>
|
||||
|
||||
<span class="tagsPageCount" th:text="${tag.status.visiblePostCount}"></span>
|
||||
</a>
|
||||
</div>
|
||||
|
@ -526,7 +524,7 @@
|
|||
<div class="post-copyright__author">
|
||||
<!-- 版权页 以及版权描述文字 -->
|
||||
<a class="post-copyright__original" th:href="@{${theme.config.basics.copyrightAgreement}}"
|
||||
title="该文章为原创文章,注意版权协议">原创</a>
|
||||
title="该文章为原创文章,注意版权协议">原创</a>
|
||||
<a class="post-copyright-title" href="#"><span th:text="${post.spec.title}"></span></a>
|
||||
</div>
|
||||
<div class="post-copyright__type">
|
||||
|
@ -542,7 +540,7 @@
|
|||
</div>
|
||||
</div>
|
||||
<nav class="pagination-post" id="pagination"
|
||||
th:with="postCursor = ${postFinder.cursor(post.metadata.name)}">
|
||||
th:with="postCursor = ${postFinder.cursor(post.metadata.name)}">
|
||||
<div class="prev-post pull-left">
|
||||
<a th:if="${postCursor.hasPrevious()}" th:href="@{${postCursor.previous.status.permalink}}">
|
||||
<div class="pagination-info">
|
||||
|
@ -567,12 +565,12 @@
|
|||
<span>阅读建议</span>
|
||||
</div>
|
||||
<div class="relatedPosts-list"
|
||||
th:with="recommandPosts = ${postFinder.listByCategory(1, theme.config.post.recommendQuantity, post.categories.get(0).metadata.name)}">
|
||||
th:with="recommandPosts = ${postFinder.listByCategory(1, theme.config.post.recommendQuantity, post.categories.get(0).metadata.name)}">
|
||||
<!-- 建议阅读,这里可以自定义文章数量,然后遍历展示 -->
|
||||
<div th:each="recommandPost :${recommandPosts}">
|
||||
<a th:href="@{${recommandPost.status.permalink}}" th:title="${recommandPost.spec.title}">
|
||||
<img alt="cover" class="cover" loading="lazy"
|
||||
th:src="${#strings.isEmpty(recommandPost.spec.cover) ? theme.config.layout.postRandomImg : recommandPost.spec.cover}">
|
||||
th:src="${#strings.isEmpty(recommandPost.spec.cover) ? theme.config.layout.postRandomImg : recommandPost.spec.cover}">
|
||||
<div class="content is-center">
|
||||
<div class="date"><i class="far fa-calendar-alt fa-fw"></i>
|
||||
[[${#dates.format(recommandPost.spec.publishTime,'yyyy-MM-dd HH:mm:ss')}]]
|
||||
|
@ -586,11 +584,11 @@
|
|||
<hr>
|
||||
<!-- 评论模块 -->
|
||||
<th:block
|
||||
th:if="${post.spec.allowComment && theme.config.comments.twikoo && #strings.equals(theme.config.comments.use, 'Twikoo') && not #strings.isEmpty(theme.config.comments.envId)}">
|
||||
th:if="${post.spec.allowComment && theme.config.comments.twikoo && #strings.equals(theme.config.comments.use, 'Twikoo') && not #strings.isEmpty(theme.config.comments.envId)}">
|
||||
<div th:replace="~{modules/twikoo :: twikoo}"></div>
|
||||
</th:block>
|
||||
<div id="post-comment"
|
||||
th:if="${post.spec.allowComment && pluginFinder.available('PluginCommentWidget') && #strings.equals(theme.config.comments.use, 'commentWidget')}">
|
||||
th:if="${post.spec.allowComment && pluginFinder.available('PluginCommentWidget') && #strings.equals(theme.config.comments.use, 'commentWidget')}">
|
||||
<div class="comment-head">
|
||||
<div class="comment-headline"><i class="iconfont icon-comment-alt"></i> <span>评论</span></div>
|
||||
<div class="comment-privacy"><a href="/privacy">隐私政策</a></div>
|
||||
|
@ -599,9 +597,9 @@
|
|||
</div>
|
||||
</div>
|
||||
<halo:comment group="content.halo.run" kind="SinglePage" th:attr="name='links'"
|
||||
colorScheme="document.documentElement.getAttribute('data-theme')"/>
|
||||
colorScheme="document.documentElement.getAttribute('data-theme')" />
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<!-- 侧栏 -->
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
th:each="tagItem : ${tags}"
|
||||
th:href="@{${tagItem.status.permalink}}"
|
||||
th:id="${tagItem.spec.displayName}">
|
||||
<span class="tags-punctuation">#</span> [[${tagItem.spec.displayName}]]
|
||||
<span class="tags-punctuation">[[${tagItem.spec.displayName}]]</span>
|
||||
<span class="tagsPageCount" th:text="${tagItem.status.visiblePostCount}"></span>
|
||||
</a>
|
||||
</div>
|
||||
|
@ -43,7 +43,7 @@
|
|||
<div class="article-sort-item-tags">
|
||||
<a class="article-meta__tags" event.cancelbubble onclick="window.event.cancelBubble=!0"
|
||||
th:each="tag : ${post.tags}" th:href="@{${tag.status.permalink}}">
|
||||
<span class="tags-punctuation">#[[${tag.spec.displayName}]]</span>
|
||||
<span class="tags-punctuation">[[${tag.spec.displayName}]]</span>
|
||||
</a>
|
||||
<span class="article-meta__link">•</span>
|
||||
</div>
|
||||
|
|
|
@ -15,8 +15,8 @@
|
|||
<a th:each="tagItem : ${tagFinder.listAll()}"
|
||||
th:href="@{${tagItem.status.permalink}}"
|
||||
th:id="${tagItem.spec.displayName}" th:style="'font-size: 1em; color:' + ${tagItem.spec.color} ">
|
||||
<span class="tags-punctuation">#</span>
|
||||
[[${tagItem.spec.displayName}]]
|
||||
<span class="tags-punctuation">[[${tagItem.spec.displayName}]]</span>
|
||||
|
||||
<span class="tagsPageCount">[[${tagItem.status.visiblePostCount}]]</span>
|
||||
</a>
|
||||
|
||||
|
|
|
@ -27,5 +27,5 @@ spec:
|
|||
repo: 'https://github.com/liuzhihang/halo-theme-hao'
|
||||
settingName: "theme-hao-setting"
|
||||
configMapName: "theme-hao-configMap"
|
||||
version: 1.1.3
|
||||
version: 1.1.2
|
||||
require: 2.0.0
|
||||
|
|
Loading…
Reference in New Issue