Merge pull request #27 from zsjy/dev

Dev
This commit is contained in:
宏尘 2024-09-15 20:20:02 +08:00 committed by GitHub
commit 6ce15ab789
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
12 changed files with 57 additions and 77 deletions

View File

@ -88,16 +88,6 @@ spec:
value: false
- label: 隐藏
value: true
- $formkit: radio
name: social_media
label: 社交媒体
value: true
help: 是否在HTML下添加社交媒体的META参数隐藏时可由相关插件添加。
options:
- label: 显示
value: true
- label: 隐藏
value: false
- group: basic_style
label: '基础样式'
formSchema:
@ -1090,15 +1080,6 @@ spec:
name: journals_share_image
label: 瞬间页面-瞬间分享背景图
placeholder: '请输入/选择图片路径'
- $formkit: radio
name: enable_friends_stats
label: 朋友圈页面-开启朋友圈统计信息显示
value: true
options:
- value: true
label: 开启
- value: false
label: 关闭
- $formkit: group
name: search
label: 搜索页面
@ -1275,6 +1256,16 @@ spec:
label: 开启
- value: false
label: 关闭
- $formkit: radio
name: enable_comment_type
label: 评论加载方式
value: true
help: '在使用Halo评论组件时建议您关闭Pjax加载功能以获得最佳体验。同时Halo评论组件支持评论插件的新特性。而对于Web评论组件它支持Pjax加载但请注意部分新特性可能不被Web评论组件所支持。'
options:
- value: true
label: Halo评论组件
- value: false
label: Web评论组件
- $formkit: radio
name: effects_lantern_mode
id: effects_lantern_mode

View File

@ -10,7 +10,6 @@ th:with="description=${isPost ? post != null ? post.status.excerpt : singlePage
<meta name="description" th:content="${description}">
<meta name="author" th:content="${site.title}">
<meta name="site" th:content="${site.url}">
<th:block th:if="${theme.config.basic_info.social_media}">
<meta property="og:type" content="website">
<meta property="og:title" th:content="${site.title}">
<meta property="og:url" th:content="${#strings.isEmpty(canonical) ? '' : #strings.startsWith(canonical,'http') ? canonical : (#strings.endsWith(site.url,'/') ? #strings.substringBefore(site.url, '/') : site.url + canonical)}">
@ -22,7 +21,6 @@ th:with="description=${isPost ? post != null ? post.status.excerpt : singlePage
<meta name="twitter:title" th:content="${title}">
<meta name="twitter:description" th:content="${description}">
<meta name="twitter:image" th:content="${#strings.isEmpty(site.favicon) ? '' : #strings.startsWith(site.favicon,'http') ? site.favicon : (#strings.endsWith(site.url,'/') ? #strings.substringBefore(site.url, '/') : site.url + site.favicon)}">
</th:block>
<link rel="canonical" th:href="${#strings.isEmpty(canonical) ? '' : #strings.startsWith(canonical,'http') ? canonical : (#strings.endsWith(canonical,'/') ? #strings.substringBefore(site.url, '/') : site.url + canonical)}"/>

View File

@ -2,7 +2,7 @@
th:class="${theme.config.basic_style.theme_style}"
th:fragment="layout (title, canonical, content, isPost)">
<th:block th:with="contributor = ${contributorFinder.getContributor(theme.config.basic_info.metadata_name)},
enableComment = ${baseEnableComment == true && site.comment.enable && pluginFinder.available('PluginCommentWidget')}">
enableComment = ${baseEnableComment == true && site.comment.enable}">
<th:block th:with="stats = ${siteStatsFinder.getStats()}">
<th:block th:replace="~{common/head :: head}"/>

View File

@ -4,38 +4,13 @@
th:with="isJournals = true, enableShare = false, baseEnableComment = false"
xmlns:th="https://www.thymeleaf.org">
<th:block th:fragment="content">
<div th:if="${theme.config.page_config.enable_friends_stats}" class="card card-content friends">
<div class="card-tab">
<div>[[${#strings.replace(title, ' - ' + site.title, '')}]]</div>
</div>
<nav class="level">
<div class="level-item">
<div>
<p class="heading">订阅数</p>
<p class="value" th:title="${statistical.friendsNum}" th:text="${statistical.friendsNum}"></p>
</div>
</div>
<div class="level-item">
<div>
<p class="heading">订阅成功数</p>
<p class="value" th:title="${statistical.activeNum}" th:text="${statistical.activeNum}"></p>
</div>
</div>
<div class="level-item">
<div>
<p class="heading">订阅文章数</p>
<p class="value" th:title="${statistical.articleNum}" th:text="${statistical.articleNum}"></p>
</div>
</div>
</nav>
</div>
<div class="widget card friends" th:each="friend : ${friends.items}" th:with="spec = ${friend.spec}">
<div class="card-content main">
<h2 class="title"><a th:href="${spec.link}" target="_blank" th:text="${spec.title}"></a></h2>
<h2 class="title"><a th:href="${spec.postLink}" target="_blank" th:text="${spec.title}"></a></h2>
<div class="main-content not-toc" th:text="${spec.description}"></div>
<hr/>
<div class="meta">
<a class="has-link-grey" th:href="${spec.url}" target="_blank">
<a class="has-link-grey" th:href="${spec.authorUrl}" target="_blank">
<img th:if="${!#strings.isEmpty(spec.logo)}" th:src="${spec.logo}" alt="avatar">
<span th:text="${spec.author}"></span>
</a>

View File

@ -49,7 +49,7 @@
</div>
<div class="card card-content comment-wrapper-z-index" id="comment-wrapper" th:if="${enableComment}">
<h3 class="comment-title">评论</h3>
<th:block th:if="${theme.config.enhance.enable_pjax}">
<th:block th:unless="${theme.config.enhance.enable_comment_type}">
<th:block th:if="${theme.config.page_config.link_enable_comment == 'custom'}">
<comment-widget
group="content.halo.run"
@ -69,7 +69,7 @@
></comment-widget>
</th:block>
</th:block>
<th:block th:unless="${theme.config.enhance.enable_pjax}">
<th:block th:if="${theme.config.enhance.enable_comment_type}">
<th:block th:if="${theme.config.page_config.link_enable_comment == 'custom'}">
<halo:comment
group="content.halo.run"

View File

@ -1,7 +1,7 @@
<th:block xmlns:th="https://www.thymeleaf.org"
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()},
thumbnail = ${#strings.isEmpty(post.spec.cover) ? #strings.isEmpty(theme.config.post.default_thumbnail) ? '' : theme.config.post.default_thumbnail + (#strings.contains(theme.config.post.default_thumbnail, '?') ? '&' : '?') + 'id=' + post.metadata.name : thumbnail.gen(post.spec.cover, 'm')}">
thumbnail = ${#strings.isEmpty(post.spec.cover) ? #strings.isEmpty(theme.config.post.default_thumbnail) ? '' : theme.config.post.default_thumbnail + (#strings.contains(theme.config.post.default_thumbnail, '?') ? '&' : '?') + 'id=' + post.metadata.name : thumbnail.gen(post.spec.cover, 'xl')}">
<div th:if="${!#strings.isEmpty(thumbnail)}" class="card widget">
<div class="cover-image" th:style="'background-image: url(' + ${thumbnail} + ')'">
@ -92,7 +92,7 @@
<div class="card card-content comment-wrapper-z-index" id="comment-wrapper" th:if="${enableComment}">
<h3 class="comment-title">评论</h3>
<th:block th:if="${theme.config.enhance.enable_pjax}">
<th:block th:unless="${theme.config.enhance.enable_comment_type}">
<comment-widget
group="content.halo.run"
th:kind="${type}"
@ -101,7 +101,7 @@
with-replies="false"
></comment-widget>
</th:block>
<th:block th:unless="${theme.config.enhance.enable_pjax}">
<th:block th:if="${theme.config.enhance.enable_comment_type}">
<halo:comment
group="content.halo.run"
th:kind="${type}"

View File

@ -1,7 +1,7 @@
<th:block xmlns:th="https://www.thymeleaf.org"
th:fragment="articleList (posts)">
<th:block th:each="post : ${posts}"
th:with="thumbnail = ${#strings.isEmpty(post.spec.cover) ? #strings.isEmpty(theme.config.post.default_thumbnail) ? '' : theme.config.post.default_thumbnail + (#strings.contains(theme.config.post.default_thumbnail, '?') ? '&' : '?') + 'id=' + post.metadata.name : thumbnail.gen(post.spec.cover, 's')},
th:with="thumbnail = ${#strings.isEmpty(post.spec.cover) ? #strings.isEmpty(theme.config.post.default_thumbnail) ? '' : theme.config.post.default_thumbnail + (#strings.contains(theme.config.post.default_thumbnail, '?') ? '&' : '?') + 'id=' + post.metadata.name : thumbnail.gen(post.spec.cover, 'xl')},
thumbnail_mode = ${(theme.config.post.top_thumbnail_mode == 'grid' || (!post.spec.pinned && theme.config.post.thumbnail_mode == 'grid'))? 'grid' : (!#strings.isEmpty(post.metadata.annotations.get('thumbnail_mode')) && post.metadata.annotations.get('thumbnail_mode') != 'none')? post.metadata.annotations.get('thumbnail_mode') : post.spec.pinned ? theme.config.post.top_thumbnail_mode : theme.config.post.thumbnail_mode}">
<div th:if="${!#strings.isEmpty(thumbnail) && thumbnail_mode == 'back'}" class="card widget card-cover">
<a th:href="${post.status.permalink}">

View File

@ -13,7 +13,11 @@
<div class="main-content not-toc" data-target="Moment" th:data-id="${moment.metadata.name}">
[(${moment.spec.content.html})]
<mew-photos th:if="${!#lists.isEmpty(moment.spec.content.medium)}">
<img th:each="momentItem : ${moment.spec.content.medium}" th:if="${momentItem.type.name == 'PHOTO'}" th:src="${momentItem.url}" />
<img th:each="momentItem : ${moment.spec.content.medium}" th:if="${momentItem.type.name == 'PHOTO'}" th:src="${momentItem.url}"
th:srcset="|${thumbnail.gen(momentItem.url, 's')} 400w,
${thumbnail.gen(momentItem.url, 'm')} 800w,
${thumbnail.gen(momentItem.url, 'l')} 1200w|"
sizes="(max-width: 1200px) 100vw, 1200px"/>
</mew-photos>
<th:block th:if="${!#lists.isEmpty(moment.spec.content.medium)}" th:each="momentItem : ${moment.spec.content.medium}">
<mew-video th:if="${momentItem.type.name == 'VIDEO'}" th:src="${momentItem.url}"></mew-video>
@ -53,7 +57,7 @@
</div>
</div>
<div class="journal-comment comment-wrapper-z-index" th:if="${enableComment}">
<th:block th:if="${theme.config.enhance.enable_pjax}">
<th:block th:unless="${theme.config.enhance.enable_comment_type}">
<comment-widget
group="moment.halo.run"
kind="Moment"
@ -62,7 +66,7 @@
with-replies="false"
></comment-widget>
</th:block>
<th:block th:unless="${theme.config.enhance.enable_pjax}">
<th:block th:if="${theme.config.enhance.enable_comment_type}">
<halo:comment
group="moment.halo.run"
kind="Moment"

View File

@ -24,7 +24,11 @@
<div class="main-content not-toc" data-target="Moment" th:data-id="${moment.metadata.name}">
[(${moment.spec.content.html})]
<mew-photos th:if="${!#lists.isEmpty(moment.spec.content.medium)}">
<img th:each="momentItem : ${moment.spec.content.medium}" th:if="${momentItem.type.name == 'PHOTO'}" th:src="${momentItem.url}" />
<img th:each="momentItem : ${moment.spec.content.medium}" th:if="${momentItem.type.name == 'PHOTO'}" th:src="${momentItem.url}"
th:srcset="|${thumbnail.gen(momentItem.url, 's')} 400w,
${thumbnail.gen(momentItem.url, 'm')} 800w,
${thumbnail.gen(momentItem.url, 'l')} 1200w|"
sizes="(max-width: 1200px) 100vw, 1200px"/>
</mew-photos>
<th:block th:if="${!#lists.isEmpty(moment.spec.content.medium)}" th:each="momentItem : ${moment.spec.content.medium}">
<mew-video th:if="${momentItem.type.name == 'VIDEO'}" th:src="${momentItem.url}"></mew-video>
@ -64,7 +68,7 @@
</div>
</div>
<div class="journal-comment comment-wrapper-z-index" th:if="${enableComment}">
<th:block th:if="${theme.config.enhance.enable_pjax}">
<th:block th:unless="${theme.config.enhance.enable_comment_type}">
<comment-widget
group="moment.halo.run"
kind="Moment"
@ -73,7 +77,7 @@
with-replies="false"
></comment-widget>
</th:block>
<th:block th:unless="${theme.config.enhance.enable_pjax}">
<th:block th:if="${theme.config.enhance.enable_comment_type}">
<halo:comment
group="moment.halo.run"
kind="Moment"

View File

@ -12,7 +12,12 @@
</div>
<div class="photos-gallery load-block loading">
<div th:each="photo : ${photos.items}" th:href="${photo.spec.url}" data-fancybox="gallery" th:data-caption="${#strings.defaultString(photo.spec.description, photo.spec.displayName)}">
<img width="100%" height="100%" th:src="${photo.spec.url}" th:alt="${photo.spec.displayName}"/>
<img width="100%" height="100%" th:src="${photo.spec.url}"
th:srcset="|${thumbnail.gen(photo.spec.url, 's')} 400w,
${thumbnail.gen(photo.spec.url, 'm')} 800w,
${thumbnail.gen(photo.spec.url, 'l')} 1200w,
${thumbnail.gen(photo.spec.url, 'xl')} 1600w|"
sizes="(max-width: 1600px) 100vw, 1600px" th:alt="${photo.spec.displayName}"/>
<div class="info">
<div>
<svg viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"><path d="M834.9 913.6H189.7c-69.2 0-125.5-56.3-125.5-125.5V381.5c0-69.2 56.3-125.5 125.5-125.5h14.7c14.4 0 27.3-8.6 32.9-21.8l19.2-45.1c19.7-46.3 65-76.3 115.4-76.3h280.6c50.4 0 95.7 30 115.4 76.3l19.2 45c5.7 13.2 18.6 21.8 33 21.8h14.7c69.2 0 125.5 56.3 125.5 125.5V788c0.1 69.3-56.2 125.6-125.4 125.6z m-645.2-568c-19.8 0-35.8 16.1-35.8 35.8V788c0 19.8 16.1 35.8 35.8 35.8h645.2c19.8 0 35.8-16.1 35.8-35.8V381.5c0-19.8-16.1-35.8-35.8-35.8h-14.7c-50.4 0-95.7-30-115.4-76.3l-19.2-45c-5.6-13.2-18.6-21.8-33-21.8H372c-14.4 0-27.3 8.6-33 21.8l-19.2 45c-19.7 46.3-65 76.3-115.4 76.3h-14.7z"></path><path d="M512.3 742.8c-97.4 0-176.6-79.2-176.6-176.6s79.2-176.6 176.6-176.6 176.6 79.2 176.6 176.6-79.2 176.6-176.6 176.6z m0-263.6c-48 0-87 39-87 87s39 87 87 87 87-39 87-87-39-87-87-87z"></path></svg>

View File

@ -2,7 +2,8 @@
th:fragment="widget (sidebar)"
th:class="'card widget notice ' + ${sidebar.hide} + ' is-hidden-all'">
<div class="card-title">
<i th:class="${#strings.defaultString(sidebar.icon, 'ri-volume-up-line') + ' card-title-label'}"></i><span th:text="${#strings.defaultString(sidebar.title, '公告')}"></span>
<i th:class="${#strings.defaultString(sidebar.icon, 'ri-volume-up-line') + ' card-title-label'}"></i><span
th:text="${#strings.defaultString(sidebar.title, '公告')}"></span>
</div>
<th:block th:if="${#strings.isEmpty(sidebar.content)}">
<div class="card-content">
@ -10,6 +11,8 @@
</div>
</th:block>
<th:block th:if="${!#strings.isEmpty(sidebar.content)}">
<div class="card-content">
[(${sidebar.content})]
</div>
</th:block>
</div>

View File

@ -22,7 +22,7 @@ spec:
# 主题logo地址
logo: /themes/theme-dream2-plus/assets/img/logo.png
# 主题地址
website: https://github.com/zsjy/halo-theme-dream2.0-plus
website: https://www.hcjike.com/docs/halo-theme-dream2.0
# 主题github开源地址
repo: https://github.com/zsjy/halo-theme-dream2.0-plus.git
# 提交问题地址
@ -30,7 +30,7 @@ spec:
settingName: theme-dream2-plus-setting
configMapName: theme-dream2-plus-configMap
# 版本号
version: 1.2.9
version: 1.3.0
# 最低支持的 Halo 版本
require: ">=2.19.0"
# 许可