chore: 适配

This commit is contained in:
nineya 2023-03-23 18:25:48 +08:00
parent cafe34baa3
commit 5362edf111
21 changed files with 641 additions and 557 deletions

117
annotation-setting.yaml Normal file
View File

@ -0,0 +1,117 @@
apiVersion: v1alpha1
kind: AnnotationSetting
metadata:
generateName: annotation-setting-
spec:
targetRef:
group: content.halo.run
kind: Post
formSchema:
- $formkit: radio
name: enable_copyright
label: 开启文章版权声明
help: '当前配置将覆盖主题中的默认配置。'
options:
- value: true
label: 开启
- value: false
label: 关闭
- $formkit: select
name: top_thumbnail_mode
label: 置顶文章列表缩略图模式
help: '文章在列表的缩略图模式,除网格布局外,当前配置将覆盖主题中的默认配置。'
options:
- value: default
label: 默认模式
- value: back
label: 背景图模式
- value: small
label: 小图模式(左侧)
- value: small-right
label: 小图模式(右侧)
- value: small-alter
label: 小图模式(交替)
- value: fold
label: 折叠模式
- $formkit: text
name: tips
label: 文章提示
placeholder: '请输入提示内容'
help: '在文章顶部显示一条提示。'
- $formkit: radio
name: enable_katex
label: KaTeX 公式支持
value: false
help: '博客通过 KaTeX 做数学公式渲染,当前配置将覆盖主题中的默认配置。'
options:
- value: true
label: 开启
- value: false
label: 关闭
- $formkit: radio
name: enable_share
label: 开启文章分享
value: true
help: '当前配置将覆盖主题中的默认配置。'
options:
- value: true
label: 开启
- value: false
label: 关闭
- $formkit: radio
name: index_carousel
label: 开启置顶轮播
value: true
help: '如果该文章被置顶,在此处可开启文章置顶轮播。'
options:
- value: true
label: 开启
- value: false
label: 关闭
---
apiVersion: v1alpha1
kind: AnnotationSetting
metadata:
generateName: annotation-setting-
spec:
targetRef:
group: content.halo.run
kind: SinglePage
formSchema:
- $formkit: radio
name: enable_copyright
label: 开启文章版权声明
value: true
help: '当前配置将覆盖主题中的默认配置。'
options:
- value: true
label: 开启
- value: false
label: 关闭
- $formkit: text
name: tips
label: 文章提示
placeholder: '请输入提示内容'
help: '在文章顶部显示一条提示。'
- $formkit: radio
name: enable_katex
label: KaTeX 公式支持
value: false
help: '博客通过 KaTeX 做数学公式渲染,当前配置将覆盖主题中的默认配置。'
options:
- value: true
label: 开启
- value: false
label: 关闭
- $formkit: radio
name: enable_share
label: 开启文章分享
value: true
help: '当前配置将覆盖主题中的默认配置。'
options:
- value: true
label: 开启
- value: false
label: 关闭

View File

@ -8,7 +8,7 @@
"test": "echo \"Error: no test specified\" && exit 1", "test": "echo \"Error: no test specified\" && exit 1",
"release": "eslint **/*.js && gulp release", "release": "eslint **/*.js && gulp release",
"push": "eslint **/*.js && gulp push", "push": "eslint **/*.js && gulp push",
"zip": "eslint **/*.js && gulp zip", "zip": "gulp zip",
"build": "eslint **/*.js && gulp", "build": "eslint **/*.js && gulp",
"lint": "eslint **/*.js" "lint": "eslint **/*.js"
}, },

View File

@ -468,16 +468,15 @@ spec:
label: 侧边栏展示 label: 侧边栏展示
help: 配置侧边栏展示方式,三列布局时不能在右侧显示音乐模块。 help: 配置侧边栏展示方式,三列布局时不能在右侧显示音乐模块。
value: value:
- name: QQ - name: notice
icon: <i class="fa-brands fa-qq"></i> position: left
url: https://api.sumt.cn/api/qq.talk.php?qq=自己的QQ号&format=card hide: is-not-hidden
delete: true - name: notice
- name: Github position: right
icon: <i class="fa-brands fa-github"></i> hide: is-not-hidden
url: - name: notice
- name: Email position: right
icon: <i class="fa-solid fa-envelope"></i> hide: is-not-hidden
url: mailto:邮箱地址
children: children:
- $formkit: select - $formkit: select
name: type name: type
@ -506,8 +505,8 @@ spec:
label: 文章标签模块 label: 文章标签模块
- value: 'tagcloud' - value: 'tagcloud'
label: 文章标签云模块 label: 文章标签云模块
- value: 'links' # - value: 'links'
label: 友链模块 # label: 友链模块
- $formkit: select - $formkit: select
name: position name: position
label: 模块位置 label: 模块位置
@ -643,16 +642,15 @@ spec:
label: 侧边栏音乐-自建API label: 侧边栏音乐-自建API
placeholder: '请输入 API 地址' placeholder: '请输入 API 地址'
help: '自建 API 方法见文档:<a href="https://github.com/metowolf/Meting" target="_blank">Meting</a>。' help: '自建 API 方法见文档:<a href="https://github.com/metowolf/Meting" target="_blank">Meting</a>。'
# - $formkit: text - $formkit: radio
# name: music_mode name: music_mode
# label: 侧边栏音乐-音乐播放器配置方式 label: 侧边栏音乐-音乐播放器配置方式
# type: radio value: 'playlist'
# value: 'playlist' options:
# options: - value: 'playlist'
# - value: 'playlist' label: '网易云歌单 ID'
# label: '网易云歌单 ID' - value: 'config'
# - value: 'config' label: 参数进阶配置
# label: 参数进阶配置
- $formkit: text - $formkit: text
name: netease_playlist_id name: netease_playlist_id
label: '侧边栏音乐-网易云歌单 ID' label: '侧边栏音乐-网易云歌单 ID'
@ -679,17 +677,15 @@ spec:
# label: 显示 # label: 显示
# - value: false # - value: false
# label: 不显示 # label: 不显示
# - $formkit: text - $formkit: radio
# name: ad_tag_close name: ad_tag_close
# label: 侧边栏广告-点击“广告”标签可关闭广告 label: 侧边栏广告-点击“广告”标签可关闭广告
# type: radio value: true
# data-type: bool options:
# value: true - value: true
# options: label:
# - value: true - value: false
# label: 是 label:
# - value: false
# label: 否
# - $formkit: text # - $formkit: text
# name: ad_mode # name: ad_mode
# label: 侧边栏广告-广告展示方法 # label: 侧边栏广告-广告展示方法
@ -718,16 +714,16 @@ spec:
# type: textarea # type: textarea
# placeholder: '请输入广告代码' # placeholder: '请输入广告代码'
# help: '在这里黏贴广告联盟提供的广告代码,<u>自定义广告代码模式时不能为空。' # help: '在这里黏贴广告联盟提供的广告代码,<u>自定义广告代码模式时不能为空。'
# - $formkit: text - $formkit: text
# name: recent_posts_num name: recent_posts_num
# label: 侧边栏最近文章-展示文章数量 label: 侧边栏最近文章-展示文章数量
# placeholder: 请输入数量数值 placeholder: 请输入数量数值
# value: 5 value: 5
# - $formkit: text - $formkit: text
# name: recent_comments_num name: recent_comments_num
# label: 侧边栏最近评论-展示评论数量 label: 侧边栏最近评论-展示评论数量
# placeholder: 请输入数量数值 placeholder: 请输入数量数值
# value: 5 value: 5
# - $formkit: text # - $formkit: text
# name: categories_more # name: categories_more
# label: 侧边栏分类-显示”更多”按钮 # label: 侧边栏分类-显示”更多”按钮
@ -740,72 +736,62 @@ spec:
# label: 显示 # label: 显示
# - value: false # - value: false
# label: 不显示 # label: 不显示
# - $formkit: text - $formkit: text
# name: categories_num name: categories_num
# label: 侧边栏分类-展示分类数量 label: 侧边栏分类-展示分类数量
# placeholder: 请输入数量数值 placeholder: 请输入数量数值
# value: 10 value: 10
# - $formkit: text - $formkit: radio
# name: tags_more name: tags_more
# label: 侧边栏标签-显示”更多”按钮 label: 侧边栏标签-显示”更多”按钮
# type: radio value: true
# data-type: bool help: '超出展示的标签数量后是否显示更多按钮。'
# value: true options:
# help: '超出展示的标签数量后是否显示更多按钮。' - value: true
# options: label: 显示
# - value: true - value: false
# label: 显示 label: 不显示
# - value: false - $formkit: text
# label: 不显示 name: tags_num
# - $formkit: text label: 侧边栏标签-展示标签数量
# name: tags_num placeholder: 请输入数量数值
# label: 侧边栏标签-展示标签数量 value: 18
# placeholder: 请输入数量数值 - $formkit: radio
# value: 18 name: enable_tag_color
# - $formkit: text label: 侧边栏标签-开启标签颜色
# name: enable_tag_color value: false
# label: 侧边栏标签-开启标签颜色 options:
# type: switch - value: true
# data-type: bool label: 开启
# value: false - value: false
# options: label: 关闭
# - value: true - $formkit: radio
# label: 开启 name: tagcloud_more
# - value: false label: 侧边栏标签云-显示”更多”按钮
# label: 关闭 value: true
# - $formkit: text help: '超出展示的标签数量后是否显示更多按钮。'
# name: tagcloud_more options:
# label: 侧边栏标签云-显示”更多”按钮 - value: true
# type: radio label: 显示
# data-type: bool - value: false
# value: true label: 不显示
# help: '超出展示的标签数量后是否显示更多按钮。' - $formkit: text
# options: name: tagcloud_num
# - value: true label: 侧边栏标签云-展示标签数量
# label: 显示 placeholder: 请输入数量数值
# - value: false value: 32
# label: 不显示 - $formkit: radio
# - $formkit: text name: enable_tagcloud_color
# name: tagcloud_num label: 侧边栏标签云-开启标签颜色
# label: 侧边栏标签云-展示标签数量 value: false
# placeholder: 请输入数量数值 options:
# value: 32 - value: true
# - $formkit: text label: 开启
# name: enable_tagcloud_color - value: false
# label: 侧边栏标签云-开启标签颜色 label: 关闭
# type: switch # - $formkit: radio
# data-type: bool
# value: false
# options:
# - value: true
# label: 开启
# - value: false
# label: 关闭
# - $formkit: text
# name: links_more # name: links_more
# label: 侧边栏友链-显示”更多”按钮 # label: 侧边栏友链-显示”更多”按钮
# type: radio
# data-type: bool
# value: true # value: true
# help: '超出展示的友链数量后是否显示更多按钮。' # help: '超出展示的友链数量后是否显示更多按钮。'
# options: # options:

View File

@ -91,86 +91,60 @@
// </#if> // </#if>
/** 主题配置 */ /** 主题配置 */
const DreamConfig = {}; const DreamConfig = {};
DreamConfig["theme_version"] = '${theme_version!}'; DreamConfig["theme_version"] = [[${theme.spec.version}]];
DreamConfig["theme_base"] = '${theme_base!}'; DreamConfig["theme_base"] = "[(${#theme.assets('/')})]";
DreamConfig["access_key"] = '${settings.access_key!'dream'}' [(${!#strings.isEmpty(theme.config.post.code_fold_line)?'DreamConfig["code_fold_line"] = "' + theme.config.post.code_fold_line + '";': ''})]
DreamConfig["code_fold_line"] = [[${theme.config.post.code_fold_line}]] [(${!#strings.isEmpty(theme.config.basic_info.document_hidden_title)?'DreamConfig["document_hidden_title"] = "' + 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 + '";' : ''})]
<#if settings.document_visible_title?? && settings.document_visible_title!=''> [(${!#strings.isEmpty(theme.config.basic_info.website_time)?'DreamConfig["website_time"] = "' + theme.config.basic_info.website_time + '";' : ''})]
DreamConfig["document_visible_title"] = '${settings.document_visible_title}'; // <#if settings.enable_color_character!false>
</#if> // 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 settings.enable_color_character!false> // </#if>
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 settings.sidebar_notice?? && settings.sidebar_notice!='none'>
</#if> // DreamConfig["notice_show_mode"] = '${settings.notice_show_mode!'index'}';
<#if settings.website_time?? && settings.website_time!=''> // </#if>
DreamConfig["website_time"] = '${settings.website_time}'; [(${(!#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 + ';': ''})]
</#if> // <#if settings.journals_fold_height?? && settings.journals_fold_height?number gte 260>
<#if settings.sidebar_notice?? && settings.sidebar_notice!='none'> // DreamConfig["journals_fold_height"] = ${settings.journals_fold_height};
DreamConfig["notice_show_mode"] = '${settings.notice_show_mode!'index'}'; // </#if>
</#if> [(${theme.config.enhance.cursor_move != 'none'?'DreamConfig["cursor_move"] = "' + theme.config.enhance.cursor_move + '";': ''})]
<#if settings.img_fold_height?? && settings.img_fold_height?number gte 400> [(${theme.config.enhance.cursor_click != 'none'?'DreamConfig["cursor_click"] = "' + theme.config.enhance.cursor_click + '";': ''})]
DreamConfig["img_fold_height"] = ${settings.img_fold_height}; [(${theme.config.enhance.effects_sakura_mode != 'none'?'DreamConfig["effects_sakura_mode"] = "' + theme.config.enhance.effects_sakura_mode + '";': ''})]
</#if> [(${theme.config.enhance.effects_universe_mode != 'none'?'DreamConfig["effects_universe_mode"] = "' + theme.config.enhance.effects_universe_mode + '";': ''})]
<#if settings.journals_fold_height?? && settings.journals_fold_height?number gte 260> [(${theme.config.enhance.effects_circle_magic_mode != 'none'?'DreamConfig["effects_circle_magic_mode"] = "' + theme.config.enhance.effects_circle_magic_mode + '";': ''})]
DreamConfig["journals_fold_height"] = ${settings.journals_fold_height}; [(${theme.config.enhance.enable_baidu_push?'DreamConfig["enable_baidu_push"] = true;': ''})]
</#if> [(${theme.config.enhance.enable_toutiao_push?'DreamConfig["enable_toutiao_push"] = true;': ''})]
<#if settings.cursor_move?? && settings.cursor_move!='none'> [(${theme.config.basic_style.load_progress != 'none'?'DreamConfig["load_progress"] = "' + theme.config.basic_style.load_progress + '";': ''})]
DreamConfig["cursor_move"] = '${settings.cursor_move}'; // <#if settings.journals_share_image?? && settings.journals_share_image != 'none'>
</#if> // DreamConfig["journals_share_image"] = '${settings.journals_share_image}';
<#if settings.cursor_click?? && settings.cursor_click!='none'> // </#if>
DreamConfig["cursor_click"] = '${settings.cursor_click}'; [(${!#strings.isEmpty(theme.config.sidebar.meting_api)?'var meting_api = "' + theme.config.sidebar.meting_api + '";': ''})]
</#if> // /** 看板娘相关配置 */
<#if settings.effects_sakura_mode?? && settings.effects_sakura_mode!='none'> // <#if settings.enable_live2d!true>
DreamConfig["effects_sakura_mode"] = '${settings.effects_sakura_mode}'; // DreamConfig["enable_live2d"] = true;
</#if> // <#if settings.live2d_about_page?? && settings.live2d_about_page!=''>
<#if settings.effects_universe_mode?? && settings.effects_universe_mode!='none'> // DreamConfig["live2d_about_page"] = '${settings.live2d_about_page}';
DreamConfig["effects_universe_mode"] = '${settings.effects_universe_mode}'; // </#if>
</#if> // DreamConfig["live2d_model_url"] = '${settings.live2d_model_url!'https://unpkg.com/live2d-widget-model@1.0.1/'}';
<#if settings.effects_circle_magic_mode?? && settings.effects_circle_magic_mode!='none'> // DreamConfig["live2d_tips_url"] = '${settings.live2d_tips_url!'/themes/dream/source/lib/live2d@1.0.1/waifu-tips.json'}';
DreamConfig["effects_circle_magic_mode"] = '${settings.effects_circle_magic_mode}'; // DreamConfig["live2d_edge_side"] = '${settings.live2d_edge_side!'right:50'}';
</#if> // DreamConfig["live2d_waifu_size"] = '${settings.live2d_waifu_size!'280x260'}';
<#if settings.enable_baidu_push!false> // DreamConfig["live2d_model_id"] = '${settings.live2d_model_id!'0'}';
DreamConfig["enable_baidu_push"] = true; // DreamConfig["live2d_model_textures_id"] = '${settings.live2d_model_textures_id!'0'}';
</#if> // DreamConfig["live2d_show_tool_menu"] = ${(settings.live2d_show_tool_menu!true)?c};
<#if settings.enable_toutiao_push!false> // DreamConfig["live2d_can_turn_to_home_page"] = ${(settings.live2d_can_turn_to_home_page!true)?c};
DreamConfig["enable_toutiao_push"] = true; // DreamConfig["live2d_can_switch_hitokoto"] = ${(settings.live2d_can_switch_hitokoto!true)?c};
</#if> // DreamConfig["live2d_can_switch_model"] = ${(settings.live2d_can_switch_model!true)?c};
<#if settings.load_progress?? && settings.load_progress != 'none'> // DreamConfig["live2d_can_switch_textures"] = ${(settings.live2d_can_switch_textures!true)?c};
DreamConfig["load_progress"] = '${settings.load_progress}'; // DreamConfig["live2d_can_take_screenshot"] = ${(settings.live2d_can_take_screenshot!true)?c};
</#if> // DreamConfig["live2d_can_turn_to_about_page"] = ${(settings.live2d_can_turn_to_about_page!true)?c};
<#if settings.journals_share_image?? && settings.journals_share_image != 'none'> // DreamConfig["live2d_can_close_live2d"] = ${(settings.live2d_can_close_live2d!true)?c};
DreamConfig["journals_share_image"] = '${settings.journals_share_image}'; // DreamConfig["live2d_model_rand_mode"] = '${settings.live2d_model_rand_mode!'switch'}';
</#if> // DreamConfig["live2d_model_textures_rand_mode"] = '${settings.live2d_model_textures_rand_mode!'rand'}';
<#if settings.meting_api?? && settings.meting_api != ''> // </#if>
var meting_api = '${settings.meting_api}';
</#if>
/** 看板娘相关配置 */
<#if settings.enable_live2d!true>
DreamConfig["enable_live2d"] = true;
<#if settings.live2d_about_page?? && settings.live2d_about_page!=''>
DreamConfig["live2d_about_page"] = '${settings.live2d_about_page}';
</#if>
DreamConfig["live2d_model_url"] = '${settings.live2d_model_url!'https://unpkg.com/live2d-widget-model@1.0.1/'}';
DreamConfig["live2d_tips_url"] = '${settings.live2d_tips_url!'/themes/dream/source/lib/live2d@1.0.1/waifu-tips.json'}';
DreamConfig["live2d_edge_side"] = '${settings.live2d_edge_side!'right:50'}';
DreamConfig["live2d_waifu_size"] = '${settings.live2d_waifu_size!'280x260'}';
DreamConfig["live2d_model_id"] = '${settings.live2d_model_id!'0'}';
DreamConfig["live2d_model_textures_id"] = '${settings.live2d_model_textures_id!'0'}';
DreamConfig["live2d_show_tool_menu"] = ${(settings.live2d_show_tool_menu!true)?c};
DreamConfig["live2d_can_turn_to_home_page"] = ${(settings.live2d_can_turn_to_home_page!true)?c};
DreamConfig["live2d_can_switch_hitokoto"] = ${(settings.live2d_can_switch_hitokoto!true)?c};
DreamConfig["live2d_can_switch_model"] = ${(settings.live2d_can_switch_model!true)?c};
DreamConfig["live2d_can_switch_textures"] = ${(settings.live2d_can_switch_textures!true)?c};
DreamConfig["live2d_can_take_screenshot"] = ${(settings.live2d_can_take_screenshot!true)?c};
DreamConfig["live2d_can_turn_to_about_page"] = ${(settings.live2d_can_turn_to_about_page!true)?c};
DreamConfig["live2d_can_close_live2d"] = ${(settings.live2d_can_close_live2d!true)?c};
DreamConfig["live2d_model_rand_mode"] = '${settings.live2d_model_rand_mode!'switch'}';
DreamConfig["live2d_model_textures_rand_mode"] = '${settings.live2d_model_textures_rand_mode!'rand'}';
</#if>
/** 配置主题模式 */ /** 配置主题模式 */
DreamConfig["default_theme"] = '${settings.default_theme!'light'}'; DreamConfig["default_theme"] = '[(${theme.config.basic_style.default_theme})]';
(function(){ (function(){
let isNight = DreamConfig.default_theme === 'system'? matchMedia('(prefers-color-scheme: dark)').matches : localStorage.getItem('night') || DreamConfig.default_theme === 'night'; let isNight = DreamConfig.default_theme === 'system'? matchMedia('(prefers-color-scheme: dark)').matches : localStorage.getItem('night') || DreamConfig.default_theme === 'night';
if (isNight.toString() === 'true') { if (isNight.toString() === 'true') {

View File

@ -55,19 +55,13 @@
<th:block th:replace="~{common/config}"/> <th:block th:replace="~{common/config}"/>
<script src="@{/assets/lib/jquery@3.5.1/jquery.min.js}"></script> <script th:src="@{/assets/lib/jquery@3.5.1/jquery.min.js}"></script>
<script th:if="${theme.config.enhance.enable_patch}" src="//cdn.jsdelivr.net/gh/nineya/halo-theme-dream@master/src/patch.js"></script> <script th:if="${theme.config.enhance.enable_patch}" src="//cdn.jsdelivr.net/gh/nineya/halo-theme-dream@master/src/patch.js"></script>
<!--<#if settings.external_css?? && settings.external_css!=''>--> <link th:if="${!#strings.isEmpty(theme.config.custom.external_css)}" rel="stylesheet" th:href="${theme.config.custom.external_css}">
<!-- <link rel="stylesheet" th:href="${settings.external_css!}">-->
<!--</#if>--> <style th:if="${!#strings.isEmpty(theme.config.custom.inline_css)}" type="text/css" th:text="${theme.config.custom.inline_css}"></style>
<!--<#if settings.inline_css?? && settings.inline_css!=''>--> [(${theme.config.custom.external_js_head})]
<!-- <style type="text/css">${settings.inline_css!}</style>--> <script th:if="${!#strings.isEmpty(theme.config.custom.inline_js_head)}" type="text/javascript" th:text="${theme.config.custom.inline_js_head}">
<!--</#if>--> </script>
<!--${settings.external_js_head!}-->
<!--<#if settings.inline_js_head?? && settings.inline_js_head!=''>-->
<!-- <script type="text/javascript">-->
<!-- ${settings.inline_js_head!}-->
<!-- </script>-->
<!--</#if>-->
</head> </head>

View File

@ -1,6 +1,7 @@
<html lang="zh" xmlns:th="https://www.thymeleaf.org" <html lang="zh" xmlns:th="https://www.thymeleaf.org"
th:fragment="layout (title, canonical, content, isPost)"> th:fragment="layout (title, canonical, content, isPost)"
<th:block th:if="${#strings.equals('',param._pjax) == false}"> th:with="isPjax = ${#strings.equals('',param._pjax)}">
<th:block th:if="${isPjax}">
<th:block th:replace="~{common/head :: head}"/> <th:block th:replace="~{common/head :: head}"/>
<body> <body>
<div class="column-main"> <div class="column-main">
@ -9,7 +10,7 @@
<th:block th:replace="~{common/scripts}"/> <th:block th:replace="~{common/scripts}"/>
</body> </body>
</th:block> </th:block>
<th:block th:if="${#strings.equals('',param._pjax)}"> <th:block th:unless="${isPjax}">
<th:block th:replace="~{common/head :: head}"/> <th:block th:replace="~{common/head :: head}"/>
<body> <body>
<th:block th:replace="~{common/navbar}"/> <th:block th:replace="~{common/navbar}"/>
@ -17,12 +18,11 @@
<th:block th:replace="~{common/banner :: banner}"/> <th:block th:replace="~{common/banner :: banner}"/>
</th:block> </th:block>
<section class="section"> <section class="section">
<div class="${theme.config.basic_style.sidebar_column != 'all' ? 'container two-column' : 'container' }"> <div th:class="${theme.config.basic_style.sidebar_column != 'all' ? 'container two-column' : 'container' }">
<div class="columns"> <div class="columns">
<div class="column column-main"> <div class="column column-main">
<th:block th:insert="${content}"/> <th:block th:insert="${content}"/>
</div> </div>
<th:block th:insert="${content}"/>
<th:block th:if="${theme.config.basic_style.sidebar_column!='only-right' && theme.config.basic_style.sidebar_column!='module-left'}"> <th:block th:if="${theme.config.basic_style.sidebar_column!='only-right' && theme.config.basic_style.sidebar_column!='module-left'}">
<th:block th:replace="~{common/widget :: widget('left')}"/> <th:block th:replace="~{common/widget :: widget('left')}"/>
</th:block> </th:block>

View File

@ -1,9 +1,9 @@
<aside xmlns:th="https://www.thymeleaf.org" <aside xmlns:th="https://www.thymeleaf.org"
th:fragment="widget (position)" th:fragment="widget (position)"
class="column column-side column-${position} ${settings[position+'_sidebar_sticky']!'none'}-sticky"> th:class="'column column-side column-' + ${position} + ' ' + ${position == 'left'?theme.config.basic_style.left_sidebar_sticky:theme.config.basic_style.right_sidebar_sticky} + '-sticky'">
<th:block th:each="sidebar :${theme.config.sidebar.sidebar_show}"> <th:block th:each="sidebar :${theme.config.sidebar.sidebar_show}">
<th:block th:if="${sidebar.position == position}"> <th:block th:if="${sidebar.position == position}">
<th:block th:replace="~{${'/widget/' + sidebar.type}}" /> <th:block th:replace="~{${'/widget/' + sidebar.type} :: widget ( hide = ${sidebar.hide})}" />
</th:block> </th:block>
</th:block> </th:block>
<div th:if="${position == 'left'}" class="column-right-shadow is-hidden-desktop"> <div th:if="${position == 'left'}" class="column-right-shadow is-hidden-desktop">

View File

@ -1,22 +1,17 @@
<!DOCTYPE html> <!DOCTYPE html>
<html xmlns:th="https://www.thymeleaf.org" <html xmlns:th="https://www.thymeleaf.org"
th:replace="~{common/layout :: layout (title = ${site.title}, canonical = ${site.url}, content = ~{::content}, isPost = false)}"> th:replace="~{common/layout :: layout (title = ${site.title}, canonical = ${site.url}, content = ~{::content}, isPost = false)}">
<th:block th:fragment="content"> <th:block th:fragment="content" th:with="isEmpty = ${#lists.isEmpty(posts)}">
首页 <div th:if="${isEmpty}" class="card card-empty">
</th:block> <i class="fa fa-inbox"></i>
</html> 还没有发表过文章
<!--<#include "templates/layout_pjax.html">--> </div>
<!--<#global is_first_index=(posts.number == 0) >--> <th:block th:unless="${isEmpty}">
<!--<@layout title="${blog_title!}" canonical="${blog_url!}">--> <th:block th:replace="~{main/article_list :: articleList (${posts.items}, ${posts.first})}"/>
<!-- <#if posts.content?? && posts.content?size gt 0>-->
<!-- <#include "templates/main/article_list.html">--> <!-- <#include "templates/main/article_list.html">-->
<!-- <@article_list posts.content/>--> <!-- <@article_list posts.content/>-->
<!-- <#include "templates/main/pagination.html">--> <!-- <#include "templates/main/pagination.html">-->
<!-- <@pagination method="index" datas=posts display="${settings.page_number!5}" />--> <!-- <@pagination method="index" datas=posts display="${settings.page_number!5}" />-->
<!-- <#else>--> </th:block>
<!-- <div class="card card-empty">--> </th:block>
<!-- <i class="fa fa-inbox"></i>--> </html>
<!-- 还没有发表过文章-->
<!-- </div>-->
<!-- </#if>-->
<!--</@layout>-->

View File

@ -1,260 +1,268 @@
<#macro model_build content> <div xmlns:th="https://www.thymeleaf.org"
<#if content == ''> th:fragment="articleList (posts, isFirstIndex)">
<#return> <th:block th:each="post : ${posts}"
</#if> th:with="thumbnail = ${#strings.isEmpty(post.spec.cover) ? theme.config.post.default_thumbnail + '?id=' + postStat.index : post.spec.cover}">
<#local content_option=content?split('|')> [(${thumbnail})]
<#local tag=(content_option[0]!'')?trim> </th:block>
<#local content=((content_option[1]!'')?trim != '')?then('<div class="title">${content_option[1]?trim}</div>', '')>
<#local target=((content_option[2]!'false')?trim == 'true')?then('target="_blank"', '')>
<#local imageUrl=((content_option[3]!'')?trim != '')?then('style="background-image: url(${content_option[3]?trim})"', '')>
<#local targetUrl=((content_option[4]!'')?trim != '')?then('href="${content_option[4]?trim}"', '')>
<a class="card widget brightness ${(content!='')?then('bg-shadow', '')}" ${target} ${imageUrl} ${targetUrl}>${content}<div class="tag">${tag}</div></a>
</#macro>
<#macro article_list posts>
<#if is_first_index!false>
<#local carousel_content>
<#list posts as post>
<#if post.topPriority!=1>
<#break>
</#if>
<#if !post.metas?? || (post.metas.index_carousel!'false')=='false'>
<#continue>
</#if>
<#local thumbnail = (post.thumbnail?? && post.thumbnail!='')?then(post.thumbnail!, (settings.default_thumbnail?? && settings.default_thumbnail!='')?then(settings.default_thumbnail + settings.default_thumbnail?contains('?')?then("&","?") + "postId=" + post.id?c, ''))>
<#if thumbnail != ''>
<a class="swiper-slide bg-shadow cover-image" style="background-image: url(${thumbnail})" href="${post.fullPath!}">
<div class="swiper-slide-details" data-swiper-parallax="200" data-swiper-parallax-duration="600">
<p class="swiper-slide-details-title">${post.title!}</p>
<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>
<li><i class="fa fa-thumbs-o-up"></i>${post.likes?c}</li>
<#local heat= (24+post.visits*0.1+post.likes*2+post.commentCount*3) />
<#local heatColor= '#'+(heat < 37)?string('ffa87e',(heat < 120)?string('fb734a','e0081c')) />
<li style="color: ${heatColor}">${heat}℃</li>
</ul>
</div> </div>
</a> <!-- <#list posts as post>-->
</#if> <!-- <#local thumbnail = (post.thumbnail?? && post.thumbnail!='')?then(post.thumbnail!, (settings.default_thumbnail?? && settings.default_thumbnail!='')?then(settings.default_thumbnail + settings.default_thumbnail?contains('?')?then("&","?") + "postId=" + post.id?c, ''))>-->
</#list> <!-- <#if is_first_index?? && thumbnail != '' && !(post.topPriority!=1 || !post.metas?? || (post.metas.index_carousel!'false')=='false')>-->
</#local> <!-- <#continue>-->
<#if settings.sidebar_column=='module-left' || settings.sidebar_column=='module-right'> <!--</#if>-->
<#if settings.module_links?? && settings.module_links?trim != ''> <!--<#local thumbnail_mode = ((settings.top_thumbnail_mode!'default')=='grid' || (post.topPriority==0 && (settings.thumbnail_mode!'default')=='grid'))?then(-->
<#local module_links=settings.module_links?split('\n')> <!--'grid', (post.metas?? && (post.metas.thumbnail_mode!'')?trim!='')?then(post.metas.thumbnail_mode?trim, (post.topPriority==1)?then(settings.top_thumbnail_mode!'back', settings.thumbnail_mode!'default')))>-->
<#else> <!--<#if thumbnail != '' && thumbnail_mode == "back">-->
<#local module_links=[]> <!--<div class="card widget card-cover">-->
<#list 0..1 as i> <!-- <a href="${post.fullPath!}">-->
<#local post=posts[i]> <!-- <div class="cover-image" style="background-image: url(${thumbnail!})">-->
<#local module_links=module_links+["推荐|${post.title!}|false|${post.thumbnail!}|${post.fullPath!}"]> <!-- </div>-->
</#list> <!-- <div class="details">-->
</#if> <!-- <h2 class="title"><#if post.topPriority==1><span class="top">置顶</span></#if>${post.title!}-->
<div class="model model-index"> <!-- </h2>-->
<div class="card widget swiper"> <!-- <ul class="breadcrumb">-->
<div class="swiper-wrapper">${carousel_content}</div> <!-- <li><@global.timeline datetime=post.createTime/></li>-->
<div class="swiper-pagination"></div> <!-- <li><i class="fa fa-eye"></i>${post.visits?c}</li>-->
<div class="swiper-button-prev"></div> <!-- <#if !post.disallowComment!false>-->
<div class="swiper-button-next"></div> <!-- <li><i class="fa fa-comments-o"></i>${post.commentCount?c}</li></#if>-->
</div> <!-- <li><i class="fa fa-thumbs-o-up"></i>${post.likes?c}</li>-->
<div class="model model-index-side"> <!-- <#local heat= (24+post.visits*0.1+post.likes*2+post.commentCount*3) />-->
<#list 0..1 as i> <!-- <#local heatColor= '#'+(heat < 37)?string('ffa87e',(heat < 120)?string('fb734a','e0081c')) />-->
<#if i &lt; module_links?size > <!-- <li style="color: ${heatColor}">${heat}℃</li>-->
<@model_build module_links[i]/> <!-- </ul>-->
</#if> <!-- </div>-->
</#list> <!-- </a>-->
</div> <!-- <#if post.categories?? && post.categories?size gt 0>-->
</div> <!-- <div class="category">-->
<#if module_links?size &gt; 2 && module_links?size&lt;=6> <!-- <#list post.categories as category>-->
<div class="model model-attach model-attach-${module_links?size-2}"> <!-- <a href="${category.fullPath!}">${category.name!}</a>-->
<#list 2..5 as i> <!-- </#list>-->
<#if i &lt; module_links?size > <!--</div>-->
<@model_build module_links[i]/> <!--</#if>-->
</#if> <!--</div>-->
</#list> <!--<#elseif thumbnail != '' && (thumbnail_mode == "small" || (thumbnail_mode == "small-alter" && post_index%2 == 0))>-->
</div> <!--<div class="card widget card-small">-->
</#if> <!-- <a href="${post.fullPath!}">-->
<#assign is_carousel=true /> <!-- <div class="small-image" style="background-image: url(${thumbnail!})"></div>-->
<#elseif carousel_content != ''> <!-- </a>-->
<div class="card widget swiper"> <!-- <div class="card-content main">-->
<div class="swiper-wrapper">${carousel_content}</div> <!-- <h2 class="title">-->
<div class="swiper-pagination"></div> <!-- <#if post.topPriority==1><span class="top">置顶</span></#if><a-->
<div class="swiper-button-prev"></div> <!-- href="${post.fullPath!}">${post.title!}</a>-->
<div class="swiper-button-next"></div> <!-- </h2>-->
</div> <!-- <div class="main-content">${post.summary!}</div>-->
<#assign is_carousel=true /> <!-- <hr/>-->
</#if> <!-- <div class="meta">-->
<#if settings.index_inform?? && settings.index_inform != ''> <!-- <ul class="breadcrumb">-->
<div class="card tips brightness">${settings.index_inform}</div> <!-- <li><@global.timeline datetime=post.createTime/></li>-->
</#if> <!-- <li><i class="fa fa-eye"></i>${post.visits?c}</li>-->
</#if> <!-- <#if !post.disallowComment!false><li><i class="fa fa-comments-o"></i>${post.commentCount?c}</li></#if>-->
<#list posts as post> <!-- <li><i class="fa fa-thumbs-o-up"></i>${post.likes?c}</li>-->
<#local thumbnail = (post.thumbnail?? && post.thumbnail!='')?then(post.thumbnail!, (settings.default_thumbnail?? && settings.default_thumbnail!='')?then(settings.default_thumbnail + settings.default_thumbnail?contains('?')?then("&","?") + "postId=" + post.id?c, ''))> <!-- <#local heat= (24+post.visits*0.1+post.likes*2+post.commentCount*3) />-->
<#if is_first_index?? && thumbnail != '' && !(post.topPriority!=1 || !post.metas?? || (post.metas.index_carousel!'false')=='false')> <!-- <#local heatColor= '#'+(heat < 37)?string('ffa87e',(heat < 120)?string('fb734a','e0081c')) />-->
<#continue> <!-- <li style="color: ${heatColor}">${heat}℃</li>-->
</#if> <!-- </ul>-->
<#local thumbnail_mode = ((settings.top_thumbnail_mode!'default')=='grid' || (post.topPriority==0 && (settings.thumbnail_mode!'default')=='grid'))?then( <!-- <#if post.categories?? && post.categories?size gt 0>-->
'grid', (post.metas?? && (post.metas.thumbnail_mode!'')?trim!='')?then(post.metas.thumbnail_mode?trim, (post.topPriority==1)?then(settings.top_thumbnail_mode!'back', settings.thumbnail_mode!'default')))> <!-- <div class="level-item is-hidden-mobile">-->
<#if thumbnail != '' && thumbnail_mode == "back"> <!-- <#list post.categories as category>-->
<div class="card widget card-cover"> <!-- <a href="${category.fullPath!}">${category.name!}</a>&nbsp;-->
<a href="${post.fullPath!}"> <!-- </#list>-->
<div class="cover-image" style="background-image: url(${thumbnail!})"> <!-- </div>-->
</div> <!-- </#if>-->
<div class="details"> <!--</div>-->
<h2 class="title"><#if post.topPriority==1><span class="top">置顶</span></#if>${post.title!} <!--</div>-->
</h2> <!--</div>-->
<ul class="breadcrumb"> <!--<#elseif thumbnail != '' && (thumbnail_mode == "small-right" || (thumbnail_mode == "small-alter" && post_index%2 == 1))>-->
<li><@global.timeline datetime=post.createTime/></li> <!--<div class="card widget card-small">-->
<li><i class="fa fa-eye"></i>${post.visits?c}</li> <!-- <div class="card-content main">-->
<#if !post.disallowComment!false> <!-- <h2 class="title">-->
<li><i class="fa fa-comments-o"></i>${post.commentCount?c}</li></#if> <!-- <#if post.topPriority==1><span class="top">置顶</span></#if><a-->
<li><i class="fa fa-thumbs-o-up"></i>${post.likes?c}</li> <!-- href="${post.fullPath!}">${post.title!}</a>-->
<#local heat= (24+post.visits*0.1+post.likes*2+post.commentCount*3) /> <!-- </h2>-->
<#local heatColor= '#'+(heat < 37)?string('ffa87e',(heat < 120)?string('fb734a','e0081c')) /> <!-- <div class="main-content">${post.summary!}</div>-->
<li style="color: ${heatColor}">${heat}℃</li> <!-- <hr/>-->
</ul> <!-- <div class="meta">-->
</div> <!-- <ul class="breadcrumb">-->
</a> <!-- <li><@global.timeline datetime=post.createTime/></li>-->
<#if post.categories?? && post.categories?size gt 0> <!-- <li><i class="fa fa-eye"></i>${post.visits?c}</li>-->
<div class="category"> <!-- <#if !post.disallowComment!false><li><i class="fa fa-comments-o"></i>${post.commentCount?c}</li></#if>-->
<#list post.categories as category> <!-- <li><i class="fa fa-thumbs-o-up"></i>${post.likes?c}</li>-->
<a href="${category.fullPath!}">${category.name!}</a> <!-- <#local heat= (24+post.visits*0.1+post.likes*2+post.commentCount*3) />-->
</#list> <!-- <#local heatColor= '#'+(heat < 37)?string('ffa87e',(heat < 120)?string('fb734a','e0081c')) />-->
</div> <!-- <li style="color: ${heatColor}">${heat}℃</li>-->
</#if> <!-- </ul>-->
</div> <!-- <#if post.categories?? && post.categories?size gt 0>-->
<#elseif thumbnail != '' && (thumbnail_mode == "small" || (thumbnail_mode == "small-alter" && post_index%2 == 0))> <!-- <div class="level-item is-hidden-mobile">-->
<div class="card widget card-small"> <!-- <#list post.categories as category>-->
<a href="${post.fullPath!}"> <!-- <a href="${category.fullPath!}">${category.name!}</a>&nbsp;-->
<div class="small-image" style="background-image: url(${thumbnail!})"></div> <!-- </#list>-->
</a> <!-- </div>-->
<div class="card-content main"> <!-- </#if>-->
<h2 class="title"> <!--</div>-->
<#if post.topPriority==1><span class="top">置顶</span></#if><a <!--</div>-->
href="${post.fullPath!}">${post.title!}</a> <!--<a href="${post.fullPath!}"><div class="small-image" style="background-image: url(${thumbnail!})"></div></a>-->
</h2> <!--</div>-->
<div class="main-content">${post.summary!}</div> <!--<#elseif post.topPriority==1 && thumbnail_mode == "fold">-->
<hr/> <!--<a class="card widget card-fold" href="${post.fullPath!}">-->
<div class="meta"> <!-- <h2 class="title"><span class="top">置顶</span><p>${post.title!}</p></h2>-->
<ul class="breadcrumb"> <!-- <p><@global.timeline datetime=post.createTime/></p>-->
<li><@global.timeline datetime=post.createTime/></li> <!--</a>-->
<li><i class="fa fa-eye"></i>${post.visits?c}</li> <!--<#elseif thumbnail_mode == "grid">-->
<#if !post.disallowComment!false><li><i class="fa fa-comments-o"></i>${post.commentCount?c}</li></#if> <!--<div class="column-main-grid">-->
<li><i class="fa fa-thumbs-o-up"></i>${post.likes?c}</li> <!-- <#list post_index..(posts?size-1) as i>-->
<#local heat= (24+post.visits*0.1+post.likes*2+post.commentCount*3) /> <!-- <#local gradPost=posts[i]>-->
<#local heatColor= '#'+(heat < 37)?string('ffa87e',(heat < 120)?string('fb734a','e0081c')) /> <!-- <#local thumbnail = (gradPost.thumbnail?? && gradPost.thumbnail!='')?then(gradPost.thumbnail!, (settings.default_thumbnail?? && settings.default_thumbnail!='')?then(settings.default_thumbnail + settings.default_thumbnail?contains('?')?then("&","?") + "postId=" + gradPost.id?c, ''))>-->
<li style="color: ${heatColor}">${heat}℃</li> <!-- <#if is_first_index?? && thumbnail != '' && !(gradPost.topPriority!=1 || !gradPost.metas?? || (gradPost.metas.index_carousel!'false')=='false')>-->
</ul> <!-- <#continue>-->
<#if post.categories?? && post.categories?size gt 0> <!--</#if>-->
<div class="level-item is-hidden-mobile"> <!--<div class="card widget">-->
<#list post.categories as category> <!-- <a class="thumbnail" href="${gradPost.fullPath!}">-->
<a href="${category.fullPath!}">${category.name!}</a>&nbsp; <!-- <div class="thumbnail-image" style="background-image: url(${thumbnail!})">-->
</#list> <!-- </div>-->
</div> <!-- </a>-->
</#if> <!-- <ul class="breadcrumb">-->
</div> <!-- <li><@global.timeline datetime=gradPost.createTime/></li>-->
</div> <!-- <li><i class="fa fa-eye"></i>${gradPost.visits?c}</li>-->
</div> <!-- <#if !gradPost.disallowComment!false><li class="is-hidden-mobile"><i class="fa fa-comments-o"></i>${gradPost.commentCount?c}</li></#if>-->
<#elseif thumbnail != '' && (thumbnail_mode == "small-right" || (thumbnail_mode == "small-alter" && post_index%2 == 1))> <!-- <li class="is-hidden-mobile"><i class="fa fa-thumbs-o-up"></i>${gradPost.likes?c}</li>-->
<div class="card widget card-small"> <!-- <#local heat= (24+gradPost.visits*0.1+gradPost.likes*2+gradPost.commentCount*3) />-->
<div class="card-content main"> <!-- <#local heatColor= '#'+(heat < 37)?string('ffa87e',(heat < 120)?string('fb734a','e0081c')) />-->
<h2 class="title"> <!-- <li style="color: ${heatColor}">${heat}℃</li>-->
<#if post.topPriority==1><span class="top">置顶</span></#if><a <!-- </ul>-->
href="${post.fullPath!}">${post.title!}</a> <!-- <h2 class="title">-->
</h2> <!-- <#if gradPost.topPriority==1><span class="top">置顶</span></#if><a-->
<div class="main-content">${post.summary!}</div> <!-- href="${gradPost.fullPath!}">${gradPost.title!}</a>-->
<hr/> <!-- </h2>-->
<div class="meta"> <!--</div>-->
<ul class="breadcrumb"> <!--</#list>-->
<li><@global.timeline datetime=post.createTime/></li> <!--</div>-->
<li><i class="fa fa-eye"></i>${post.visits?c}</li> <!--<#break/>-->
<#if !post.disallowComment!false><li><i class="fa fa-comments-o"></i>${post.commentCount?c}</li></#if> <!--<#else>-->
<li><i class="fa fa-thumbs-o-up"></i>${post.likes?c}</li> <!--<div class="card widget">-->
<#local heat= (24+post.visits*0.1+post.likes*2+post.commentCount*3) /> <!-- <#if thumbnail?? && thumbnail!=''>-->
<#local heatColor= '#'+(heat < 37)?string('ffa87e',(heat < 120)?string('fb734a','e0081c')) /> <!-- <a class="thumbnail" href="${post.fullPath!}">-->
<li style="color: ${heatColor}">${heat}℃</li> <!-- <div class="thumbnail-image" style="background-image: url(${thumbnail!})">-->
</ul> <!-- </div>-->
<#if post.categories?? && post.categories?size gt 0> <!-- </a>-->
<div class="level-item is-hidden-mobile"> <!--</#if>-->
<#list post.categories as category> <!--<div class="card-content main">-->
<a href="${category.fullPath!}">${category.name!}</a>&nbsp; <!-- <h2 class="title">-->
</#list> <!-- <#if post.topPriority==1><span class="top">置顶</span></#if><a-->
</div> <!-- href="${post.fullPath!}">${post.title!}</a>-->
</#if> <!-- </h2>-->
</div> <!-- <div class="meta">-->
</div> <!-- <ul class="breadcrumb">-->
<a href="${post.fullPath!}"><div class="small-image" style="background-image: url(${thumbnail!})"></div></a> <!-- <li><@global.timeline datetime=post.createTime/></li>-->
</div> <!-- <li><i class="fa fa-eye"></i>${post.visits?c}</li>-->
<#elseif post.topPriority==1 && thumbnail_mode == "fold"> <!-- <#if !post.disallowComment!false><li class="is-hidden-mobile"><i class="fa fa-comments-o"></i>${post.commentCount?c}</li></#if>-->
<a class="card widget card-fold" href="${post.fullPath!}"> <!-- <li class="is-hidden-mobile"><i class="fa fa-thumbs-o-up"></i>${post.likes?c}</li>-->
<h2 class="title"><span class="top">置顶</span><p>${post.title!}</p></h2> <!-- <#local heat= (24+post.visits*0.1+post.likes*2+post.commentCount*3) />-->
<p><@global.timeline datetime=post.createTime/></p> <!-- <#local heatColor= '#'+(heat < 37)?string('ffa87e',(heat < 120)?string('fb734a','e0081c')) />-->
</a> <!-- <li style="color: ${heatColor}">${heat}℃</li>-->
<#elseif thumbnail_mode == "grid"> <!-- </ul>-->
<div class="column-main-grid"> <!-- <#if post.categories?? && post.categories?size gt 0>-->
<#list post_index..(posts?size-1) as i> <!-- <div class="level-item">-->
<#local gradPost=posts[i]> <!-- <#list post.categories as category>-->
<#local thumbnail = (gradPost.thumbnail?? && gradPost.thumbnail!='')?then(gradPost.thumbnail!, (settings.default_thumbnail?? && settings.default_thumbnail!='')?then(settings.default_thumbnail + settings.default_thumbnail?contains('?')?then("&","?") + "postId=" + gradPost.id?c, ''))> <!-- <a href="${category.fullPath!}">${category.name!}</a>&nbsp;-->
<#if is_first_index?? && thumbnail != '' && !(gradPost.topPriority!=1 || !gradPost.metas?? || (gradPost.metas.index_carousel!'false')=='false')> <!-- </#list>-->
<#continue> <!-- </div>-->
</#if> <!--</#if>-->
<div class="card widget"> <!--</div>-->
<a class="thumbnail" href="${gradPost.fullPath!}"> <!--<hr/>-->
<div class="thumbnail-image" style="background-image: url(${thumbnail!})"> <!--<div class="main-content">${post.summary!}</div>-->
</div> <!--</div>-->
</a> <!--</div>-->
<ul class="breadcrumb"> <!--</#if>-->
<li><@global.timeline datetime=gradPost.createTime/></li> <!--</#list>-->
<li><i class="fa fa-eye"></i>${gradPost.visits?c}</li> <!--</div>-->
<#if !gradPost.disallowComment!false><li class="is-hidden-mobile"><i class="fa fa-comments-o"></i>${gradPost.commentCount?c}</li></#if> <!--<#macro model_build content>-->
<li class="is-hidden-mobile"><i class="fa fa-thumbs-o-up"></i>${gradPost.likes?c}</li> <!-- <#if content == ''>-->
<#local heat= (24+gradPost.visits*0.1+gradPost.likes*2+gradPost.commentCount*3) /> <!-- <#return>-->
<#local heatColor= '#'+(heat < 37)?string('ffa87e',(heat < 120)?string('fb734a','e0081c')) /> <!-- </#if>-->
<li style="color: ${heatColor}">${heat}℃</li> <!-- <#local content_option=content?split('|')>-->
</ul> <!-- <#local tag=(content_option[0]!'')?trim>-->
<h2 class="title"> <!-- <#local content=((content_option[1]!'')?trim != '')?then('<div class="title">${content_option[1]?trim}</div>', '')>-->
<#if gradPost.topPriority==1><span class="top">置顶</span></#if><a <!-- <#local target=((content_option[2]!'false')?trim == 'true')?then('target="_blank"', '')>-->
href="${gradPost.fullPath!}">${gradPost.title!}</a> <!-- <#local imageUrl=((content_option[3]!'')?trim != '')?then('style="background-image: url(${content_option[3]?trim})"', '')>-->
</h2> <!-- <#local targetUrl=((content_option[4]!'')?trim != '')?then('href="${content_option[4]?trim}"', '')>-->
</div> <!-- <a class="card widget brightness ${(content!='')?then('bg-shadow', '')}" ${target} ${imageUrl} ${targetUrl}>${content}<div class="tag">${tag}</div></a>-->
</#list> <!--</#macro>-->
</div> <!--<#macro article_list posts>-->
<#break/> <!-- <#if is_first_index!false>-->
<#else> <!-- <#local carousel_content>-->
<div class="card widget"> <!-- <#list posts as post>-->
<#if thumbnail?? && thumbnail!=''> <!-- <#if post.topPriority!=1>-->
<a class="thumbnail" href="${post.fullPath!}"> <!-- <#break>-->
<div class="thumbnail-image" style="background-image: url(${thumbnail!})"> <!-- </#if>-->
</div> <!-- <#if !post.metas?? || (post.metas.index_carousel!'false')=='false'>-->
</a> <!-- <#continue>-->
</#if> <!-- </#if>-->
<div class="card-content main"> <!-- <#local thumbnail = (post.thumbnail?? && post.thumbnail!='')?then(post.thumbnail!, (settings.default_thumbnail?? && settings.default_thumbnail!='')?then(settings.default_thumbnail + settings.default_thumbnail?contains('?')?then("&","?") + "postId=" + post.id?c, ''))>-->
<h2 class="title"> <!-- <#if thumbnail != ''>-->
<#if post.topPriority==1><span class="top">置顶</span></#if><a <!-- <a class="swiper-slide bg-shadow cover-image" style="background-image: url(${thumbnail})" href="${post.fullPath!}">-->
href="${post.fullPath!}">${post.title!}</a> <!-- <div class="swiper-slide-details" data-swiper-parallax="200" data-swiper-parallax-duration="600">-->
</h2> <!-- <p class="swiper-slide-details-title">${post.title!}</p>-->
<div class="meta"> <!-- <ul class="breadcrumb">-->
<ul class="breadcrumb"> <!-- <li><@global.timeline datetime=post.createTime/></li>-->
<li><@global.timeline datetime=post.createTime/></li> <!-- <li><i class="fa fa-eye"></i>${post.visits?c}</li>-->
<li><i class="fa fa-eye"></i>${post.visits?c}</li> <!-- <#if !post.disallowComment!false>-->
<#if !post.disallowComment!false><li class="is-hidden-mobile"><i class="fa fa-comments-o"></i>${post.commentCount?c}</li></#if> <!-- <li><i class="fa fa-comments-o"></i>${post.commentCount?c}</li></#if>-->
<li class="is-hidden-mobile"><i class="fa fa-thumbs-o-up"></i>${post.likes?c}</li> <!-- <li><i class="fa fa-thumbs-o-up"></i>${post.likes?c}</li>-->
<#local heat= (24+post.visits*0.1+post.likes*2+post.commentCount*3) /> <!-- <#local heat= (24+post.visits*0.1+post.likes*2+post.commentCount*3) />-->
<#local heatColor= '#'+(heat < 37)?string('ffa87e',(heat < 120)?string('fb734a','e0081c')) /> <!-- <#local heatColor= '#'+(heat < 37)?string('ffa87e',(heat < 120)?string('fb734a','e0081c')) />-->
<li style="color: ${heatColor}">${heat}℃</li> <!-- <li style="color: ${heatColor}">${heat}℃</li>-->
</ul> <!-- </ul>-->
<#if post.categories?? && post.categories?size gt 0> <!-- </div>-->
<div class="level-item"> <!-- </a>-->
<#list post.categories as category> <!-- </#if>-->
<a href="${category.fullPath!}">${category.name!}</a>&nbsp; <!-- </#list>-->
</#list> <!-- </#local>-->
</div> <!-- <#if settings.sidebar_column=='module-left' || settings.sidebar_column=='module-right'>-->
</#if> <!-- <#if settings.module_links?? && settings.module_links?trim != ''>-->
</div> <!-- <#local module_links=settings.module_links?split('\n')>-->
<hr/> <!-- <#else>-->
<div class="main-content">${post.summary!}</div> <!-- <#local module_links=[]>-->
</div> <!-- <#list 0..1 as i>-->
</div> <!-- <#local post=posts[i]>-->
</#if> <!-- <#local module_links=module_links+["推荐|${post.title!}|false|${post.thumbnail!}|${post.fullPath!}"]>-->
</#list> <!-- </#list>-->
</#macro> <!-- </#if>-->
<!-- <div class="model model-index">-->
<!-- <div class="card widget swiper">-->
<!-- <div class="swiper-wrapper">${carousel_content}</div>-->
<!-- <div class="swiper-pagination"></div>-->
<!-- <div class="swiper-button-prev"></div>-->
<!-- <div class="swiper-button-next"></div>-->
<!-- </div>-->
<!-- <div class="model model-index-side">-->
<!-- <#list 0..1 as i>-->
<!-- <#if i &lt; module_links?size >-->
<!-- <@model_build module_links[i]/>-->
<!-- </#if>-->
<!-- </#list>-->
<!-- </div>-->
<!-- </div>-->
<!-- <#if module_links?size &gt; 2 && module_links?size&lt;=6>-->
<!-- <div class="model model-attach model-attach-${module_links?size-2}">-->
<!-- <#list 2..5 as i>-->
<!-- <#if i &lt; module_links?size >-->
<!-- <@model_build module_links[i]/>-->
<!-- </#if>-->
<!-- </#list>-->
<!-- </div>-->
<!-- </#if>-->
<!-- <#assign is_carousel=true />-->
<!-- <#elseif carousel_content != ''>-->
<!-- <div class="card widget swiper">-->
<!-- <div class="swiper-wrapper">${carousel_content}</div>-->
<!-- <div class="swiper-pagination"></div>-->
<!-- <div class="swiper-button-prev"></div>-->
<!-- <div class="swiper-button-next"></div>-->
<!-- </div>-->
<!-- <#assign is_carousel=true />-->
<!-- </#if>-->
<!-- <#if settings.index_inform?? && settings.index_inform != ''>-->
<!-- <div class="card tips brightness">${settings.index_inform}</div>-->
<!-- </#if>-->
<!-- </#if>-->
<!--</#macro>-->

View File

@ -1,6 +1,8 @@
<#assign ad_show=(settings.ad_mode!true)?then(settings.ad_image?? && settings.ad_image != '', settings.ad_custom_code?? && settings.ad_custom_code!='')> <#assign ad_show=(settings.ad_mode!true)?then(settings.ad_image?? && settings.ad_image != '', settings.ad_custom_code?? && settings.ad_custom_code!='')>
<#if ad_show> <#if ad_show>
<div class="card widget ${settings.hide_ad_piece!}"> <div xmlns:th="https://www.thymeleaf.org"
th:fragment="widget (hide)"
th:class="'card widget ' + ${hide}">
<#if settings.ad_mode!true> <#if settings.ad_mode!true>
<a target="_blank" href="${settings.ad_target_url!}"> <a target="_blank" href="${settings.ad_target_url!}">
<img width="100%" src="${settings.ad_image}" alt="广告"/> <img width="100%" src="${settings.ad_image}" alt="广告"/>

View File

@ -18,7 +18,9 @@
</#list> </#list>
</#macro> </#macro>
<#assign num= settings.categories_num!10 /> <#assign num= settings.categories_num!10 />
<div class="card widget ${settings.hide_categories!}"> <div xmlns:th="https://www.thymeleaf.org"
th:fragment="widget (hide)"
th:class="'card widget ' + ${hide}">
<#assign postCounts = {}> <#assign postCounts = {}>
<@categoryTag method="list"> <@categoryTag method="list">
<div class="card-title"> <div class="card-title">

View File

@ -1,5 +1,7 @@
<#assign num= settings.links_num!10 /> <#assign num= settings.links_num!10 />
<div class="card widget links ${settings.hide_links!}"> <div xmlns:th="https://www.thymeleaf.org"
th:fragment="widget (hide)"
th:class="'card widget links ' + ${hide}">
<@linkTag method="listByRandom"> <@linkTag method="listByRandom">
<div class="card-title"> <div class="card-title">
<i class="fa fa-link card-title-label"></i><span>友链</span> <i class="fa fa-link card-title-label"></i><span>友链</span>

View File

@ -1,4 +1,6 @@
<div class="card widget love brightness ${settings.hide_love!}" xmlns:th="https://www.thymeleaf.org"> <div xmlns:th="https://www.thymeleaf.org"
th:fragment="widget (hide)"
th:class="'card widget love brightness ' + ${hide}">
<div class="card-title"> <div class="card-title">
<i class="fa fa-heart card-title-label"></i><span>恋爱墙</span> <i class="fa fa-heart card-title-label"></i><span>恋爱墙</span>
</div> </div>
@ -13,8 +15,7 @@
</a> </a>
</div> </div>
<div class="level-item"> <div class="level-item">
<svg viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg" <svg viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg">
xmlns:xlink="http://www.w3.org/1999/xlink">
<path fill="#ffd1da" <path fill="#ffd1da"
d="m629.4,576.5l117.6,-196.5l0.2,-0.3c64.7,-108.5 29.4,-248.9 -79,-313.8s-248.9,-29.7 -313.9,78.6l-4.9,-2.9c-108.5,-65 -249.1,-29.6 -314.1,78.9c-65,108.5 -29.6,249.1 78.9,314.1l4.9,2.9l191.6,114.7l201.4,120.5l117.3,-196.2z"/> d="m629.4,576.5l117.6,-196.5l0.2,-0.3c64.7,-108.5 29.4,-248.9 -79,-313.8s-248.9,-29.7 -313.9,78.6l-4.9,-2.9c-108.5,-65 -249.1,-29.6 -314.1,78.9c-65,108.5 -29.6,249.1 78.9,314.1l4.9,2.9l191.6,114.7l201.4,120.5l117.3,-196.2z"/>
<path fill="#ffa2b2" <path fill="#ffa2b2"

View File

@ -1,6 +1,8 @@
<#if ((settings.music_mode!'playlist') == 'playlist' && settings.netease_playlist_id?? && settings.netease_playlist_id!='') <#if ((settings.music_mode!'playlist') == 'playlist' && settings.netease_playlist_id?? && settings.netease_playlist_id!='')
|| (settings.music_mode! == 'config' && settings.music_config?? && settings.music_config!='')> || (settings.music_mode! == 'config' && settings.music_config?? && settings.music_config!='')>
<div class="card widget music ${settings.hide_music!}"> <div xmlns:th="https://www.thymeleaf.org"
th:fragment="widget (hide)"
th:class="'card widget music ' + ${hide}">
<div class="card-title"> <div class="card-title">
<i class="fa fa-music card-title-label"></i><span>音乐</span> <i class="fa fa-music card-title-label"></i><span>音乐</span>
</div> </div>

View File

@ -1,4 +1,6 @@
<div class="card widget notice ${settings.hide_notice!} is-hidden-all" xmlns:th="https://www.thymeleaf.org"> <div xmlns:th="https://www.thymeleaf.org"
th:fragment="widget (hide)"
th:class="'card widget notice ' + ${hide} + ' is-hidden-all'">
<div class="card-title"> <div class="card-title">
<i class="fa fa-volume-up card-title-label"></i><span>公告</span> <i class="fa fa-volume-up card-title-label"></i><span>公告</span>
</div> </div>

View File

@ -1,4 +1,6 @@
<div class="card widget profile ${settings.hide_profile!}"> <div xmlns:th="https://www.thymeleaf.org"
th:fragment="widget (hide)"
th:class="'card widget profile ' + ${hide}">
<div class="card-content"> <div class="card-content">
<nav class="level"> <nav class="level">
<div class="level-item" style="flex-direction: column;"> <div class="level-item" style="flex-direction: column;">

View File

@ -1,4 +1,6 @@
<div class="card widget recent-comments ${settings.hide_recent_comments!}"> <div xmlns:th="https://www.thymeleaf.org"
th:fragment="widget (hide)"
th:class="'card widget recent-comments ' + ${hide}">
<div class="card-title"> <div class="card-title">
<i class="fa fa-commenting-o card-title-label"></i><span>最新评论</span> <i class="fa fa-commenting-o card-title-label"></i><span>最新评论</span>
</div> </div>

View File

@ -1,21 +1,17 @@
<div class="card widget recent-posts ${settings.hide_recent_posts!}"> <div xmlns:th="https://www.thymeleaf.org"
th:fragment="widget (hide)"
th:class="'card widget recent-posts ' + ${hide}"
th:with="num = ${#strings.isEmpty(theme.config.sidebar.recent_posts_num)? 5 : #numbers.sequence(theme.config.sidebar.recent_posts_num,theme.config.sidebar.recent_posts_num)[0]}, posts = ${postFinder.list(1,num)}, isEmpty = ${#lists.isEmpty(posts)}">
<div class="card-title"> <div class="card-title">
<i class="fa fa-history card-title-label"></i><span>最新文章</span> <i class="fa fa-history card-title-label"></i><span>最新文章</span>
</div> </div>
<@postTag method="latest" top="${settings.recent_posts_num!5}"> <div th:if="${isEmpty}" class="card-empty">暂无文章</div>
<#if posts?size gt 0> <div th:unless="${isEmpty}" class="card-content">
<div class="card-content">
<ul class="list"> <ul class="list">
<#list posts as post> <li class="item" th:each="post : ${posts}">
<li class="item"> <a class="link" th:href="@{${ps.status.permalink}}" th:title="${ps.spec.title}" th:text="${ps.spec.title}"></a>
<a class="link" href="${post.fullPath!}" title="${post.title!}">${post.title!}</a>
<i class="fa fa-link"></i> <i class="fa fa-link"></i>
</li> </li>
</#list>
</ul> </ul>
</div> </div>
<#else>
<div class="card-empty">暂无文章</div>
</#if>
</@postTag>
</div> </div>

View File

@ -1,24 +1,26 @@
<#assign num= settings.tagcloud_num!32 /> <#assign num= settings.tagcloud_num!32 />
<div class="card widget tagcloud ${settings.hide_tagcloud!}"> <div xmlns:th="https://www.thymeleaf.org"
<@tagTag method="list"> th:fragment="widget (hide)"
th:class="'card widget tagcloud ' + ${hide}"
th:with="num = ${#strings.isEmpty(theme.config.sidebar.tags_num)? 32 : #numbers.sequence(theme.config.sidebar.tags_num,theme.config.sidebar.tags_num)[0]}, tags = ${tagFinder.list(1,num)}, isEmpty = ${#lists.isEmpty(tags)}">
<div class="card-title"> <div class="card-title">
<i class="fa fa-cloud card-title-label"></i><span>标签云</span> <i class="fa fa-cloud card-title-label"></i><span>标签云</span>
<#if settings.tagcloud_more?? && settings.tagcloud_more== true && tags?size gt num?number> <a th:if="${tags.hasNext}" class="card-more" th:href="@{/tags}">更多<i class="fa fa-angle-double-right"></i></a>
<a class="card-more" href="${tags_url!}">更多<i class="fa fa-angle-double-right"></i></a>
</#if>
</div> </div>
<#if tags?? && tags?size gt 0> <div th:if="${isEmpty}" class="card-empty">暂无标签</div>
<div class="card-content"> <div th:unless="${isEmpty}" class="card-content">
<#assign size= (tags?size > num?number)?string(num, tags?size)?number - 1 /> <a
<#list 0..size as i> th:each="tag : ${tags}"
<#assign tag= tags[i] /> th:href="@{${tag.status.permalink}}"
<#assign size= tag.name?length + tag.slug?length + tag.postCount /> th:text="${tag.spec.displayName}"></a>
<a href="${tag.fullPath!}" <!-- <#if settings.enable_tags_color!false > style="color: ${tag.color}; border-color: ${tag.color}; background: ${tag.color!}20" </#if>-->
style="font-size:${(size < 14)?string('14',(size > 32)?string('32',size?string))}px;<#if settings.enable_tagcloud_color!false >color: ${tag.color}</#if>">${tag.name!}</a>
</#list>
</div> </div>
<#else> <!-- <#assign size= (tags?size > num?number)?string(num, tags?size)?number - 1 />-->
<div class="card-empty">暂无标签</div> <!-- <#list 0..size as i>-->
</#if> <!-- <#assign tag= tags[i] />-->
</@tagTag> <!-- <#assign size= tag.name?length + tag.slug?length + tag.postCount />-->
<!-- <a href="${tag.fullPath!}"-->
<!-- style="font-size:${(size < 14)?string('14',(size > 32)?string('32',size?string))}px;<#if settings.enable_tagcloud_color!false >color: ${tag.color}</#if>">${tag.name!}</a>-->
<!-- </#list>-->
</div> </div>

View File

@ -1,22 +1,17 @@
<#assign num= settings.tags_num!18 /> <div xmlns:th="https://www.thymeleaf.org"
<div class="card widget tags ${settings.hide_tags!}"> th:fragment="widget (hide)"
<@tagTag method="list"> th:class="'card widget tags ' + ${hide}"
th:with="num = ${#strings.isEmpty(theme.config.sidebar.tags_num)? 18 : #numbers.sequence(theme.config.sidebar.tags_num,theme.config.sidebar.tags_num)[0]}, tags = ${tagFinder.list(1,num)}, isEmpty = ${#lists.isEmpty(tags)}">
<div class="card-title"> <div class="card-title">
<i class="fa fa-tags card-title-label"></i><span>标签</span> <i class="fa fa-tags card-title-label"></i><span>标签</span>
<#if settings.tags_more?? && settings.tags_more== true && tags?size gt num?number> <a th:if="${tags.hasNext}" class="card-more" th:href="@{/tags}">更多<i class="fa fa-angle-double-right"></i></a>
<a class="card-more" href="${tags_url!}">更多<i class="fa fa-angle-double-right"></i></a>
</#if>
</div> </div>
<#if tags?? && tags?size gt 0> <div th:if="${isEmpty}" class="card-empty">暂无标签</div>
<div class="card-content"> <div th:unless="${isEmpty}" class="card-content">
<#assign size= (tags?size > num?number)?string(num, tags?size)?number - 1 /> <a
<#list 0..size as i> th:each="tag : ${tags}"
<#assign tag= tags[i] /> th:href="@{${tag.status.permalink}}"
<a href="${tag.fullPath!}"<#if settings.enable_tags_color!false > style="color: ${tag.color}; border-color: ${tag.color}; background: ${tag.color!}20" </#if>>${tag.name!}</a> th:text="${tag.spec.displayName}"></a>
</#list> <!-- <#if settings.enable_tags_color!false > style="color: ${tag.color}; border-color: ${tag.color}; background: ${tag.color!}20" </#if>-->
</div> </div>
<#else>
<div class="card-empty">暂无标签</div>
</#if>
</@tagTag>
</div> </div>

View File

@ -1,4 +1,6 @@
<div class="card widget toc ${settings.hide_toc!} is-hidden-all"> <div xmlns:th="https://www.thymeleaf.org"
th:fragment="widget (hide)"
th:class="'card widget toc ' + ${hide} + ' is-hidden-all'">
<div class="card-title"> <div class="card-title">
<i class="fa fa-file-text-o card-title-label"></i><span>目录</span> <i class="fa fa-file-text-o card-title-label"></i><span>目录</span>
</div> </div>