Merge pull request #31 from zsjy/dev

Dev
This commit is contained in:
宏尘 2024-10-22 06:10:03 +08:00 committed by GitHub
commit 1d8ba6eef9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
11 changed files with 67 additions and 16 deletions

View File

@ -23,7 +23,7 @@
| 主题版本 | 适配Halo版本 | 测试用Halo版本 |
| ----------- |----------| -------------- |
| x.x | 2.19.0+ | 2+ |
| x.x | 2.20.0+ | 2+ |

View File

@ -98,6 +98,8 @@ spec:
show_console: false
console_icon: ri-equalizer-line
console_title: 控制台
console_url: '/console'
console_target: _blank
children:
- $formkit: radio
name: show_console
@ -111,11 +113,28 @@ spec:
- $formkit: text
name: console_icon
if: $get(show_console).value
label: 控制台图标,留空显示默认图标
label: 控制台图标
help: '控制台图标,留空显示默认图标。'
- $formkit: text
name: console_title
if: $get(show_console).value
label: 控制台鼠标悬停提示,留空不显示
- $formkit: text
name: console_url
validation: required
if: $get(show_console).value
label: 控制台跳转URL
help: '控制台跳转URL可使用“redirect_uri”参数进行登录后跳转例如“/login?redirect_uri=/”,登录后默认跳转到前台页面。'
- $formkit: radio
if: $get(show_console).value
name: console_target
validation: required
label: 控制台跳转方式
options:
- value: _blank
label: 新标签页
- value: _self
label: 当前窗口
- $formkit: radio
name: load_progress
label: 加载进度条
@ -893,6 +912,16 @@ spec:
label: 显示
- value: false
label: 不显示
- $formkit: radio
name: recent_posts_pinned
label: 侧边栏最近文章-显示”置顶”标记
value: false
help: '侧边栏最近文章是否显示”置顶”标记。'
options:
- value: true
label: 显示
- value: false
label: 不显示
- $formkit: number
name: recent_comments_num
label: 侧边栏最近评论-展示评论数量

View File

@ -2962,6 +2962,19 @@ button.swiper-pagination-bullet {
justify-content: space-between;
line-height: 20px;
.top {
background-image: -webkit-linear-gradient(0deg, rgb(57 169 255 / 80%) 0, rgb(155 79 255 / 80%) 100%);
border-radius: 2px 6px;
color: #fff;
padding: 0 6px;
font-size: 0.75rem;
line-height: 20px;
vertical-align: text-bottom;
margin-right: 5px;
display: inline-block;
user-select: none;
}
i {
color: var(--main);
transition: transform 0.3s;
@ -2999,7 +3012,7 @@ button.swiper-pagination-bullet {
&:after {
content: "";
position: absolute;
bottom: 2px;
bottom: 0px;
left: 0;
width: 100%;
height: 1px;
@ -5226,7 +5239,8 @@ button.swiper-pagination-bullet {
}
/* 搜索界面 */
.search {
.search-page {
margin-top: 1.4rem !important;
.search-form-inner {
@ -5298,3 +5312,7 @@ button.swiper-pagination-bullet {
background: var(--theme);
}
}
.search-page-title {
margin-top: 0 !important;
}

View File

@ -50,7 +50,7 @@ const syncLoadScripts = ($scripts, i, resolve) => {
* 第二个参数是容器即将被替换的内容
* fragment:是加载的文本中被选中的目标内容
*/
$(document).on('click', 'a[target!=_blank][href]:not(data-not-pjax)', (event) => {
$(document).on('click', 'a[target!=_blank][href]:not([data-not-pjax])', (event) => {
$.pjax.click(event, '.column-main', {
scrollTo: computeScrollTop(event.currentTarget),
fragment: '.column-main',

File diff suppressed because one or more lines are too long

View File

@ -1 +1 @@
(()=>{const i=new Set($('link[href*=".css"]').map((o,e)=>$(e).attr("href")).get()),l=new Set($('script[src*=".js"]').map((o,e)=>$(e).attr("src")).get()),e=()=>{var o=(new Date).getTime();return window.pjaxSerialNumber=o,console.log("sn = "+o),o},n=o=>"/"!==o.pathname&&0!==$(".banner").length?(window.initTop=99999999,window.innerHeight/4):0,c=(e,n,t)=>{if(n>=e.length)t&&t();else{let o=$(e[n]).attr("src");l.has(o)?c(e,n+1,t):(console.log((t?"同步":"异步")+"顺序加载js "+o),Utils.cachedScript(o).done(function(){console.log((t?"同步":"异步")+"顺序加载js完成 "+o),l.add(o),window.DProgress&&DProgress.inc(),c(e,n+1,t)}).fail(function(){console.log((t?"同步":"异步")+"顺序加载js失败 "+o),c(e,n+1,t)}))}};$(document).on("click","a[target!=_blank][href]:not(data-not-pjax)",o=>{$.pjax.click(o,".column-main",{scrollTo:n(o.currentTarget),fragment:".column-main",serialNumber:e(),timeout:8e3})}),$(document).on("submit","form[data-pjax]",function(o){$.pjax.submit(o,".column-main",{scrollTo:n(o.currentTarget),fragment:".column-main",serialNumber:e(),timeout:8e3})}),$(document).on("pjax:click",function(o,e){console.log("------------------------"),console.log("pjax:click sn = "+e.serialNumber)}),$(document).on("pjax:beforeSend",function(o,e,n){console.log("pjax:beforeSend sn = "+n.serialNumber),$("html").addClass("pjax-loading")}),$(document).on("pjax:start",function(o,e,n){console.log("pjax:start sn = "+n.serialNumber),window.DProgress&&DProgress.start(),$(".pjax-close").remove()}),$(document).on("pjax:send",function(o,e,n){console.log("pjax:send sn = "+n.serialNumber)}),$(document).on("pjax:clicked",function(o,e){console.log("pjax:clicked sn = "+e.serialNumber)}),$(document).on("pjax:beforeReplace",function(o,e,n){console.log("pjax:beforeReplace sn = "+n.serialNumber),$(".navbar-nav .current,.panel-side-menu .current").removeClass("current"),commonContext.initNavbar(),0<$("html.disable-scroll").length&&$(".navbar-mask").trigger("click")}),$(document).on("pjax:success",async function(o,e,n,t,a){a=a.serialNumber;if(console.log("pjax:success sn = "+a),window.pjaxSerialNumber===a){commonContext.initGallery(),commonContext.initTocAndNotice(),$("html").removeClass("pjax-loading");const r=$($.parseHTML(e,document,!0)),s=$("head");s.find("meta").remove(),s.find('link[rel="canonical"]').remove(),s.append(r.filter("meta")),s.append(r.filter('link[rel="canonical"]')),r.filter("link[data-pjax]").each(function(){let o=$(this).attr("href");i.has(o)||(s.append($(this)),console.log("加载css "+$(this).attr("href")),this.onload=function(){i.add(o),window.DProgress&&DProgress.inc(),console.log("加载css完成 "+$(this).attr("href"))})});let o=r.filter("script[data-pjax]");if(0<o.length){o.filter("[async]").each(function(){let o=$(this).attr("src");l.has(o)||(console.log("异步无序加载js "+o),Utils.cachedScript(o).done(function(){console.log("异步无序js完成 "+o),window.DProgress&&DProgress.inc(),l.add(o)}).fail(function(){console.log("异步无序js失败 "+o)}))}),new Promise(()=>{c(o.filter("[defer]"),0)});let e=o.filter(":not([async]):not([defer])");0<e.length&&await new Promise(o=>{c(e,0,o)})}console.log("全部处理完成"),window.pjaxSerialNumber===a&&(window.journalPjax&&window.journalPjax(a),window.postPjax&&window.postPjax(a),commonContext.initTimeCount(),commonContext.initCarousel(),window.DProgress)&&DProgress.done()}}),$(document).on("pjax:timeout",function(o,e,n){console.log("pjax:timeout sn = "+n.serialNumber)}),$(document).on("pjax:error",function(o,e,n,t,a){console.log(`pjax:error sn = ${a.serialNumber} error `+t)}),$(document).on("pjax:complete",function(o,e,n,t){console.log("pjax:complete sn = "+t.serialNumber)}),$(document).on("pjax:end",function(o,e,n){console.log("pjax:end sn = "+n.serialNumber),null==e&&(commonContext.initTocAndNotice(),commonContext.initCarousel(),commonContext.initTimeCount(),window.DProgress&&DProgress.done(),$("html").removeClass("pjax-loading"))}),$(document).on("pjax:popstate",function(o){console.log("pjax:popstate")})})();
(()=>{const i=new Set($('link[href*=".css"]').map((o,e)=>$(e).attr("href")).get()),l=new Set($('script[src*=".js"]').map((o,e)=>$(e).attr("src")).get()),e=()=>{var o=(new Date).getTime();return window.pjaxSerialNumber=o,console.log("sn = "+o),o},n=o=>"/"!==o.pathname&&0!==$(".banner").length?(window.initTop=99999999,window.innerHeight/4):0,c=(e,n,t)=>{if(n>=e.length)t&&t();else{let o=$(e[n]).attr("src");l.has(o)?c(e,n+1,t):(console.log((t?"同步":"异步")+"顺序加载js "+o),Utils.cachedScript(o).done(function(){console.log((t?"同步":"异步")+"顺序加载js完成 "+o),l.add(o),window.DProgress&&DProgress.inc(),c(e,n+1,t)}).fail(function(){console.log((t?"同步":"异步")+"顺序加载js失败 "+o),c(e,n+1,t)}))}};$(document).on("click","a[target!=_blank][href]:not([data-not-pjax])",o=>{$.pjax.click(o,".column-main",{scrollTo:n(o.currentTarget),fragment:".column-main",serialNumber:e(),timeout:8e3})}),$(document).on("submit","form[data-pjax]",function(o){$.pjax.submit(o,".column-main",{scrollTo:n(o.currentTarget),fragment:".column-main",serialNumber:e(),timeout:8e3})}),$(document).on("pjax:click",function(o,e){console.log("------------------------"),console.log("pjax:click sn = "+e.serialNumber)}),$(document).on("pjax:beforeSend",function(o,e,n){console.log("pjax:beforeSend sn = "+n.serialNumber),$("html").addClass("pjax-loading")}),$(document).on("pjax:start",function(o,e,n){console.log("pjax:start sn = "+n.serialNumber),window.DProgress&&DProgress.start(),$(".pjax-close").remove()}),$(document).on("pjax:send",function(o,e,n){console.log("pjax:send sn = "+n.serialNumber)}),$(document).on("pjax:clicked",function(o,e){console.log("pjax:clicked sn = "+e.serialNumber)}),$(document).on("pjax:beforeReplace",function(o,e,n){console.log("pjax:beforeReplace sn = "+n.serialNumber),$(".navbar-nav .current,.panel-side-menu .current").removeClass("current"),commonContext.initNavbar(),0<$("html.disable-scroll").length&&$(".navbar-mask").trigger("click")}),$(document).on("pjax:success",async function(o,e,n,t,a){a=a.serialNumber;if(console.log("pjax:success sn = "+a),window.pjaxSerialNumber===a){commonContext.initGallery(),commonContext.initTocAndNotice(),$("html").removeClass("pjax-loading");const r=$($.parseHTML(e,document,!0)),s=$("head");s.find("meta").remove(),s.find('link[rel="canonical"]').remove(),s.append(r.filter("meta")),s.append(r.filter('link[rel="canonical"]')),r.filter("link[data-pjax]").each(function(){let o=$(this).attr("href");i.has(o)||(s.append($(this)),console.log("加载css "+$(this).attr("href")),this.onload=function(){i.add(o),window.DProgress&&DProgress.inc(),console.log("加载css完成 "+$(this).attr("href"))})});let o=r.filter("script[data-pjax]");if(0<o.length){o.filter("[async]").each(function(){let o=$(this).attr("src");l.has(o)||(console.log("异步无序加载js "+o),Utils.cachedScript(o).done(function(){console.log("异步无序js完成 "+o),window.DProgress&&DProgress.inc(),l.add(o)}).fail(function(){console.log("异步无序js失败 "+o)}))}),new Promise(()=>{c(o.filter("[defer]"),0)});let e=o.filter(":not([async]):not([defer])");0<e.length&&await new Promise(o=>{c(e,0,o)})}console.log("全部处理完成"),window.pjaxSerialNumber===a&&(window.journalPjax&&window.journalPjax(a),window.postPjax&&window.postPjax(a),commonContext.initTimeCount(),commonContext.initCarousel(),window.DProgress)&&DProgress.done()}}),$(document).on("pjax:timeout",function(o,e,n){console.log("pjax:timeout sn = "+n.serialNumber)}),$(document).on("pjax:error",function(o,e,n,t,a){console.log(`pjax:error sn = ${a.serialNumber} error `+t)}),$(document).on("pjax:complete",function(o,e,n,t){console.log("pjax:complete sn = "+t.serialNumber)}),$(document).on("pjax:end",function(o,e,n){console.log("pjax:end sn = "+n.serialNumber),null==e&&(commonContext.initTocAndNotice(),commonContext.initCarousel(),commonContext.initTimeCount(),window.DProgress&&DProgress.done(),$("html").removeClass("pjax-loading"))}),$(document).on("pjax:popstate",function(o){console.log("pjax:popstate")})})();

View File

@ -91,11 +91,15 @@
/** 配置灯笼特效文本 */
let effects_lantern_left = [[${theme.config.enhance.effects_lantern.effects_lantern_left}]];
let effects_lantern_right = [[${theme.config.enhance.effects_lantern.effects_lantern_right}]];
if(effects_lantern_left.length > 1) {
if(effects_lantern_left && effects_lantern_left.length > 1) {
effects_lantern_left = effects_lantern_left.charAt(0);
} else {
effects_lantern_left = '';
}
if(effects_lantern_right.length > 1) {
if(effects_lantern_left && effects_lantern_right.length > 1) {
effects_lantern_right = effects_lantern_right.charAt(0);
} else {
effects_lantern_right = '';
}
DreamConfig["effects_lantern_left"] = effects_lantern_left;
DreamConfig["effects_lantern_right"] = effects_lantern_right;

View File

@ -69,7 +69,7 @@
</div>
<i th:unless="${theme.config.page_config.search.search_enable}" class="ri-search-line navbar-searchicon" onclick="javascript:SearchWidget.open();"></i>
<a th:if="${theme.config.page_config.search.search_enable}" class="navbar-searchicon" target="_self" href="/search"><i class="ri-search-line navbar-searchicon"></i></a>
<a th:if="${theme.config.basic_style.console.show_console}" class="navbar-console" href="/console" target="_blank"
<a data-not-pjax th:if="${theme.config.basic_style.console.show_console}" class="navbar-console" th:href="@{${theme.config.basic_style.console.console_url}}" th:target="${theme.config.basic_style.console.console_target}"
th:title="${theme.config.basic_style.console.console_title}">
<i th:class="${#strings.defaultString(theme.config.basic_style.console.console_icon, 'ri-equalizer-line')}"></i>
</a>

View File

@ -4,7 +4,7 @@
th:with="isJournals = true, enableShare = false, baseEnableComment = false"
xmlns:th="https://www.thymeleaf.org">
<th:block th:fragment="content">
<div class="card card-content search">
<div class="card card-content search-page search-page-title">
<div class="card-tab">
<div>[[${#strings.replace(title, ' - ' + site.title, '')}]]</div>
</div>
@ -70,7 +70,7 @@
var title = removeHTMLTags(hit.title)
var description = hit.content ? removeHTMLTags(hit.content) : ''
searchResult.append('<div class="widget card search">\n' +
searchResult.append('<div class="widget card search-page">\n' +
'<div class="card-content main">\n' +
'<a href="' + hit.permalink + '" ' + ' target="' + target + '">\n' +
'<h2 class="title">' + title + '</h2>\n' +
@ -136,7 +136,7 @@
</div>
<div id="dream-search-result">
</div>
<div id="dream-search-result-empty" class="widget card search">
<div id="dream-search-result-empty" class="widget card search-page">
<div class="result-empty">
<div class="result-empty-tips" th:utext="${theme.config.page_config.search.search_empty_tips}"></div>
</div>

View File

@ -10,7 +10,7 @@
<div th:unless="${isEmpty}" class="card-content">
<ul class="list">
<li class="item" th:each="post : ${posts}">
<a class="link" th:href="@{${post.status.permalink}}" th:title="${post.spec.title}" th:text="${post.spec.title}"></a>
<a class="link" th:href="@{${post.status.permalink}}" th:title="${post.spec.title}"><span class="top" th:if="${post.spec.pinned && theme.config.sidebar.recent_posts_pinned}">置顶</span>[[${post.spec.title}]]</a>
<i class="ri-link"></i>
</li>
</ul>

View File

@ -30,9 +30,9 @@ spec:
settingName: theme-dream2-plus-setting
configMapName: theme-dream2-plus-configMap
# 版本号
version: 1.3.0
version: 1.3.1.beta5
# 最低支持的 Halo 版本
require: ">=2.19.0"
require: ">=2.20.0"
# 许可
license:
- name: "MIT"