修复waline最近评论bug,图库返回按钮
This commit is contained in:
parent
16dcba410d
commit
fedf43ddf1
|
@ -1612,6 +1612,12 @@ spec:
|
|||
key: bigTitle
|
||||
label: 大标题
|
||||
value: 这里是我的相册集哦😯
|
||||
- $formkit: text
|
||||
name: topLink
|
||||
key: topLink
|
||||
if: $get(photosStyle).value == 'default'
|
||||
label: 返回地址 (填写图库分组地址)
|
||||
value: "/album"
|
||||
- $formkit: text
|
||||
if: $get(photosStyle).value == 'default'
|
||||
name: detail
|
||||
|
@ -2295,7 +2301,7 @@ spec:
|
|||
name: lazyload
|
||||
label: 评论懒加载
|
||||
value: false
|
||||
help: 当评论进入浏览器的视窗时,将加载评论系统。
|
||||
help: 当评论进入浏览器的视窗时,将加载评论系统。(不建议使用,定位不到评论位置)
|
||||
options:
|
||||
- label: 打开
|
||||
value: true
|
||||
|
@ -2376,6 +2382,7 @@ spec:
|
|||
serverURL: ""
|
||||
walinesJs: ""
|
||||
walinesCss: ""
|
||||
locale: "{'placeholder': '欢迎评论', 'sofa': '来发评论吧~1'}"
|
||||
children:
|
||||
- $formkit: url
|
||||
name: serverURL
|
||||
|
@ -2396,6 +2403,13 @@ spec:
|
|||
label: Waline评论 - css
|
||||
placeholder: 请输入css文件地址
|
||||
help: 主题的walines版本是最新版本(如果你使用的不是最新版本请自己引入css文件)
|
||||
- $formkit: code
|
||||
name: locale
|
||||
height: 200px
|
||||
label: 选项
|
||||
placeholder: 请输入json格式数据
|
||||
help: "格式:{'placeholder': '欢迎评论', 'sofa': '来发评论吧~1'} 更多请查看文档:https://waline.js.org/cookbook/customize/locale.html#%E4%BE%8B%E5%AD%90"
|
||||
language: json
|
||||
- $formkit: group
|
||||
if: ($get(use).value == 'Twikoo' || $get(use).value == 'Artalk' || $get(use).value == 'Waline' ) && $get(commentsEnable).value
|
||||
name: visitorMail
|
||||
|
|
|
@ -8,6 +8,7 @@
|
|||
dark: 'html[data-theme="dark"]',
|
||||
path: window.location.pathname,
|
||||
comment: false,
|
||||
locale:GLOBAL_CONFIG.source.waline.locale
|
||||
}, null))
|
||||
}
|
||||
|
||||
|
|
|
@ -72,7 +72,7 @@
|
|||
})
|
||||
saveToLocal.set('waline-newest-comments', JSON.stringify(walineArray), 10 / (60 * 24))
|
||||
generateHtml(walineArray)
|
||||
document.querySelector('#newcomm') && necommHtml(artalk)
|
||||
document.querySelector('#newcomm') && necommHtml(walineArray)
|
||||
}).catch(e => {
|
||||
const $dom = document.querySelector('#card-newest-comments .aside-list')
|
||||
$dom.innerHTML = "无法获取评论,请确认相关配置是否正确"
|
||||
|
|
|
@ -184,135 +184,7 @@
|
|||
<!-- icon图标 -->
|
||||
<link rel="stylesheet" th:href="'https://cdn.cbd.int/hao-theme-static@'+${theme.spec.version}+'/icon/iconfont.css'">
|
||||
|
||||
<!-- 声明一些公共信息 -->
|
||||
<script id="site-config" th:inline="javascript">
|
||||
var GLOBAL_CONFIG = {
|
||||
// 页面类型 index,page,post,tag,category
|
||||
htmlType: [[${ htmlType }]],
|
||||
postTitle: [[${ htmlType == 'post' ? post.spec.title : htmlType == 'page' ? singlePage.spec.title : ''}]],
|
||||
isPost: [[${htmlType == 'post'}]],
|
||||
isHome: [[${ htmlType == 'index'}]],
|
||||
copyright: undefined,
|
||||
lightbox: 'fancybox',
|
||||
lazyload: {enable: [[${theme.config.other.vanillaLazyload.enable}]], error: [[@{${theme.config.other.vanillaLazyload.errorImg}}]] },
|
||||
isFriendLinksInFooter: [[${theme.config.footer.footer_group.enable_footer_group}]],
|
||||
loadingBox: [[${theme.config.other.loadingBoxs.loadingBoxEnable}]],
|
||||
loadProgressBar: [[${theme.config.other.loadingBoxs.loadProgressBar}]],
|
||||
navMusicEnable:[[${theme.config.tool.nav_music.nav_musicEnable}]],
|
||||
isMusic: [[${ htmlType == 'music'}]],
|
||||
helloText: [[${#strings.listSplit(theme.config.sidebar.profile.helloText, ',')}]],
|
||||
profileStyle: [[${theme.config.sidebar.profile.profileStyle}]],
|
||||
rightMenuEnable: [[${theme.config.tool.rightMenu.rightMenuEnable}]],
|
||||
source: {
|
||||
links: {
|
||||
linksUrl: [[${ theme.config.link.linksUrl }]],
|
||||
linksNum: [[${theme.config.footer.footer_group.num}]],
|
||||
},
|
||||
jQuery: 'https://lf6-cdn-tos.bytecdntp.com/cdn/expire-1-M/jquery/3.6.0/jquery.min.js',
|
||||
justifiedGallery: {
|
||||
js: 'https://npm.elemecdn.com/flickr-justified-gallery@2.1.2/dist/fjGallery.min.js',
|
||||
css: 'https://npm.elemecdn.com/flickr-justified-gallery@2.1.2/dist/fjGallery.css'
|
||||
},
|
||||
fancybox: {
|
||||
js: 'https://lf6-cdn-tos.bytecdntp.com/cdn/expire-1-M/fancybox/3.5.7/jquery.fancybox.min.js',
|
||||
css: 'https://lf3-cdn-tos.bytecdntp.com/cdn/expire-1-M/fancybox/3.5.7/jquery.fancybox.min.css'
|
||||
},
|
||||
comments:{
|
||||
use: [[${theme.config.comments.use}]],
|
||||
maxBarrage: [[${ theme.config.comments.commentBarrageConfig.maxBarrage }]],
|
||||
barrageTime: [[${ theme.config.comments.commentBarrageConfig.barrageTime }]],
|
||||
mailMd5: "[(${theme.config.comments.commentBarrageConfig.mailMd5})]",
|
||||
lazyload: [[${theme.config.comments.lazyload}]],
|
||||
textarea: [[${ theme.config.comments.use == 'Twikoo' ? 'el-textarea__inner' :
|
||||
theme.config.comments.use == 'Artalk' ? 'atk-textarea' :
|
||||
theme.config.comments.use == 'Waline' ? 'wl-editor' : 'appearance-none' }]]
|
||||
},
|
||||
twikoo:{
|
||||
js:[[${not #strings.isEmpty(theme.config.comments.twikoos.js) ? theme.config.comments.twikoos.js : assets_link +'/libs/twikoo/twikoo.all.min.js' }]],
|
||||
twikooUrl: "[(${theme.config.comments.twikoos.envId})]",
|
||||
accessToken: "[(${theme.config.comments.twikoos.accessToken})]",
|
||||
|
||||
},
|
||||
artalk:{
|
||||
js:[[${not #strings.isEmpty(theme.config.comments.artalks.artalkJs) ? theme.config.comments.artalks.artalkJs : assets_link +'/libs/artalk/Artalk.js' }]],
|
||||
css:[[${not #strings.isEmpty(theme.config.comments.artalks.artalkCss) ? theme.config.comments.artalks.artalkCss : assets_link +'/libs/artalk/Artalk.css' }]],
|
||||
artalkUrl: "[(${theme.config.comments.artalks.server})]",
|
||||
siteName: "[(${theme.config.comments.artalks.siteName})]",
|
||||
},
|
||||
waline:{
|
||||
js:[[${not #strings.isEmpty(theme.config.comments.walines.walinesJs) ? theme.config.comments.walines.walinesJs : 'https://cdn.cbd.int/@waline/client@2.15.7/dist/waline.js' }]],
|
||||
serverURL: "[(${theme.config.comments.walines.serverURL})]",
|
||||
},
|
||||
welcome:{
|
||||
key:"[(${theme.config.sidebar.welcome.key})]",
|
||||
locationLng: [[${theme.config.sidebar.welcome.locationLng}]],
|
||||
locationLat: [[${theme.config.sidebar.welcome.locationLat}]],
|
||||
},
|
||||
post:{
|
||||
dynamicBackground: [[${ theme.config.post.dynamicBackground }]]
|
||||
},
|
||||
tool:{
|
||||
switch: [[${ theme.config.tool.snackbar.switch }]]
|
||||
},
|
||||
postAi:{
|
||||
ai : [[${htmlType != 'post' || !theme.config.post.aiDescription.aiDescriptionEnable ? '' :
|
||||
theme.config.post.aiDescription.mode != 'local' && !theme.config.post.aiDescription.switchBtn ? '' :
|
||||
post.spec.excerpt.autoGenerate ? '本地模式需要自己填写文章摘要' :
|
||||
#strings.isEmpty(post.status.excerpt) ? '请填写文章摘要' : post.status.excerpt }]],
|
||||
randomNum : [[${theme.config.post.aiDescription.randomNum}]],
|
||||
basicWordCount : [[${theme.config.post.aiDescription.basicWordCount}]],
|
||||
btnLink : "[(${theme.config.post.aiDescription.btnLink})]",
|
||||
gptName : "[(${theme.config.post.aiDescription.gptName})]",
|
||||
modeName : [[${theme.config.post.aiDescription.mode}]],
|
||||
switchBtn : [[${theme.config.post.aiDescription.switchBtn}]],
|
||||
keys : "[(${theme.config.post.aiDescription.key})]",
|
||||
Referers : "[(${theme.config.post.aiDescription.Referer})]",
|
||||
},
|
||||
img:{
|
||||
src: [[${isLazyload ? 'data-lazy-src' : 'src' }]]
|
||||
}
|
||||
|
||||
},
|
||||
date_suffix: {
|
||||
just: '刚刚',
|
||||
min: '分钟前',
|
||||
hour: '小时前',
|
||||
day: '天前',
|
||||
month: '个月前'
|
||||
},
|
||||
Snackbar: {
|
||||
chs_to_cht: "你已切换为繁体",
|
||||
cht_to_chs: "你已切换为简体",
|
||||
day_to_night: "你已切换为深色模式",
|
||||
night_to_day: "你已切换为浅色模式",
|
||||
bgLight: "[(${theme.config.style.themeLightSkin})]",
|
||||
bgDark: "[(${theme.config.style.themeDarkSkin})]",
|
||||
position: "top-center",
|
||||
},
|
||||
translate: {
|
||||
defaultEncoding:[[${theme.config.style.translate.defaultEncoding}]],
|
||||
translateDelay:0,
|
||||
msgToTraditionalChinese:"繁",
|
||||
msgToSimplifiedChinese:"简",
|
||||
rightMenuMsgToTraditionalChinese:"轉為繁體",
|
||||
rightMenuMsgToSimplifiedChinese:"转为简体"
|
||||
},
|
||||
prism: {
|
||||
enable: [[${ theme.config.code.enable }]],
|
||||
enable_title: [[${ theme.config.code.enable_title }]],
|
||||
enable_hr: [[${ theme.config.code.enable_hr }]],
|
||||
enable_line: [[${ theme.config.code.enable_line }]],
|
||||
enable_copy: [[${ theme.config.code.enable_copy }]],
|
||||
enable_expander: [[${ theme.config.code.enable_expander }]],
|
||||
prism_limit: Number([[${#strings.isEmpty(theme.config.code.height_limit) ? 300 : theme.config.code.height_limit}]])+30,
|
||||
enable_height_limit: [[${theme.config.code.enable_height_limit}]]
|
||||
},
|
||||
|
||||
|
||||
|
||||
};
|
||||
|
||||
</script>
|
||||
<th:block th:replace="~{modules/variables/site-config :: site-config}" />
|
||||
|
||||
|
||||
</th:block>
|
||||
|
|
|
@ -0,0 +1,132 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en" xmlns:th="http://www.thymeleaf.org">
|
||||
<th:block th:fragment="site-config">
|
||||
<!-- 声明一些公共信息 -->
|
||||
<script id="site-config" th:inline="javascript">
|
||||
var GLOBAL_CONFIG = {
|
||||
// 页面类型 index,page,post,tag,category
|
||||
htmlType: [[${ htmlType }]],
|
||||
postTitle: [[${ htmlType == 'post' ? post.spec.title : htmlType == 'page' ? singlePage.spec.title : ''}]],
|
||||
isPost: [[${htmlType == 'post'}]],
|
||||
isHome: [[${ htmlType == 'index'}]],
|
||||
copyright: undefined,
|
||||
lightbox: 'fancybox',
|
||||
lazyload: {enable: [[${theme.config.other.vanillaLazyload.enable}]], error: [[@{${theme.config.other.vanillaLazyload.errorImg}}]] },
|
||||
isFriendLinksInFooter: [[${theme.config.footer.footer_group.enable_footer_group}]],
|
||||
loadingBox: [[${theme.config.other.loadingBoxs.loadingBoxEnable}]],
|
||||
loadProgressBar: [[${theme.config.other.loadingBoxs.loadProgressBar}]],
|
||||
navMusicEnable:[[${theme.config.tool.nav_music.nav_musicEnable}]],
|
||||
isMusic: [[${ htmlType == 'music'}]],
|
||||
helloText: [[${#strings.listSplit(theme.config.sidebar.profile.helloText, ',')}]],
|
||||
profileStyle: [[${theme.config.sidebar.profile.profileStyle}]],
|
||||
rightMenuEnable: [[${theme.config.tool.rightMenu.rightMenuEnable}]],
|
||||
date_suffix: {
|
||||
just: '刚刚',
|
||||
min: '分钟前',
|
||||
hour: '小时前',
|
||||
day: '天前',
|
||||
month: '个月前'
|
||||
},
|
||||
Snackbar: {
|
||||
chs_to_cht: "你已切换为繁体",
|
||||
cht_to_chs: "你已切换为简体",
|
||||
day_to_night: "你已切换为深色模式",
|
||||
night_to_day: "你已切换为浅色模式",
|
||||
bgLight: "[(${theme.config.style.themeLightSkin})]",
|
||||
bgDark: "[(${theme.config.style.themeDarkSkin})]",
|
||||
position: "top-center",
|
||||
},
|
||||
translate: {
|
||||
defaultEncoding:[[${theme.config.style.translate.defaultEncoding}]],
|
||||
translateDelay:0,
|
||||
msgToTraditionalChinese:"繁",
|
||||
msgToSimplifiedChinese:"简",
|
||||
rightMenuMsgToTraditionalChinese:"轉為繁體",
|
||||
rightMenuMsgToSimplifiedChinese:"转为简体"
|
||||
},
|
||||
prism: {
|
||||
enable: [[${ theme.config.code.enable }]],
|
||||
enable_title: [[${ theme.config.code.enable_title }]],
|
||||
enable_hr: [[${ theme.config.code.enable_hr }]],
|
||||
enable_line: [[${ theme.config.code.enable_line }]],
|
||||
enable_copy: [[${ theme.config.code.enable_copy }]],
|
||||
enable_expander: [[${ theme.config.code.enable_expander }]],
|
||||
prism_limit: Number([[${#strings.isEmpty(theme.config.code.height_limit) ? 300 : theme.config.code.height_limit}]])+30,
|
||||
enable_height_limit: [[${theme.config.code.enable_height_limit}]]
|
||||
},
|
||||
source: {
|
||||
links: {
|
||||
linksUrl: [[${ theme.config.link.linksUrl }]],
|
||||
linksNum: [[${theme.config.footer.footer_group.num}]],
|
||||
},
|
||||
jQuery: 'https://lf6-cdn-tos.bytecdntp.com/cdn/expire-1-M/jquery/3.6.0/jquery.min.js',
|
||||
justifiedGallery: {
|
||||
js: 'https://npm.elemecdn.com/flickr-justified-gallery@2.1.2/dist/fjGallery.min.js',
|
||||
css: 'https://npm.elemecdn.com/flickr-justified-gallery@2.1.2/dist/fjGallery.css'
|
||||
},
|
||||
fancybox: {
|
||||
js: 'https://lf6-cdn-tos.bytecdntp.com/cdn/expire-1-M/fancybox/3.5.7/jquery.fancybox.min.js',
|
||||
css: 'https://lf3-cdn-tos.bytecdntp.com/cdn/expire-1-M/fancybox/3.5.7/jquery.fancybox.min.css'
|
||||
},
|
||||
comments:{
|
||||
use: [[${theme.config.comments.use}]],
|
||||
maxBarrage: [[${ theme.config.comments.commentBarrageConfig.maxBarrage }]],
|
||||
barrageTime: [[${ theme.config.comments.commentBarrageConfig.barrageTime }]],
|
||||
mailMd5: "[(${theme.config.comments.commentBarrageConfig.mailMd5})]",
|
||||
lazyload: [[${theme.config.comments.lazyload}]],
|
||||
textarea: [[${ theme.config.comments.use == 'Twikoo' ? 'el-textarea__inner' :
|
||||
theme.config.comments.use == 'Artalk' ? 'atk-textarea' :
|
||||
theme.config.comments.use == 'Waline' ? 'wl-editor' : 'appearance-none' }]]
|
||||
},
|
||||
welcome:{
|
||||
key:"[(${theme.config.sidebar.welcome.key})]",
|
||||
locationLng: [[${theme.config.sidebar.welcome.locationLng}]],
|
||||
locationLat: [[${theme.config.sidebar.welcome.locationLat}]]
|
||||
},
|
||||
post:{
|
||||
dynamicBackground: [[${ theme.config.post.dynamicBackground }]]
|
||||
},
|
||||
tool:{
|
||||
switch: [[${ theme.config.tool.snackbar.switch }]]
|
||||
},
|
||||
postAi:{
|
||||
ai : [[${htmlType != 'post' || !theme.config.post.aiDescription.aiDescriptionEnable ? '' :
|
||||
theme.config.post.aiDescription.mode != 'local' && !theme.config.post.aiDescription.switchBtn ? '' :
|
||||
post.spec.excerpt.autoGenerate ? '本地模式需要自己填写文章摘要' :
|
||||
#strings.isEmpty(post.status.excerpt) ? '请填写文章摘要' : post.status.excerpt }]],
|
||||
randomNum : [[${theme.config.post.aiDescription.randomNum}]],
|
||||
basicWordCount : [[${theme.config.post.aiDescription.basicWordCount}]],
|
||||
btnLink : "[(${theme.config.post.aiDescription.btnLink})]",
|
||||
gptName : "[(${theme.config.post.aiDescription.gptName})]",
|
||||
modeName : [[${theme.config.post.aiDescription.mode}]],
|
||||
switchBtn : [[${theme.config.post.aiDescription.switchBtn}]],
|
||||
keys : "[(${theme.config.post.aiDescription.key})]",
|
||||
Referers : "[(${theme.config.post.aiDescription.Referer})]",
|
||||
},
|
||||
img:{
|
||||
src: [[${isLazyload ? 'data-lazy-src' : 'src' }]]
|
||||
},
|
||||
twikoo:{
|
||||
js:[[${not #strings.isEmpty(theme.config.comments.twikoos.js) ? theme.config.comments.twikoos.js : assets_link +'/libs/twikoo/twikoo.all.min.js' }]],
|
||||
twikooUrl: "[(${theme.config.comments.twikoos.envId})]",
|
||||
accessToken: "[(${theme.config.comments.twikoos.accessToken})]",
|
||||
|
||||
},
|
||||
artalk:{
|
||||
js:[[${not #strings.isEmpty(theme.config.comments.artalks.artalkJs) ? theme.config.comments.artalks.artalkJs : assets_link +'/libs/artalk/Artalk.js' }]],
|
||||
css:[[${not #strings.isEmpty(theme.config.comments.artalks.artalkCss) ? theme.config.comments.artalks.artalkCss : assets_link +'/libs/artalk/Artalk.css' }]],
|
||||
artalkUrl: "[(${theme.config.comments.artalks.server})]",
|
||||
siteName: "[(${theme.config.comments.artalks.siteName})]",
|
||||
},
|
||||
waline:{
|
||||
js:[[${not #strings.isEmpty(theme.config.comments.walines.walinesJs) ? theme.config.comments.walines.walinesJs : 'https://cdn.cbd.int/@waline/client@2.15.7/dist/waline.js' }]],
|
||||
serverURL: "[(${theme.config.comments.walines.serverURL})]",
|
||||
locale: [(${not #strings.isEmpty(theme.config.comments.walines.locale) ? theme.config.comments.walines.locale : {} })]
|
||||
},
|
||||
},
|
||||
|
||||
};
|
||||
|
||||
</script>
|
||||
</th:block>
|
||||
</html>
|
|
@ -15,12 +15,22 @@
|
|||
<th:block th:each="group : ${photoFinder.groupBy()}">
|
||||
<th:block th:if="${#strings.equals(group.metadata.name, param.photo_group_name)}" th:with="description = ${#annotations.get(group, 'description')},
|
||||
background = ${#annotations.get(group, 'background')}">
|
||||
<th:div th:replace="~{macro/author-content :: author-content(background = ${background},
|
||||
smallTitle = '相册集',
|
||||
bigTitle = ${group.spec.displayName},
|
||||
detail = ${description},
|
||||
buttonUrl = '',
|
||||
buttonTitle = '')}" />
|
||||
<div class="author-content author-content-item essayPage single"
|
||||
th:style="'background:url('+${background}+') left 28% / cover no-repeat !important;'">
|
||||
<div class="card-content">
|
||||
<div class="author-content-item-tips" text="相册集"></div>
|
||||
<span class="author-content-item-title" th:text="${group.spec.displayName}"></span>
|
||||
<div class="content-bottom">
|
||||
<div class="tips" th:text="${description}"></div>
|
||||
</div>
|
||||
<div class="banner-button-group">
|
||||
<a class="banner-button" target="_blank" th:attr="onclick='pjax.loadUrl(\''+ ${theme.config.photos.topLink} +'\')'">
|
||||
<i class="haofont hao-icon-circle-arrow-right"></i>
|
||||
<span class="banner-button-text" th:text="返回"></span>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</th:block>
|
||||
</th:block>
|
||||
<div id="article-container">
|
||||
|
|
Loading…
Reference in New Issue