chore: 适配

This commit is contained in:
nineya 2023-03-25 02:04:42 +08:00
parent 3391059c25
commit 9844cc41fd
22 changed files with 161 additions and 475 deletions

View File

@ -388,8 +388,8 @@ const commonContext = {
sparkInput() { sparkInput() {
const sparkInputContent = DreamConfig.spark_input_content && DreamConfig.spark_input_content.filter(s => s.length > 0) const sparkInputContent = DreamConfig.spark_input_content && DreamConfig.spark_input_content.filter(s => s.length > 0)
if (sparkInputContent && sparkInputContent.length > 0) { if (sparkInputContent && sparkInputContent.length > 0) {
Utils.cachedScript(`${DreamConfig.theme_base}/source/js/spark-input.min.js?mew=${DreamConfig.theme_version}`, function () { Utils.cachedScript(`${DreamConfig.theme_base}/js/spark-input.min.js?mew=${DreamConfig.theme_version}`, function () {
$('.spark-input').each((index, domEle) => sparkInput(domEle, sparkInputContent)) $('.spark-input').each((index, domEle) => sparkInput(domEle, [domEle.innerText, ...sparkInputContent]))
}) })
} }
}, },

View File

@ -1,58 +0,0 @@
let journalContextInitial = false
const journalContext = {
/* 初始化事件 */
initEvent() {
if (journalContextInitial) return
let $body = $('body')
// 展开和关闭评论区事件
$body.on('click', '.journal .comment', function () {
$(this).parent().parent().siblings('.journal-comment').stop().slideToggle(200)
})
// 折叠日志区域
$body.on('click', '.journal-content>.expand-done', function () {
Utils.foldBlock($(this).parent())
})
$body.on('click', '.journal-operation-item>.share', function () {
let $journal = $(this).parents('.journal')
let title = '动态: ' + $journal.find('.journal-date>em').text()
let desc = $journal.children('.journal-content').children('.main-content').text()
DShare.sharePoster({
image: DreamConfig.journals_share_image,
title: title,
description: desc.length > 220 ? desc.substring(0, 220) + '...' :desc
})
})
Utils.initLikeEvent('.journal .like', 'journals', ($elem) => $elem.next())
journalContextInitial = true
},
/* 点赞 */
initLike() {
Utils.initLikeButton('.journal .like', 'journals')
},
/* 折叠日志区域 */
foldJournals() {
const $journals = $('.journal .journal-content')
$journals.each(function () {
const $this = $(this)
if (this.scrollHeight >= DreamConfig.journals_fold_height) {
$this.append('<div class="expand-done"><i class="fa fa-angle-double-up"></i></div>')
} else {
$this.removeClass('fold')
}
})
},
}
window.journalPjax = function (serialNumber) {
if ($('.card.journal').length === 0) return
Object.keys(journalContext).forEach(
(c) => window.pjaxSerialNumber === serialNumber && journalContext[c]()
)
}
!(function () {
!window.pjaxSerialNumber && journalContext.initEvent()
!window.pjaxSerialNumber && journalContext.initLike()
document.addEventListener('DOMContentLoaded', function () {
!window.pjaxSerialNumber && journalContext.foldJournals()
})
})()

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1 +0,0 @@
(()=>{let e=!1;const i={initEvent(){var n;e||((n=$("body")).on("click",".journal .comment",function(){$(this).parent().parent().siblings(".journal-comment").stop().slideToggle(200)}),n.on("click",".journal-content>.expand-done",function(){Utils.foldBlock($(this).parent())}),n.on("click",".journal-operation-item>.share",function(){var n=$(this).parents(".journal"),e="动态: "+n.find(".journal-date>em").text(),n=n.children(".journal-content").children(".main-content").text();DShare.sharePoster({image:DreamConfig.journals_share_image,title:e,description:220<n.length?n.substring(0,220)+"...":n})}),Utils.initLikeEvent(".journal .like","journals",n=>n.next()),e=!0)},initLike(){Utils.initLikeButton(".journal .like","journals")},foldJournals(){$(".journal .journal-content").each(function(){var n=$(this);this.scrollHeight>=DreamConfig.journals_fold_height?n.append('<div class="expand-done"><i class="fa fa-angle-double-up"></i></div>'):n.removeClass("fold")})}};window.journalPjax=function(e){0!==$(".card.journal").length&&Object.keys(i).forEach(n=>window.pjaxSerialNumber===e&&i[n]())},window.pjaxSerialNumber||i.initEvent(),window.pjaxSerialNumber||i.initLike(),document.addEventListener("DOMContentLoaded",function(){window.pjaxSerialNumber||i.foldJournals()})})();

View File

@ -3,7 +3,7 @@
class="banner" class="banner"
th:style="${'background-image: url(' + theme.config.basic_style.banner_image + ')'}"> th:style="${'background-image: url(' + theme.config.basic_style.banner_image + ')'}">
<div class="banner-info"> <div class="banner-info">
<div class="banner-info-title" th:text="${site.title}">$</div> <div class="banner-info-title" th:text="${site.title}"></div>
<div class="banner-info-desc" th:text="${theme.config.basic_style.banner_description}"></div> <div class="banner-info-desc" th:text="${theme.config.basic_style.banner_description}"></div>
</div> </div>
<svg class="banner-waves" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 24 150 28" preserveAspectRatio="none" shape-rendering="auto"> <svg class="banner-waves" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 24 150 28" preserveAspectRatio="none" shape-rendering="auto">

View File

@ -1,26 +1,15 @@
<head xmlns:th="https://www.thymeleaf.org"> <head xmlns:th="https://www.thymeleaf.org">
<style th:inline="css"> <style th:inline="css"
/*<#assign fontSrc=(settings.web_font?? && settings.web_font!='default')?then((settings.web_font=='custom')?then((settings.custom_font?? && settings.custom_font!='')?then(settings.custom_font, ''), '${theme_base!}/source/font/${settings.web_font}'), '')>*/ th:with="fontSrc = ${theme.config.basic_style.web_font != 'default' ? theme.config.basic_style.web_font == 'custom' ? theme.config.basic_style.custom_font : #theme.assets('/font/' + theme.config.basic_style.web_font) : ''},
/*<#if fontSrc!=''>*/ fontFormat = ${fontSrc.endsWith('.ttf') ? 'truetype' : fontSrc.endsWith('.eot') ? 'embedded-opentype' : fontSrc.replaceAll('^.*\.([\w]+)$', '$1')}">
/* <#if fontSrc?ends_with(".woff")>*/ [(${#strings.isEmpty(fontSrc) ? '' : '
/* <#assign fontFormat="woff">*/ @font-face {
/* <#elseif fontSrc?ends_with(".woff2")>*/ font-family: "Dream Font";
/* <#assign fontFormat="woff2">*/ font-display: swap;
/* <#elseif fontSrc?ends_with(".ttf")>*/ font-weight: 400;
/* <#assign fontFormat="truetype">*/ src: url("' + fontSrc + '")' + (#strings.isEmpty(fontFormat)? '' : ' format("' + fontFormat + '")') + ';
/* <#elseif fontSrc?ends_with(".eot")>*/ }'})]
/* <#assign fontFormat="embedded-opentype">*/
/* <#elseif fontSrc?ends_with(".svg")>*/
/* <#assign fontFormat="svg">*/
/* </#if>*/
/*@font-face {*/
/* font-family: "Dream Font";*/
/* font-display: swap;*/
/* font-weight: 400;*/
/* src: url("${fontSrc!}")${(fontFormat??)?then(' format("${fontFormat}")', '')};*/
/*}*/
/*</#if>*/
html { html {
--theme: [(${theme.config.basic_style.theme_color})]; --theme: [(${theme.config.basic_style.theme_color})];
filter: [(${theme.config.enhance.enable_gray_mode ? 'grayscale(1) !important' : 'none'})]; filter: [(${theme.config.enhance.enable_gray_mode ? 'grayscale(1) !important' : 'none'})];
@ -80,9 +69,7 @@
[(${!#strings.isEmpty(theme.config.basic_info.document_hidden_title)?'DreamConfig["document_hidden_title"] = "' + theme.config.basic_info.document_hidden_title + '";': ''})] [(${!#strings.isEmpty(theme.config.basic_info.document_hidden_title)?'DreamConfig["document_hidden_title"] = "' + theme.config.basic_info.document_hidden_title + '";': ''})]
[(${!#strings.isEmpty(theme.config.basic_info.document_visible_title)?'DreamConfig["document_visible_title"] = "' + theme.config.basic_info.document_visible_title + '";' : ''})] [(${!#strings.isEmpty(theme.config.basic_info.document_visible_title)?'DreamConfig["document_visible_title"] = "' + theme.config.basic_info.document_visible_title + '";' : ''})]
[(${!#strings.isEmpty(theme.config.basic_info.website_time)?'DreamConfig["website_time"] = "' + theme.config.basic_info.website_time + '";' : ''})] [(${!#strings.isEmpty(theme.config.basic_info.website_time)?'DreamConfig["website_time"] = "' + theme.config.basic_info.website_time + '";' : ''})]
// <#if settings.enable_color_character!false> [(${(theme.config.sidebar.enable_color_character && !#strings.isEmpty(theme.config.sidebar.color_character))? 'DreamConfig["spark_input_content"] = ["' + #strings.escapeJavaScript(theme.config.sidebar.color_character).replace('\\n', '","') + '"]' : ''})]
// DreamConfig["spark_input_content"] = ['${user.description?trim?replace('\n', '')?js_string}'<#if settings.color_character?? && settings.color_character?trim!=''>, '${settings.color_character?trim?js_string?replace('\\n', "','")}'</#if>];
// </#if>
DreamConfig["notice_show_mode"] = '[(${theme.config.basic_info.notice_show_mode})]'; DreamConfig["notice_show_mode"] = '[(${theme.config.basic_info.notice_show_mode})]';
[(${(!#strings.isEmpty(theme.config.post.img_fold_height) && #numbers.sequence(theme.config.post.img_fold_height,theme.config.post.img_fold_height)[0] >= 400)?'DreamConfig["img_fold_height"] = ' + theme.config.post.img_fold_height + ';': ''})] [(${(!#strings.isEmpty(theme.config.post.img_fold_height) && #numbers.sequence(theme.config.post.img_fold_height,theme.config.post.img_fold_height)[0] >= 400)?'DreamConfig["img_fold_height"] = ' + theme.config.post.img_fold_height + ';': ''})]
[(${theme.config.enhance.cursor_move != 'none'?'DreamConfig["cursor_move"] = "' + theme.config.enhance.cursor_move + '";': ''})] [(${theme.config.enhance.cursor_move != 'none'?'DreamConfig["cursor_move"] = "' + theme.config.enhance.cursor_move + '";': ''})]

View File

@ -28,7 +28,7 @@
</span> </span>
</p> </p>
<p th:if="${!#strings.isEmpty(theme.config.basic_info.record_number_ps)}"><a href="http://www.beian.gov.cn/portal/registerSystemInfo?recordcode=${settings.record_number_ps?replace('[^\\d]','','ri')}" target="_blank" rel="noopener noreferrer nofollow"><img <p th:if="${!#strings.isEmpty(theme.config.basic_info.record_number_ps)}"><a href="http://www.beian.gov.cn/portal/registerSystemInfo?recordcode=${settings.record_number_ps?replace('[^\\d]','','ri')}" target="_blank" rel="noopener noreferrer nofollow"><img
src="https://www.beian.gov.cn/portal/download" alt="公网安备" style="vertical-align: text-top; width: 1.2em; margin-right: 4px;"/>${theme.config.basic_info.record_number_ps}</a></p> src="https://www.beian.gov.cn/portal/download" alt="公网安备" style="vertical-align: text-top; width: 1.2em; margin-right: 4px;"/>[[${theme.config.basic_info.record_number_ps}]]</a></p>
<p th:if="${!#strings.isEmpty(theme.config.basic_info.cloud_by_logo)}">本站由<a <p th:if="${!#strings.isEmpty(theme.config.basic_info.cloud_by_logo)}">本站由<a
class="cloud-driven" target="_blank" rel="noopener noreferrer nofollow" th:href="${theme.config.basic_info.cloud_by_url}"><img class="cloud-driven" target="_blank" rel="noopener noreferrer nofollow" th:href="${theme.config.basic_info.cloud_by_url}"><img
alt="云服务商" src="${theme.config.basic_info.cloud_by_logo}"/></a>提供云服务</p> alt="云服务商" src="${theme.config.basic_info.cloud_by_logo}"/></a>提供云服务</p>

View File

@ -1,5 +1,5 @@
<head xmlns:th="https://www.thymeleaf.org" th:fragment="head" <head xmlns:th="https://www.thymeleaf.org" th:fragment="head"
th:with="description=${isPost ? post.spec.excerpt.raw : site.seo.description}"> th:with="description=${isPost ? post != null ? post.spec.excerpt.raw : singlePage.spec.excerpt.raw : site.seo.description}">
<title th:text="${title}"></title> <title th:text="${title}"></title>
<script th:if="${(theme.config.enhance.enable_sw != 'false')}" th:src="${(theme.config.enhance.enable_sw == 'uninstall')? #theme.assets('/assets/js/sw.min.js') + '?mew=0.0.1' : '/sw.min.js?mew=0.0.1' + theme.config.enhance.enable_sw}"></script> <script th:if="${(theme.config.enhance.enable_sw != 'false')}" th:src="${(theme.config.enhance.enable_sw == 'uninstall')? #theme.assets('/assets/js/sw.min.js') + '?mew=0.0.1' : '/sw.min.js?mew=0.0.1' + theme.config.enhance.enable_sw}"></script>
<meta charset="utf-8"/> <meta charset="utf-8"/>

View File

@ -6,7 +6,7 @@
<div class="column-main"> <div class="column-main">
<th:block th:replace="${content}"/> <th:block th:replace="${content}"/>
</div> </div>
<th:block th:replace="~{common/scripts}"/> <th:block th:include="~{common/scripts}"/>
</body> </body>
</th:block> </th:block>
<th:block th:unless="${!#strings.equals('',param._pjax)}"> <th:block th:unless="${!#strings.equals('',param._pjax)}">
@ -33,7 +33,7 @@
</section> </section>
<th:block th:replace="~{common/actions}"/> <th:block th:replace="~{common/actions}"/>
<th:block th:replace="~{common/footer}"/> <th:block th:replace="~{common/footer}"/>
<th:block th:replace="~{common/scripts}"/> <th:block th:include="~{common/scripts}"/>
</body> </body>
</th:block> </th:block>
</html> </html>

View File

@ -1,3 +1,4 @@
<div xmlns:th="https://www.thymeleaf.org">
<script th:src="@{/assets/js/utils.min.js(mew=${theme.spec.version})}"></script> <script th:src="@{/assets/js/utils.min.js(mew=${theme.spec.version})}"></script>
<!--<#if is_carousel??>--> <!--<#if is_carousel??>-->
<!-- <script data-pjax th:src="@{/assets/lib/swiper@8.4.6/swiper-bundle.min.js}"></script>--> <!-- <script data-pjax th:src="@{/assets/lib/swiper@8.4.6/swiper-bundle.min.js}"></script>-->
@ -25,3 +26,4 @@
<script th:if="${!#strings.isEmpty(theme.config.custom.inline_js_body)}" type="text/javascript" th:text="${theme.config.custom.inline_js_body}"> <script th:if="${!#strings.isEmpty(theme.config.custom.inline_js_body)}" type="text/javascript" th:text="${theme.config.custom.inline_js_body}">
</script> </script>
</div>

View File

@ -1,30 +1,25 @@
<#assign donate = (settings.donate_alipay?? && settings.donate_alipay!='') || (settings.donate_wechat?? && settings.donate_wechat!='') /> <div xmlns:th="https://www.thymeleaf.org"
<#if donate || !is_sheet??> th:with="donate=${!#strings.isEmpty(theme.config.post.donate_alipay) || !#strings.isEmpty(theme.config.post.donate_wechat)}">
<div class="admire"> <div th:if="${donate || type == 'Post'}" class="admire">
<div class="admire-content"> <div class="admire-content">
<#if donate> <button th:if="${donate}" class="donate">
<button class="donate">
<i class="fa fa-credit-card"></i> <i class="fa fa-credit-card"></i>
<span>打赏</span> <span>打赏</span>
<div class="donate-list"> <div class="donate-list">
<ol> <ol>
<#if settings.donate_alipay?? && settings.donate_alipay!=''> <li th:if="!#strings.isEmpty(theme.config.post.donate_alipay)"><img
<li><img src="${settings.donate_alipay!}" alt="支付宝捐赠"></li> th:src="${theme.config.post.donate_alipay}" alt="支付宝捐赠"></li>
</#if> <li th:if="!#strings.isEmpty(theme.config.post.donate_wechat)"><img
<#if settings.donate_wechat?? && settings.donate_wechat!=''> th:src="${theme.config.post.donate_wechat}" alt="微信捐赠"></li>
<li><img src="${settings.donate_wechat!}" alt="微信捐赠"></li>
</#if>
</ol> </ol>
</div> </div>
</button> </button>
</#if> <button th:if="${type == 'Post'}" class="agree like" data-id="${(post.id!0)?c}"
<#if !is_sheet??> data-likes="${(post.likes!0)?c}">
<button class="agree like" data-id="${(post.id!0)?c}" data-likes="${(post.likes!0)?c}">
<i class="fa fa-thumbs-o-up"></i> <i class="fa fa-thumbs-o-up"></i>
<span><span>${post.likes!0}</span></span> <span><span th:text="${post.stats.upvote}"></span></span>
</button> </button>
</#if>
</div> </div>
<span>如果觉得文章对你有用,请随意赞赏</span> <span>如果觉得文章对你有用,请随意赞赏</span>
</div> </div>
</#if> </div>

View File

@ -1,10 +1,12 @@
<div xmlns:th="https://www.thymeleaf.org" <th:block xmlns:th="https://www.thymeleaf.org"
th:fragment="article (post, commentType)"> th:fragment="article (post, type)"
th:with="updateInterval = ${T(java.lang.Math).floor((#dates.createNow().getTime()/1000.0 - post.status.lastModifyTime.getEpochSecond())/86400.0).intValue()}">
<div th:if="${!#strings.isEmpty(post.spec.cover)}" class="card widget"> <div th:if="${!#strings.isEmpty(post.spec.cover)}" class="card widget">
<div class="cover-image" th:style="'background-image: url(' + ${post.spec.cover} + ')'"> <div class="cover-image" th:style="'background-image: url(' + ${post.spec.cover} + ')'">
<div th:if="${!#lists.isEmpty(post.categories)}" class="category"> <div th:if="${type == 'Post' && !#lists.isEmpty(post.categories)}" class="category">
<a th:each="cy : ${post.categories}" th:href="${cy.status.permalink}" th:text="${cy.spec.displayName}"></a>&nbsp; <a th:each="cy : ${post.categories}" th:href="${cy.status.permalink}"
th:text="${cy.spec.displayName}"></a>&nbsp;
</div> </div>
<div class="details"> <div class="details">
<h1 class="title" th:text="${post.spec.title}"></h1> <h1 class="title" th:text="${post.spec.title}"></h1>
@ -20,6 +22,12 @@
</div> </div>
</div> </div>
<div th:if="${!#strings.isEmpty(theme.config.post.invalid_tips_day) && updateInterval > T(java.lang.Long).parseLong(theme.config.post.invalid_tips_day)}"
class="card tips brightness"><i class="fa fa-times click-close" data-close=".tips"></i>本文最后更新于
[[${#dates.format(post.status.lastModifyTime,'yyyy-MM-dd')}]],距今已有 [[${updateInterval}]]
天,若文章内容或图片链接失效,请留言反馈。
</div>
<div th:if="${post.metadata.annotations.containsKey('tips')}" class="card tips brightness"><i <div th:if="${post.metadata.annotations.containsKey('tips')}" class="card tips brightness"><i
class="fa fa-times click-close" data-close=".tips"></i>[[${post.metadata.annotations.tips}]] class="fa fa-times click-close" data-close=".tips"></i>[[${post.metadata.annotations.tips}]]
</div> </div>
@ -37,23 +45,24 @@
<li><i class="fa fa-thumbs-o-up"></i>[[${post.stats.upvote}]]</li> <li><i class="fa fa-thumbs-o-up"></i>[[${post.stats.upvote}]]</li>
<li><i class="fa fa-pencil"></i>[[${#strings.length(#strings.trim(post.content.content))}]]</li> <li><i class="fa fa-pencil"></i>[[${#strings.length(#strings.trim(post.content.content))}]]</li>
</ul> </ul>
<div th:if="${!#lists.isEmpty(post.categories)}" class="level-item"> <div th:if="${type == 'Post' && !#lists.isEmpty(post.categories)}" class="level-item">
<a th:each="cy : ${post.categories}" th:href="${cy.status.permalink}" th:text="${cy.spec.displayName}"></a>&nbsp; <a th:each="cy : ${post.categories}" th:href="${cy.status.permalink}"
th:text="${cy.spec.displayName}"></a>&nbsp;
</div> </div>
</div> </div>
<hr/> <hr/>
</th:block> </th:block>
<div th:data-id="${post.metadata.name}" th:data-target="${commentType}" class="main-content article" <div th:data-id="${post.metadata.name}" th:data-target="${type}" class="main-content article"
th:utext="${post.content.content}"> th:utext="${post.content.content}">
</div> </div>
<!-- <#include "templates/main/admire.html">--> <th:block th:include="~{main/admire}"/>
<div th:if="${type == 'Post' && !#lists.isEmpty(post.tags)}" class="article-operation">
<div th:if="${!#lists.isEmpty(post.tags)}" class="article-operation">
<div class="level-item"> <div class="level-item">
<a th:each=" tag : ${post.tags}" th:href="${tag.status.permalink}" th:text="${tag.spec.displayName}"></a>&nbsp; <a th:each=" tag : ${post.tags}" th:href="${tag.status.permalink}"
th:text="${tag.spec.displayName}"></a>&nbsp;
</div> </div>
</div> </div>
<th:bolck th:if="${enableCopyright || enableShare}"> <th:bolck th:if="${enableCopyright || enableShare}">
@ -66,81 +75,23 @@
</div> </div>
</div> </div>
<th:block th:if="${type == 'Post'}" th:with="postCursor = ${postFinder.cursor(post.metadata.name)}">
<div th:if="${postCursor.hasPrevious() || postCursor.hasNext()}" class="card">
<div class="level post-navigation card-content">
<a th:if="${postCursor.hasPrevious()}" class="level-item"
th:href="@{${postCursor.previous.status.permalink}}">
<i class="fa fa-angle-left"></i><span th:text="${postCursor.previous.spec.title}"></span>
</a>
<a th:if="${postCursor.hasNext()}" class="level-item" th:href="@{${postCursor.next.status.permalink}}">
<span th:text="${postCursor.next.spec.title}"></span><i class="fa fa-angle-right"></i>
</a>
</div>
</div>
</th:block>
<div class="card card-content" id="comment-wrapper" th:if="${pluginFinder.available('PluginCommentWidget')}"> <div class="card card-content" id="comment-wrapper" th:if="${pluginFinder.available('PluginCommentWidget')}">
<h3 class="comment-title">评论</h3> <h3 class="comment-title">评论</h3>
<halo:comment colorScheme="window.dataTheme" group="content.halo.run" th:kind="${commentType}" <halo:comment colorScheme="window.dataTheme" group="content.halo.run" th:kind="${type}"
th:attr="name=${post.metadata.name}"/> th:attr="name=${post.metadata.name}"/>
</div> </div>
</div> </th:block>
<!--<#macro article post,commentType>-->
<!-- <#assign updateInterval = ((.now?long - post.updateTime?long)/86400000)?floor >-->
<!-- <#if updateInterval gt (settings.invalid_tips_day!'99999999')?number >-->
<!-- <div class="card tips brightness"><i class="fa fa-times click-close" data-close=".tips"></i>本文最后更新于 ${post.updateTime?string('yyyy-MM-dd')},距今已有 ${updateInterval} 天,若文章内容或图片链接失效,请留言反馈。</div>-->
<!-- </#if>-->
<!-- <div class="card">-->
<!-- <div class="card-content main">-->
<!-- <#if !post.thumbnail?? || post.thumbnail==''>-->
<!-- <h1 class="title">${post.title!}</h1>-->
<!-- <div class="meta">-->
<!-- <ul class="breadcrumb">-->
<!-- <li><@global.timeline datetime=post.createTime/></li>-->
<!-- <li><i class="fa fa-eye"></i>${post.visits?c}</li>-->
<!-- <#if !post.disallowComment!false><li><i class="fa fa-comments-o"></i>${post.commentCount?c}</li></#if>-->
<!-- <#if !is_sheet??><li><i class="fa fa-thumbs-o-up"></i>${post.likes?c}</li></#if>-->
<!-- <li><i class="fa fa-pencil"></i>${post.wordCount?c}</li>-->
<!-- </ul>-->
<!-- <#if post.categories?? && post.categories?size gt 0>-->
<!-- <div class="level-item">-->
<!-- <#list post.categories as category>-->
<!-- <a href="${category.fullPath!}">${category.name!}</a>&nbsp;-->
<!-- </#list>-->
<!-- </div>-->
<!-- </#if>-->
<!-- </div>-->
<!-- <hr/>-->
<!-- </#if>-->
<!-- <div data-id="${post.id?c}" data-target="${commentType}s" class="main-content article">${post.formatContent!}</div>-->
<!-- <#include "templates/main/admire.html">-->
<!-- <#if tags?? && (tags?size gt 0)>-->
<!-- <div class="article-operation">-->
<!-- <div class="level-item">-->
<!-- <#list tags as tag>-->
<!-- <a href="${tag.fullPath!}">${tag.name!}</a>&nbsp;-->
<!-- </#list>-->
<!-- </div>-->
<!-- </div>-->
<!-- </#if>-->
<!-- <#assign enable_copyright = (metas?? && metas.enable_copyright?? && metas.enable_copyright?trim!='')?then(metas.enable_copyright?trim, (settings.enable_copyright!true)?c)>-->
<!-- <#if enable_copyright == 'true' || enable_share>-->
<!-- <hr/>-->
<!-- <#if enable_copyright == 'true'>-->
<!-- <#include "copyright.ftl">-->
<!-- </#if>-->
<!-- <#if enable_share>-->
<!-- <div class="dshare"></div>-->
<!-- </#if>-->
<!-- </#if>-->
<!-- </div>-->
<!-- </div>-->
<!-- <#if nextPost?? || prevPost??>-->
<!-- <div class="card">-->
<!-- <div class="level post-navigation card-content">-->
<!-- <#if prevPost??>-->
<!-- <a class="level-item" href="${prevPost.fullPath!}">-->
<!-- <i class="fa fa-angle-left"></i>-->
<!-- <span>${prevPost.title!}</span>-->
<!-- </a>-->
<!-- </#if>-->
<!-- <#if nextPost??>-->
<!-- <a class="level-item" href="${nextPost.fullPath!}">-->
<!-- <span>${nextPost.title!}</span>-->
<!-- <i class="fa fa-angle-right"></i>-->
<!-- </a>-->
<!-- </#if>-->
<!-- </div>-->
<!-- </div>-->
<!-- </#if>-->
<!--</#macro>-->

View File

@ -1,105 +0,0 @@
<#macro articleLiterature post,commentType>
<#if post.thumbnail?? && post.thumbnail!=''>
<div class="card widget">
<div class="cover-image" style="background-image: url(${post.thumbnail!})">
<#if categories?? && categories?size gt 0>
<div class="category">
<#list categories as category>
<a href="${category.fullPath!}">${category.name!}</a>
</#list>
</div>
</#if>
<div class="details">
<h1 class="title">${post.title!}</h1>
<ul class="breadcrumb">
<li><@global.timeline datetime=post.createTime/></li>
<li><i class="fa fa-eye"></i>${post.visits?c}</li>
<#if !post.disallowComment!false><li><i class="fa fa-comments-o"></i>${post.commentCount?c}</li></#if>
<#if !is_sheet??><li><i class="fa fa-thumbs-o-up"></i>${post.likes?c}</li></#if>
<li><i class="fa fa-pencil"></i>${post.wordCount?c}</li>
</ul>
</div>
</div>
</div>
</#if>
<#assign updateInterval = ((.now?long - post.updateTime?long)/86400000)?floor >
<#if updateInterval gt (settings.invalid_tips_day!'99999999')?number >
<div class="card tips brightness"><i class="fa fa-times click-close" data-close=".tips"></i>本文最后更新于 ${post.updateTime?string('yyyy-MM-dd')},距今已有 ${updateInterval} 天,若文章内容或图片链接失效,请留言反馈。</div>
</#if>
<#if (metas?? && metas.tips?? && metas.tips!='')>
<div class="card tips brightness"><i class="fa fa-times click-close" data-close=".tips"></i>${metas.tips}</div>
</#if>
<div class="card">
<div class="card-content main">
<#if !post.thumbnail?? || post.thumbnail==''>
<h1 class="title">${post.title!}</h1>
<div class="meta">
<ul class="breadcrumb">
<li><@global.timeline datetime=post.createTime/></li>
<li><i class="fa fa-eye"></i>${post.visits?c}</li>
<#if !post.disallowComment!false><li><i class="fa fa-comments-o"></i>${post.commentCount?c}</li></#if>
<#if !is_sheet??><li><i class="fa fa-thumbs-o-up"></i>${post.likes?c}</li></#if>
<li><i class="fa fa-pencil"></i>${post.wordCount?c}</li>
</ul>
<#if post.categories?? && post.categories?size gt 0>
<div class="level-item">
<#list post.categories as category>
<a href="${category.fullPath!}">${category.name!}</a>&nbsp;
</#list>
</div>
</#if>
</div>
<hr/>
</#if>
<div data-id="${post.id?c}" data-target="${commentType}s" class="main-content literature-content article">${post.formatContent!}</div>
<#include "templates/main/admire.html">
<#if tags?? && (tags?size gt 0)>
<div class="article-operation">
<div class="level-item">
<#list tags as tag>
<a href="${tag.fullPath!}">${tag.name!}</a>&nbsp;
</#list>
</div>
</div>
</#if>
<#assign enable_copyright = (metas?? && metas.enable_copyright?? && metas.enable_copyright?trim!='')?then(metas.enable_copyright?trim, (settings.enable_copyright!true)?c)>
<#if enable_copyright == 'true' || enable_share>
<hr/>
<#if enable_copyright == 'true'>
<#include "templates/main/copyright.html">
</#if>
<#if enable_share>
<div class="dshare"></div>
</#if>
</#if>
</div>
</div>
<#if nextPost?? || prevPost??>
<div class="card">
<div class="level post-navigation card-content">
<#if prevPost??>
<a class="level-item" href="${prevPost.fullPath!}">
<i class="fa fa-angle-left"></i>
<span>${prevPost.title!}</span>
</a>
</#if>
<#if nextPost??>
<a class="level-item" href="${nextPost.fullPath!}">
<span>${nextPost.title!}</span>
<i class="fa fa-angle-right"></i>
</a>
</#if>
</div>
</div>
</#if>
<#if (!post.disallowComment!false) && settings.enable_comment!true>
<div class="card card-content" id="comment-wrapper">
<h3 class="comment-title">评论</h3>
<#include "templates/main/comment.html">
<@comment post.id?c, commentType />
</div>
</#if>
</#macro>

View File

@ -1,24 +0,0 @@
<#macro comment id,type>
<#assign imageUploadApi = (settings.image_upload_api?? && settings.image_upload_api!='')?then(', "imageUploadApi": "${settings.image_upload_api!}"', '') >
<#assign avatarLoading = (settings.avatar_loading?? && settings.avatar_loading!='')?then(', "avatarLoading": "${settings.avatar_loading!}"', '') >
<#assign defaultAvatar = (settings.default_avatar?? && settings.default_avatar!='')?then(', "defaultAvatar": "${settings.default_avatar!}"', '') >
<#assign anonymousUserName = (settings.anonymous_user_name?? && settings.anonymous_user_name!='')?then(', "anonymousUserName": "${settings.anonymous_user_name!}"', '') >
<#assign enableBulletScreen = (is_journals??)?then("false", (metas?? && metas.enable_bullet_screen?? && metas.enable_bullet_screen?trim!="")?then(metas.enable_bullet_screen?trim, (settings.enable_bullet_screen!false)?c))>
<#assign configs= '{"autoLoad": ${(settings.autoload_comment!true)?c
}, "showUserAgent": ${(settings.show_comment_ua!true)?c
}, "priorityQQAvatar": ${(settings.priority_qq_avatar!false)?c
}, "getQQInfo": ${(settings.enable_qq_info!false)?c
}, "commentHtml": ${(settings.enable_comment_html!false)?c
}, "loadingStyle": "${settings.comment_loading_style!"default"
}", "unfoldReplyNum": ${settings.unfold_reply_num!6
}, "replyDescSoft": ${(settings.reply_desc_soft!false)?c
}, "enableImageUpload": ${(settings.enable_image_upload!false)?c
}, "enableBulletScreen": ${enableBulletScreen
}${imageUploadApi!
}${anonymousUserName!
}, "enableBloggerOperation": ${(settings.enable_blogger_operation!true)?c
}${avatarLoading!
}${defaultAvatar!
}}'>
<halo-comment ${(enableBulletScreen == 'true')?then('bullet-screen="true"', '')} id="${id}" type="${type}" configs='${configs}'/>
</#macro>

View File

@ -1,5 +1,7 @@
<#include "templates/layout_pjax.ftl"> <!DOCTYPE html>
<#include "templates/main/article.ftl"> <html lang="zh" xmlns:th="https://www.thymeleaf.org"
<@layout title="${sheet.title} - ${blog_title!}" canonical="${sheet.fullPath!}"> th:include="~{common/layout :: layout (title = ${singlePage.spec.title + ' - ' + site.title}, canonical = ${singlePage.status.permalink}, content = ~{main/article :: article (${singlePage}, 'SinglePage')}, isPost = true)}"
<@article sheet,"sheet" /> th:with="enableKatex = ${!#strings.isEmpty(singlePage.metadata.annotations.get('enable_katex'))? singlePage.metadata.annotations.get('enable_katex') : theme.config.post.enable_katex},
</@layout> enableShare = ${!#strings.isEmpty(singlePage.metadata.annotations.get('enable_share'))? singlePage.metadata.annotations.get('enable_share') : theme.config.post.enable_share},
enableCopyright = ${!#strings.isEmpty(singlePage.metadata.annotations.get('enable_copyright'))? singlePage.metadata.annotations.get('enable_copyright') : theme.config.post.enable_copyright}">
</html>

View File

@ -1,10 +1,7 @@
<!DOCTYPE html> <!DOCTYPE html>
<html lang="zh" xmlns:th="https://www.thymeleaf.org" <html lang="zh" xmlns:th="https://www.thymeleaf.org"
th:include="~{common/layout :: layout (title = ${post.spec.title + ' - ' + site.title}, canonical = ${post.status.permalink}, content = ~{::content}, isPost = true)}" th:include="~{common/layout :: layout (title = ${post.spec.title + ' - ' + site.title}, canonical = ${post.status.permalink}, content = ~{main/article :: article (${post}, 'Post')}, isPost = true)}"
th:with="enableKatex = ${!#strings.isEmpty(post.metadata.annotations.get('enable_katex'))? post.metadata.annotations.get('enable_katex') : theme.config.post.enable_katex}, th:with="enableKatex = ${!#strings.isEmpty(post.metadata.annotations.get('enable_katex'))? post.metadata.annotations.get('enable_katex') : theme.config.post.enable_katex},
enableShare = ${!#strings.isEmpty(post.metadata.annotations.get('enable_share'))? post.metadata.annotations.get('enable_share') : theme.config.post.enable_share}, enableShare = ${!#strings.isEmpty(post.metadata.annotations.get('enable_share'))? post.metadata.annotations.get('enable_share') : theme.config.post.enable_share},
enableCopyright = ${!#strings.isEmpty(post.metadata.annotations.get('enable_copyright'))? post.metadata.annotations.get('enable_copyright') : theme.config.post.enable_copyright}"> enableCopyright = ${!#strings.isEmpty(post.metadata.annotations.get('enable_copyright'))? post.metadata.annotations.get('enable_copyright') : theme.config.post.enable_copyright}">
<th:block th:fragment="content" th:with="isEmpty = ${#lists.isEmpty(posts)}">
<th:block th:include="~{main/article :: article (${post}, 'Post')}"/>
</th:block>
</html> </html>

View File

@ -1,5 +0,0 @@
<#include "templates/layout_pjax.ftl">
<#include "templates/main/article_literature.ftl">
<@layout title="${post.title!} - ${blog_title!}" canonical="${post.fullPath!}">
<@articleLiterature post,"post" />
</@layout>

View File

@ -1,14 +0,0 @@
<#include "templates/layout_pjax.ftl">
<@layout title="搜索:${keyword} - ${blog_title!}" canonical="${blog_url!}/search?keyword=${keyword}">
<#if (posts.content)?? && posts.content?size gt 0>
<#include "templates/main/article_list.ftl">
<@article_list posts.content/>
<#include "templates/main/pagination.ftl">
<@pagination method="search" datas=posts keyword="${keyword!}" display="${settings.page_number!5}" />
<#else>
<div class="card card-empty">
<i class="fa fa-inbox"></i>
搜索结果为空,回<a href="${context!}">主页</a>看看吧
</div>
</#if>
</@layout>

View File

@ -1,5 +0,0 @@
<#include "templates/layout_pjax.ftl">
<#include "templates/main/article_literature.ftl">
<@layout title="${sheet.title} - ${blog_title!}" canonical="${sheet.fullPath!}">
<@articleLiterature sheet,"sheet" />
</@layout>

View File

@ -1,35 +0,0 @@
<#assign num= settings.links_num!10 />
<div xmlns:th="https://www.thymeleaf.org"
th:fragment="widget (hide)"
th:class="'card widget links ' + ${hide}">
<@linkTag method="listByRandom">
<div class="card-title">
<i class="fa fa-link card-title-label"></i><span>友链</span>
<#if settings.links_more?? && settings.links_more== true && links?size gt num?number>
<a class="card-more" href="${links_url!}">更多<i class="fa fa-angle-double-right"></i></a>
</#if>
</div>
<#if links?? && links?size gt 0>
<div class="card-content">
<ul class="menu-list">
<#assign size= (links?size > num?number)?string(num, links?size)?number - 1 />
<#list 0..size as i>
<#assign link= links[i] />
<li>
<a class="level is-mobile" rel="nofollow noopener noreferrer" href="${link.url!}" target="_blank">
<span class="level-left">
<span class="level-item">${link.name}</span>
</span>
<span class="level-right">
<span class="level-item tag">${link.url?replace('http[s]?://|/.*','','ri')}</span>
</span>
</a>
</li>
</#list>
</ul>
</div>
<#else>
<div class="card-empty">暂无友链</div>
</#if>
</@linkTag>
</div>

View File

@ -1,4 +1,3 @@
<#assign num= settings.tagcloud_num!32 />
<div xmlns:th="https://www.thymeleaf.org" <div xmlns:th="https://www.thymeleaf.org"
th:fragment="widget (hide)" th:fragment="widget (hide)"
th:class="'card widget tagcloud ' + ${hide}" th:class="'card widget tagcloud ' + ${hide}"