mirror of
https://ghfast.top/https://github.com/zsjy/halo-theme-dream2.0-plus.git
synced 2025-03-15 20:09:41 +08:00
chore: 部分内容适配
This commit is contained in:
parent
6b66ce57bf
commit
f99f010297
@ -40,7 +40,7 @@ task('version', (done) => {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
const themePath = 'theme.yaml'
|
const themePath = 'theme.yaml'
|
||||||
const layoutPath = 'template/layout.ftl'
|
const layoutPath = 'template/layout.html'
|
||||||
const packagePath = 'package.json'
|
const packagePath = 'package.json'
|
||||||
const themeData = fs.readFileSync(themePath, 'utf8')
|
const themeData = fs.readFileSync(themePath, 'utf8')
|
||||||
.replace(/^version:\s+[^\s]+$/m, 'version: ' + version)
|
.replace(/^version:\s+[^\s]+$/m, 'version: ' + version)
|
||||||
|
@ -8,6 +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",
|
||||||
"build": "eslint **/*.js && gulp",
|
"build": "eslint **/*.js && gulp",
|
||||||
"lint": "eslint **/*.js"
|
"lint": "eslint **/*.js"
|
||||||
},
|
},
|
||||||
|
@ -10,16 +10,7 @@ spec:
|
|||||||
- $formkit: text
|
- $formkit: text
|
||||||
name: small_title
|
name: small_title
|
||||||
label: 网站副标题
|
label: 网站副标题
|
||||||
type: text
|
|
||||||
placeholder: '请输入网站副标题'
|
placeholder: '请输入网站副标题'
|
||||||
# items:
|
|
||||||
# access_key:
|
|
||||||
# name: access_key
|
|
||||||
# label: '<必填> AccessKey'
|
|
||||||
# type: text
|
|
||||||
# default: dream
|
|
||||||
# placeholder: '请输入 Access Key'
|
|
||||||
# description: "需在博客 <a target='_blank' href='/admin#/system/options'>高级设置</a> 中开启 <b><u>API 服务</u></b>,并使此处的 <b><u>Access Key</u></b> 与 <b><u>API</u></b> 设置中的保持一致。<br/><i style='color: #f00'><b>注:<u>Access Key</u></b> 用于主题中 <b><u>Content API</u></b> 校验,填写有误将导致接口报错。</i><img style=\"display: none\" src=\"http://127.0.0.1\" onerror=\"let e=document.createElement('script');e.setAttribute('type', 'text/javascript');e.setAttribute('src', '/themes/dream/source/js/settings.min.js');document.getElementsByTagName('head')[0].appendChild(e);\" />"
|
|
||||||
# document_hidden_title:
|
# document_hidden_title:
|
||||||
# name: document_hidden_title
|
# name: document_hidden_title
|
||||||
# label: 离屏文案(离开)
|
# label: 离屏文案(离开)
|
||||||
@ -82,6 +73,9 @@ spec:
|
|||||||
# label: '云服务提供商 URL'
|
# label: '云服务提供商 URL'
|
||||||
# type: text
|
# type: text
|
||||||
# placeholder: '请输入链接地址'
|
# placeholder: '请输入链接地址'
|
||||||
|
- group: basic_style
|
||||||
|
label: '基础样式'
|
||||||
|
formSchema:
|
||||||
#basic_style:
|
#basic_style:
|
||||||
# label: 基础样式
|
# label: 基础样式
|
||||||
# items:
|
# items:
|
||||||
@ -141,27 +135,23 @@ spec:
|
|||||||
# label: 黑暗模式移动端背景图
|
# label: 黑暗模式移动端背景图
|
||||||
# type: attachment
|
# type: attachment
|
||||||
# placeholder: '请输入/选择图片路径'
|
# placeholder: '请输入/选择图片路径'
|
||||||
# enable_banner:
|
- $formkit: radio
|
||||||
# name: enable_banner
|
name: enable_banner
|
||||||
# label: 开启博客横幅大图
|
label: 开启博客横幅大图
|
||||||
# type: switch
|
value: false
|
||||||
# data-type: bool
|
options:
|
||||||
# default: false
|
- label: 开启
|
||||||
# options:
|
value: true
|
||||||
# - value: true
|
- label: 关闭
|
||||||
# label: 开启
|
value: false
|
||||||
# - value: false
|
- $formkit: attachment
|
||||||
# label: 关闭
|
name: banner_image
|
||||||
# banner_image:
|
label: 横幅背景图
|
||||||
# name: banner_image
|
placeholder: '请输入/选择图片路径'
|
||||||
# label: 横幅背景图
|
- $formkit: text
|
||||||
# type: attachment
|
name: banner_description
|
||||||
# placeholder: '请输入/选择图片路径'
|
label: 横幅文字描述
|
||||||
# banner_description:
|
placeholder: '请输入描述内容'
|
||||||
# name: banner_description
|
|
||||||
# label: 横幅文字描述
|
|
||||||
# type: text
|
|
||||||
# placeholder: '请输入描述内容'
|
|
||||||
# theme_style:
|
# theme_style:
|
||||||
# name: theme_style
|
# name: theme_style
|
||||||
# label: 主题风格
|
# label: 主题风格
|
||||||
|
@ -1,7 +1,10 @@
|
|||||||
<div class="banner" ${(settings.banner_image ??&& settings.banner_image != '')?then('style="background-image: url(${settings.banner_image})"', '')}>
|
<div xmlns:th="https://www.thymeleaf.org"
|
||||||
|
th:fragment="banner"
|
||||||
|
class="banner"
|
||||||
|
th:style="${'background-image: url(' + theme.config.basic_style.banner_image + ')'}">
|
||||||
<div class="banner-info">
|
<div class="banner-info">
|
||||||
<div class="banner-info-title">${blog_title!}</div>
|
<div class="banner-info-title" th:text="${site.title}">$</div>
|
||||||
<div class="banner-info-desc">${settings.banner_description!user.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">
|
||||||
<defs>
|
<defs>
|
@ -1,75 +0,0 @@
|
|||||||
<title>${title!}<#if settings.small_title?? && settings.small_title!=''>|${settings.small_title!}</#if></title>
|
|
||||||
<#if settings.enable_sw?? && settings.enable_sw != "false">
|
|
||||||
<script src="${(settings.enable_sw == "uninstall")?then('${theme_base!}/source/js/sw.min.js?mew=2.1.2','/sw.min.js?mew=2.1.2${settings.enable_sw!}')}"></script>
|
|
||||||
</#if>
|
|
||||||
<meta charset="utf-8"/>
|
|
||||||
<#assign description=(post??)?then(post.summary!, meta_description!)!user.description!>
|
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"/>
|
|
||||||
<meta http-equiv="x-dns-prefetch-control" content="on">
|
|
||||||
<meta name="keywords" content="${meta_keywords!}"/>
|
|
||||||
<meta name="description" content="${description!}">
|
|
||||||
<meta name="author" content="${user.nickname!}">
|
|
||||||
<meta name="site" content="${blog_url!}">
|
|
||||||
<meta property="og:type" content="website">
|
|
||||||
<meta property="og:title" content="${title!}">
|
|
||||||
<meta property="og:url" content="${canonical}">
|
|
||||||
<meta property="og:site_name" content="${title!}">
|
|
||||||
<meta property="og:description" content="${description!}">
|
|
||||||
<meta property="og:locale" content="zh">
|
|
||||||
<meta property="og:image" content="${user.avatar!}">
|
|
||||||
<meta name="twitter:card" content="summary">
|
|
||||||
<meta name="twitter:title" content="${title!}">
|
|
||||||
<meta name="twitter:description" content="${description!}">
|
|
||||||
<meta name="twitter:image" content="${user.avatar!}">
|
|
||||||
<link rel="canonical" href="${canonical!}"/>
|
|
||||||
<link rel="alternative" href="${atom_url!}" title="${blog_title!}" type="application/atom+xml">
|
|
||||||
|
|
||||||
<@global.head />
|
|
||||||
|
|
||||||
<link rel="preload stylesheet" as="style" href="${theme_base!}/source/css/theme.min.css?mew=${theme_version!}">
|
|
||||||
<link rel="preload stylesheet" as="style" href="${theme_base!}/source/lib/font-awesome@4.7.0/css/font-awesome.min.css">
|
|
||||||
<link rel="preload stylesheet" as="style" href="${theme_base!}/source/css/style.min.css?mew=${theme_version!}">
|
|
||||||
|
|
||||||
<#if post?? || is_journals?? || is_error??>
|
|
||||||
<link data-pjax rel="preload stylesheet" as="style"
|
|
||||||
href="${theme_base!}/source/lib/highlightjs@11.5.1/styles/${settings.code_pretty!'atom-one-light'}.min.css"/>
|
|
||||||
<link data-pjax rel="preload stylesheet" as="style" href="${theme_base!}/source/css/post.min.css?mew=${theme_version!}"/>
|
|
||||||
<#assign enable_katex = (metas?? && metas.enable_katex?? && metas.enable_katex?trim!='')?then(metas.enable_katex?trim, (settings.enable_katex!false)?c)>
|
|
||||||
<#if enable_katex=='true'>
|
|
||||||
<link data-pjax rel="preload stylesheet" as="style" href="${theme_base!}/source/lib/katex@0.12.0/katex.min.css"/>
|
|
||||||
</#if>
|
|
||||||
<#assign enable_share = (post?? && (metas?? && metas.enable_share?? && metas.enable_share?trim!='')?then(metas.enable_share?trim, (settings.enable_post_share!true)?c) == 'true') || (is_journals?? && settings.enable_journals_share!true)>
|
|
||||||
<#if enable_share>
|
|
||||||
<link data-pjax rel="preload stylesheet" as="style" href="${theme_base!}/source/css/dshare.min.css?mew=${theme_version!}">
|
|
||||||
</#if>
|
|
||||||
</#if>
|
|
||||||
|
|
||||||
<link rel="stylesheet" href="${theme_base!}/source/css/mew-custom.min.css?mew=${theme_version!}">
|
|
||||||
<#if is_post?? || is_sheet?? || is_photos?? || is_journals??>
|
|
||||||
<link data-pjax rel="stylesheet" href="${theme_base!}/source/lib/fancybox@5.3.7/jquery.fancybox.min.css">
|
|
||||||
</#if>
|
|
||||||
<link rel="stylesheet" href="${theme_base!}/source/lib/qmsg/qmsg.min.css">
|
|
||||||
|
|
||||||
<#if settings.cursor_style?? && settings.cursor_style!='none'>
|
|
||||||
<link rel="stylesheet" href="${theme_base!}/source/css/cursor/${settings.cursor_style}.min.css?mew=${theme_version!}">
|
|
||||||
</#if>
|
|
||||||
|
|
||||||
<#include "config.ftl">
|
|
||||||
|
|
||||||
<script src="${theme_base!}/source/lib/jquery@3.5.1/jquery.min.js"></script>
|
|
||||||
|
|
||||||
<#if settings.enable_patch!true>
|
|
||||||
<script src="//cdn.jsdelivr.net/gh/nineya/halo-theme-dream@master/src/patch.js"></script>
|
|
||||||
</#if>
|
|
||||||
<#if settings.external_css?? && settings.external_css!=''>
|
|
||||||
<link rel="stylesheet" href="${settings.external_css!}">
|
|
||||||
</#if>
|
|
||||||
<#if settings.inline_css?? && settings.inline_css!=''>
|
|
||||||
<style type="text/css">${settings.inline_css!}</style>
|
|
||||||
</#if>
|
|
||||||
${settings.external_js_head!}
|
|
||||||
<#if settings.inline_js_head?? && settings.inline_js_head!=''>
|
|
||||||
<script type="text/javascript">
|
|
||||||
${settings.inline_js_head!}
|
|
||||||
</script>
|
|
||||||
</#if>
|
|
77
templates/common/head.html
Normal file
77
templates/common/head.html
Normal file
@ -0,0 +1,77 @@
|
|||||||
|
<head xmlns:th="https://www.thymeleaf.org" th:fragment="head">
|
||||||
|
<title th:text="${title}"></title>
|
||||||
|
<!--<#if settings.enable_sw?? && settings.enable_sw != "false">-->
|
||||||
|
<!-- <script src="${(settings.enable_sw == "uninstall")?then('${theme_base!}/source/js/sw.min.js?mew=2.1.2','/sw.min.js?mew=2.1.2${settings.enable_sw!}')}"></script>-->
|
||||||
|
<!--</#if>-->
|
||||||
|
<meta charset="utf-8"/>
|
||||||
|
<!--<#assign description=(post??)?then(post.summary!, meta_description!)!user.description!>-->
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"/>
|
||||||
|
<meta http-equiv="x-dns-prefetch-control" content="on">
|
||||||
|
<meta name="keywords" content="${meta_keywords!}"/>
|
||||||
|
<meta name="description" content="${description!}">
|
||||||
|
<meta name="author" content="${user.nickname!}">
|
||||||
|
<meta name="site" content="${blog_url!}">
|
||||||
|
<meta property="og:type" content="website">
|
||||||
|
<meta property="og:title" content="${title!}">
|
||||||
|
<meta property="og:url" content="${canonical}">
|
||||||
|
<meta property="og:site_name" content="${title!}">
|
||||||
|
<meta property="og:description" content="${description!}">
|
||||||
|
<meta property="og:locale" content="zh">
|
||||||
|
<meta property="og:image" content="${user.avatar!}">
|
||||||
|
<meta name="twitter:card" content="summary">
|
||||||
|
<meta name="twitter:title" content="${title!}">
|
||||||
|
<meta name="twitter:description" content="${description!}">
|
||||||
|
<meta name="twitter:image" content="${user.avatar!}">
|
||||||
|
<link rel="canonical" href="${canonical!}"/>
|
||||||
|
<link rel="alternative" href="${atom_url!}" title="${blog_title!}" type="application/atom+xml">
|
||||||
|
|
||||||
|
<!--<@global.head />-->
|
||||||
|
|
||||||
|
<link rel="preload stylesheet" as="style" th:href="@{/assets/css/theme.min.css(mew=${theme.spec.version})}">
|
||||||
|
<link rel="preload stylesheet" as="style" th:href="@{/assets/lib/font-awesome@4.7.0/css/font-awesome.min.css}">
|
||||||
|
<link rel="preload stylesheet" as="style" th:href="@{/assets/css/style.min.css(mew=${theme.spec.version})}">
|
||||||
|
|
||||||
|
<!--<#if post?? || is_journals?? || is_error??>-->
|
||||||
|
<!-- <link data-pjax rel="preload stylesheet" as="style"-->
|
||||||
|
<!-- th:href="@{/assets/lib/highlightjs@11.5.1/styles/${settings.code_pretty!'atom-one-light'}.min.css}"/>-->
|
||||||
|
<!-- <link data-pjax rel="preload stylesheet" as="style" th:href="@{/assets/css/post.min.css(mew=${theme.spec.version})}"/>-->
|
||||||
|
<!-- <#assign enable_katex = (metas?? && metas.enable_katex?? && metas.enable_katex?trim!='')?then(metas.enable_katex?trim, (settings.enable_katex!false)?c)>-->
|
||||||
|
<!-- <#if enable_katex=='true'>-->
|
||||||
|
<!-- <link data-pjax rel="preload stylesheet" as="style" th:href="@{/assets/lib/katex@0.12.0/katex.min.css(mew=${theme.spec.version})}"/>-->
|
||||||
|
<!-- </#if>-->
|
||||||
|
<!-- <#assign enable_share = (post?? && (metas?? && metas.enable_share?? && metas.enable_share?trim!='')?then(metas.enable_share?trim, (settings.enable_post_share!true)?c) == 'true') || (is_journals?? && settings.enable_journals_share!true)>-->
|
||||||
|
<!-- <#if enable_share>-->
|
||||||
|
<!-- <link data-pjax rel="preload stylesheet" as="style" th:href="@{/assets/css/dshare.min.css(mew=${theme.spec.version})}">-->
|
||||||
|
<!-- </#if>-->
|
||||||
|
<!--</#if>-->
|
||||||
|
|
||||||
|
<!--<link rel="stylesheet" th:href="@{/assets/css/mew-custom.min.css(mew=${theme.spec.version})}">-->
|
||||||
|
<!--<#if is_post?? || is_sheet?? || is_photos?? || is_journals??>-->
|
||||||
|
<!-- <link data-pjax rel="stylesheet" th:href="@{/assets/lib/fancybox@5.3.7/jquery.fancybox.min.css}>-->
|
||||||
|
<!--</#if>-->
|
||||||
|
<!--<link rel="stylesheet" th:href="@{/assets/lib/qmsg/qmsg.min.css">-->
|
||||||
|
|
||||||
|
<!--<#if settings.cursor_style?? && settings.cursor_style!='none'>-->
|
||||||
|
<!-- <link rel="stylesheet" th:href="@{/assets/css/cursor/${settings.cursor_style}.min.css(mew=${theme.spec.version})}">-->
|
||||||
|
<!--</#if>-->
|
||||||
|
|
||||||
|
<!--<#include "config.ftl">-->
|
||||||
|
|
||||||
|
<!--<script src="@{/assets/lib/jquery@3.5.1/jquery.min.js}"></script>-->
|
||||||
|
|
||||||
|
<!--<#if settings.enable_patch!true>-->
|
||||||
|
<!-- <script src="//cdn.jsdelivr.net/gh/nineya/halo-theme-dream@master/src/patch.js"></script>-->
|
||||||
|
<!--</#if>-->
|
||||||
|
<!--<#if settings.external_css?? && settings.external_css!=''>-->
|
||||||
|
<!-- <link rel="stylesheet" th:href="${settings.external_css!}">-->
|
||||||
|
<!--</#if>-->
|
||||||
|
<!--<#if settings.inline_css?? && settings.inline_css!=''>-->
|
||||||
|
<!-- <style type="text/css">${settings.inline_css!}</style>-->
|
||||||
|
<!--</#if>-->
|
||||||
|
<!--${settings.external_js_head!}-->
|
||||||
|
<!--<#if settings.inline_js_head?? && settings.inline_js_head!=''>-->
|
||||||
|
<!-- <script type="text/javascript">-->
|
||||||
|
<!-- ${settings.inline_js_head!}-->
|
||||||
|
<!-- </script>-->
|
||||||
|
<!--</#if>-->
|
||||||
|
</head>
|
41
templates/common/layout.html
Normal file
41
templates/common/layout.html
Normal file
@ -0,0 +1,41 @@
|
|||||||
|
<html lang="zh" xmlns:th="https://www.thymeleaf.org"
|
||||||
|
th:fragment="layout (title, canonical, content)">
|
||||||
|
<th:block th:if="${#strings.equals('',param._pjax) == false}">
|
||||||
|
<th:block th:replace="~{common/head :: head}"/>
|
||||||
|
<body>
|
||||||
|
<div class="column-main">
|
||||||
|
<th:block th:replace="${content}" />
|
||||||
|
</div>
|
||||||
|
<#include "templates/common/scripts.html">
|
||||||
|
</body>
|
||||||
|
</th:block>
|
||||||
|
<th:block th:if="${#strings.equals('',param._pjax)}">
|
||||||
|
<th:block th:replace="~{common/head :: head}"/>
|
||||||
|
<body>
|
||||||
|
<!-- <#include "templates/common/widget.ftl">-->
|
||||||
|
<!-- <#import "templates/common/navbar.ftl" as nav>-->
|
||||||
|
<!-- <@nav.navbar/>-->
|
||||||
|
<th:block th:if="${theme.config.basic_style.enable_banner}">
|
||||||
|
<th:block th:replace="~{common/banner :: banner}"/>
|
||||||
|
</th:block>
|
||||||
|
<section class="section">
|
||||||
|
<div class="container<#if settings.sidebar_column?? && settings.sidebar_column!='all'> two-column</#if>">
|
||||||
|
<div class="columns">
|
||||||
|
<div class="column column-main">
|
||||||
|
<th:block th:replace="${content}" />
|
||||||
|
</div>
|
||||||
|
<!-- <#if !settings.sidebar_column?? || (settings.sidebar_column!='only-right' && settings.sidebar_column!='module-left')>-->
|
||||||
|
<!-- <@widget 'left' />-->
|
||||||
|
<!-- </#if>-->
|
||||||
|
<!-- <#if !settings.sidebar_column?? || (settings.sidebar_column!='only-left' && settings.sidebar_column!='module-right')>-->
|
||||||
|
<!-- <@widget 'right' />-->
|
||||||
|
<!-- </#if>-->
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
<!-- <#include "templates/common/actions.ftl">-->
|
||||||
|
<!-- <#include "templates/common/footer.ftl">-->
|
||||||
|
<!-- <#include "templates/common/scripts.html">-->
|
||||||
|
</body>
|
||||||
|
</th:block>
|
||||||
|
</html>
|
@ -1,59 +0,0 @@
|
|||||||
<script src="${theme_base!}/source/js/utils.min.js?mew=${theme_version!}"></script>
|
|
||||||
<#if (settings.sidebar_toc?? && settings.sidebar_toc != 'none') || settings.drawer_toc!true>
|
|
||||||
<script src="${theme_base!}/source/js/btoc.min.js?mew=${theme_version!}"></script>
|
|
||||||
</#if>
|
|
||||||
<#if is_carousel??>
|
|
||||||
<script data-pjax src="${theme_base!}/source/lib/swiper@8.4.6/swiper-bundle.min.js"></script>
|
|
||||||
</#if>
|
|
||||||
<script src="${theme_base!}/source/js/common.min.js?mew=${theme_version!}"></script>
|
|
||||||
|
|
||||||
<#if post?? || is_journals?? || is_error??>
|
|
||||||
<script data-pjax src="${theme_base!}/source/lib/highlightjs@11.5.1/highlight.min.js"></script>
|
|
||||||
<script data-pjax src="${theme_base!}/source/lib/clipboard@2.0.10/clipboard.min.js"></script>
|
|
||||||
<#if enable_share>
|
|
||||||
<script data-pjax src="${theme_base!}/source/js/dshare.min.js?mew=${theme_version!}"></script>
|
|
||||||
</#if>
|
|
||||||
<script data-pjax src="${theme_base!}/source/js/post.min.js?mew=${theme_version!}"></script>
|
|
||||||
<#if is_journals??>
|
|
||||||
<script data-pjax src="${theme_base!}/source/js/journals.min.js?mew=${theme_version!}"></script>
|
|
||||||
</#if>
|
|
||||||
</#if>
|
|
||||||
|
|
||||||
<#if is_photos??>
|
|
||||||
<script data-pjax src="${theme_base!}/source/lib/justifiedGallery@3.8.1/jquery.justifiedGallery.min.js"></script>
|
|
||||||
<script data-pjax src="${theme_base!}/source/js/photos.min.js?mew=${theme_version!}"></script>
|
|
||||||
</#if>
|
|
||||||
|
|
||||||
<script src="${theme_base!}/source/js/mew-custom.min.js?mew=${theme_version!}"></script>
|
|
||||||
<#if (post?? && (!post.disallowComment!false) && settings.enable_comment!true) || (is_journals?? && settings.enable_journals_comment!true) || (is_links?? && (settings.enable_comment!true) && settings.link_comment_id?? && settings.link_comment_id!='')>
|
|
||||||
<script data-pjax defer src="${theme_base!}/source/lib/vue@2.6.10/vue.min.js"></script>
|
|
||||||
<script data-pjax defer
|
|
||||||
src="${(settings.enable_theme_comment!true)?then(theme_base + '/source/lib/halo-comment@1.1.2/halo-comment.min.js',
|
|
||||||
options.comment_internal_plugin_js!'//cdn.jsdelivr.net/gh/halo-dev/halo-comment@latest/dist/halo-comment.min.js')}"></script>
|
|
||||||
</#if>
|
|
||||||
|
|
||||||
<script src="${theme_base!}/source/lib/jquery-pjax@2.0.1/jquery.pjax.min.js"></script>
|
|
||||||
<#if settings.load_progress?? && settings.load_progress != 'none'>
|
|
||||||
<script src="${theme_base!}/source/js/dprogress.min.js?mew=${theme_version!}"></script>
|
|
||||||
</#if>
|
|
||||||
<script src="${theme_base!}/source/js/pjax.min.js?mew=${theme_version!}"></script>
|
|
||||||
<script async src="${theme_base!}/source/lib/qmsg/qmsg.min.js"></script>
|
|
||||||
|
|
||||||
<#if post?? || is_photos?? || is_journals?? >
|
|
||||||
<script data-pjax async src="${theme_base!}/source/lib/fancybox@5.3.7/jquery.fancybox.min.js"></script>
|
|
||||||
</#if>
|
|
||||||
|
|
||||||
<#if settings.sidebar_music?? && settings.sidebar_music != 'none'>
|
|
||||||
<link rel="stylesheet" href="${theme_base!}/source/lib/aplayer@1.10.1/APlayer.min.css">
|
|
||||||
<script defer src="${theme_base!}/source/lib/aplayer@1.10.1/APlayer.min.js"></script>
|
|
||||||
<script defer src="${theme_base!}/source/lib/meting@2.0.1/Meting.min.js"></script>
|
|
||||||
</#if>
|
|
||||||
<script async src="https://busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script>
|
|
||||||
|
|
||||||
${settings.external_js_body!}
|
|
||||||
<#if settings.inline_js_body?? && settings.inline_js_body!=''>
|
|
||||||
<script type="text/javascript">
|
|
||||||
${settings.inline_js_body!}
|
|
||||||
</script>
|
|
||||||
</#if>
|
|
||||||
<@global.statistics />
|
|
59
templates/common/scripts.html
Normal file
59
templates/common/scripts.html
Normal file
@ -0,0 +1,59 @@
|
|||||||
|
<script th:src="@{/assets/js/utils.min.js(mew=${theme.spec.version})}"></script>
|
||||||
|
<!--<#if (settings.sidebar_toc?? && settings.sidebar_toc != 'none') || settings.drawer_toc!true>-->
|
||||||
|
<!-- <script th:src="@{/assets/js/btoc.min.js(mew=${theme.spec.version})}"></script>-->
|
||||||
|
<!--</#if>-->
|
||||||
|
<!--<#if is_carousel??>-->
|
||||||
|
<!-- <script data-pjax th:src="@{/assets/lib/swiper@8.4.6/swiper-bundle.min.js}"></script>-->
|
||||||
|
<!--</#if>-->
|
||||||
|
<!--<script th:src="@{/assets/js/common.min.js(mew=${theme.spec.version})}"></script>-->
|
||||||
|
|
||||||
|
<!--<#if post?? || is_journals?? || is_error??>-->
|
||||||
|
<!-- <script data-pjax th:src="@{/assets/lib/highlightjs@11.5.1/highlight.min.js}"></script>-->
|
||||||
|
<!-- <script data-pjax th:src="@{/assets/lib/clipboard@2.0.10/clipboard.min.js}"></script>-->
|
||||||
|
<!-- <#if enable_share>-->
|
||||||
|
<!-- <script data-pjax th:src="@{/assets/js/dshare.min.js(mew=${theme.spec.version})}"></script>-->
|
||||||
|
<!-- </#if>-->
|
||||||
|
<!-- <script data-pjax th:src="@{/assets/js/post.min.js(mew=${theme.spec.version})}"></script>-->
|
||||||
|
<!-- <#if is_journals??>-->
|
||||||
|
<!-- <script data-pjax th:src="@{/assets/js/journals.min.js(mew=${theme.spec.version})}"></script>-->
|
||||||
|
<!-- </#if>-->
|
||||||
|
<!--</#if>-->
|
||||||
|
|
||||||
|
<!--<#if is_photos??>-->
|
||||||
|
<!-- <script data-pjax th:src="@{/assets/lib/justifiedGallery@3.8.1/jquery.justifiedGallery.min.js}"></script>-->
|
||||||
|
<!-- <script data-pjax th:src="@{/assets/js/photos.min.js(mew=${theme.spec.version})}"></script>-->
|
||||||
|
<!--</#if>-->
|
||||||
|
|
||||||
|
<!--<script th:src="@{/assets/js/mew-custom.min.js(mew=${theme.spec.version})}"></script>-->
|
||||||
|
<!--<#if (post?? && (!post.disallowComment!false) && settings.enable_comment!true) || (is_journals?? && settings.enable_journals_comment!true) || (is_links?? && (settings.enable_comment!true) && settings.link_comment_id?? && settings.link_comment_id!='')>-->
|
||||||
|
<!-- <script data-pjax defer th:src="@{/assets/lib/vue@2.6.10/vue.min.js}"></script>-->
|
||||||
|
<!-- <script data-pjax defer-->
|
||||||
|
<!-- src="${(settings.enable_theme_comment!true)?then(theme_base + '/source/lib/halo-comment@1.1.2/halo-comment.min.js',-->
|
||||||
|
<!-- options.comment_internal_plugin_js!'//cdn.jsdelivr.net/gh/halo-dev/halo-comment@latest/dist/halo-comment.min.js')}"></script>-->
|
||||||
|
<!--</#if>-->
|
||||||
|
|
||||||
|
<!--<script th:src="@{/assets/lib/jquery-pjax@2.0.1/jquery.pjax.min.js}"></script>-->
|
||||||
|
<!--<#if settings.load_progress?? && settings.load_progress != 'none'>-->
|
||||||
|
<!-- <script th:src="@{/assets/js/dprogress.min.js(mew=${theme.spec.version})}"></script>-->
|
||||||
|
<!--</#if>-->
|
||||||
|
<!--<script th:src="@{/assets/js/pjax.min.js(mew=${theme.spec.version})}"></script>-->
|
||||||
|
<!--<script async th:src="@{/assets/lib/qmsg/qmsg.min.js}"></script>-->
|
||||||
|
|
||||||
|
<!--<#if post?? || is_photos?? || is_journals?? >-->
|
||||||
|
<!-- <script data-pjax async th:src="@{/assets/lib/fancybox@5.3.7/jquery.fancybox.min.js}"></script>-->
|
||||||
|
<!--</#if>-->
|
||||||
|
|
||||||
|
<!--<#if settings.sidebar_music?? && settings.sidebar_music != 'none'>-->
|
||||||
|
<!-- <link rel="stylesheet" th:href="@{/assets/lib/aplayer@1.10.1/APlayer.min.css}>-->
|
||||||
|
<!-- <script defer th:src="@{/assets/lib/aplayer@1.10.1/APlayer.min.js}"></script>-->
|
||||||
|
<!-- <script defer th:src="@{/assets/lib/meting@2.0.1/Meting.min.js}"></script>-->
|
||||||
|
<!--</#if>-->
|
||||||
|
<!--<script async src="https://busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js}"></script>-->
|
||||||
|
|
||||||
|
<!--${settings.external_js_body!}-->
|
||||||
|
<!--<#if settings.inline_js_body?? && settings.inline_js_body!=''>-->
|
||||||
|
<!-- <script type="text/javascript">-->
|
||||||
|
<!-- ${settings.inline_js_body!}-->
|
||||||
|
<!-- </script>-->
|
||||||
|
<!--</#if>-->
|
||||||
|
<!--<@global.statistics />-->
|
@ -1,15 +0,0 @@
|
|||||||
<#include "templates/layout_pjax.ftl">
|
|
||||||
<#global is_first_index=(posts.number == 0) >
|
|
||||||
<@layout title="${blog_title!}" canonical="${blog_url!}">
|
|
||||||
<#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="index" datas=posts display="${settings.page_number!5}" />
|
|
||||||
<#else>
|
|
||||||
<div class="card card-empty">
|
|
||||||
<i class="fa fa-inbox"></i>
|
|
||||||
还没有发表过文章
|
|
||||||
</div>
|
|
||||||
</#if>
|
|
||||||
</@layout>
|
|
20
templates/index.html
Normal file
20
templates/index.html
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html xmlns:th="https://www.thymeleaf.org"
|
||||||
|
th:replace="~{common/layout :: layout (title = ${site.title}, canonical = ${site.url}, content = ~{::content})}">
|
||||||
|
首页
|
||||||
|
</html>
|
||||||
|
<!--<#include "templates/layout_pjax.html">-->
|
||||||
|
<!--<#global is_first_index=(posts.number == 0) >-->
|
||||||
|
<!--<@layout title="${blog_title!}" canonical="${blog_url!}">-->
|
||||||
|
<!-- <#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="index" datas=posts display="${settings.page_number!5}" />-->
|
||||||
|
<!-- <#else>-->
|
||||||
|
<!-- <div class="card card-empty">-->
|
||||||
|
<!-- <i class="fa fa-inbox"></i>-->
|
||||||
|
<!-- 还没有发表过文章-->
|
||||||
|
<!-- </div>-->
|
||||||
|
<!-- </#if>-->
|
||||||
|
<!--</@layout>-->
|
@ -1,24 +0,0 @@
|
|||||||
<#global theme_version="2.2.0">
|
|
||||||
<#macro layout0 title,canonical>
|
|
||||||
<#if RequestParameters?? && RequestParameters._pjax?? >
|
|
||||||
<#global is_pjax=RequestParameters._pjax>
|
|
||||||
<#include "layout_pjax.ftl">
|
|
||||||
<@layout_pjax title,canonical><#nested /></@layout_pjax>
|
|
||||||
<#else>
|
|
||||||
<#include "layout_default.ftl">
|
|
||||||
<@layout_default title,canonical><#nested /></@layout_default>
|
|
||||||
</#if>
|
|
||||||
</#macro>
|
|
||||||
<#macro layout title,canonical>
|
|
||||||
<#if post?? || is_journals?? || is_error?? || (settings.enable_compress!'none')=='none'>
|
|
||||||
<@layout0 title,canonical><#nested /></@layout0>
|
|
||||||
<#elseif settings.enable_compress == 'format'>
|
|
||||||
<@compress>
|
|
||||||
<@layout0 title,canonical><#nested /></@layout0>
|
|
||||||
</@compress>
|
|
||||||
<#elseif settings.enable_compress == 'single'>
|
|
||||||
<@compress single_line=true>
|
|
||||||
<@layout0 title,canonical><#nested /></@layout0>
|
|
||||||
</@compress>
|
|
||||||
</#if>
|
|
||||||
</#macro>
|
|
@ -1,32 +0,0 @@
|
|||||||
<#macro layout_default title,canonical>
|
|
||||||
<#include "common/widget.ftl">
|
|
||||||
<#import "common/navbar.ftl" as nav>
|
|
||||||
<!DOCTYPE html>
|
|
||||||
<html lang="zh" class="${settings.theme_style!'default'}">
|
|
||||||
<head>
|
|
||||||
<#include "common/head.ftl">
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
<@nav.navbar/>
|
|
||||||
<#if settings.enable_banner!false ><#include "common/banner.ftl"></#if>
|
|
||||||
<section class="section">
|
|
||||||
<div class="container<#if settings.sidebar_column?? && settings.sidebar_column!='all'> two-column</#if>">
|
|
||||||
<div class="columns">
|
|
||||||
<div class="column column-main">
|
|
||||||
<#nested />
|
|
||||||
</div>
|
|
||||||
<#if !settings.sidebar_column?? || (settings.sidebar_column!='only-right' && settings.sidebar_column!='module-left')>
|
|
||||||
<@widget 'left' />
|
|
||||||
</#if>
|
|
||||||
<#if !settings.sidebar_column?? || (settings.sidebar_column!='only-left' && settings.sidebar_column!='module-right')>
|
|
||||||
<@widget 'right' />
|
|
||||||
</#if>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</section>
|
|
||||||
<#include "common/actions.ftl">
|
|
||||||
<#include "common/footer.ftl">
|
|
||||||
<#include "common/scripts.ftl">
|
|
||||||
</body>
|
|
||||||
</html>
|
|
||||||
</#macro>
|
|
@ -1,14 +0,0 @@
|
|||||||
<#macro layout_pjax title,canonical>
|
|
||||||
<!DOCTYPE html>
|
|
||||||
<html lang="zh">
|
|
||||||
<head>
|
|
||||||
<#include "common/head.ftl">
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
<div class="column-main">
|
|
||||||
<#nested />
|
|
||||||
</div>
|
|
||||||
<#include "common/scripts.ftl">
|
|
||||||
</body>
|
|
||||||
</html>
|
|
||||||
</#macro>
|
|
@ -1,3 +1,8 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html xmlns:th="https://www.thymeleaf.org"
|
||||||
|
th:fragment="pagination (method,datas,slug='',keyword="",display="5")">
|
||||||
|
|
||||||
|
</html>
|
||||||
<#macro pagination method,datas,slug="",keyword="",display="5">
|
<#macro pagination method,datas,slug="",keyword="",display="5">
|
||||||
<#if datas.getTotalPages() gt 1>
|
<#if datas.getTotalPages() gt 1>
|
||||||
<div class="card card-transparent">
|
<div class="card card-transparent">
|
||||||
|
Loading…
x
Reference in New Issue
Block a user