Skip to content

Commit

Permalink
Merge pull request #25 from lsh1358046425/feat/deal_jsdelivr
Browse files Browse the repository at this point in the history
feat:删除jsdelivr和做了一些优化
  • Loading branch information
cetr authored Mar 3, 2022
2 parents e89052e + db91451 commit ff30e29
Show file tree
Hide file tree
Showing 57 changed files with 2,017 additions and 108 deletions.
2 changes: 1 addition & 1 deletion index.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
<div class="post-meta">
<span class="post-time" style="color: #00a7e0">
<span class="post-meta-item-icon"><i
class="fa fa-calendar-o"></i></span>
class="fa fa-calendar"></i></span>
<span class="post-meta-item-text">发表于</span>
<time title="Post created" itemprop="dateCreated datePublished"
datetime="${post.createTime}">
Expand Down
2 changes: 1 addition & 1 deletion layout/about_me.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

<#if settings.sidebar_nickname_isopen!false>
<p class="site-author-name" itemprop="name">
<span style="opacity:.2;">${settings.sidebar_nickname_prefix!}</span>
<span style="opacity:.3;">${settings.sidebar_nickname_prefix!}</span>
${settings.sidebar_nickname!'${user.nickname}'}
</p>
</#if>
Expand Down
15 changes: 0 additions & 15 deletions layout/cdn_css.ftl

This file was deleted.

21 changes: 0 additions & 21 deletions layout/cdn_js.ftl

This file was deleted.

15 changes: 15 additions & 0 deletions layout/css.ftl
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<link href="${theme_base!}/source/lib/tocbot/tocbot.css?v=${theme.version!}" rel="stylesheet" type="text/css">
<link href="${theme_base!}/source/lib/font-awesome/css/all.min.css?v=${theme.version!}" rel="stylesheet"
type="text/css">
<link href="${theme_base!}/source/lib/nprogress/nprogress.css?v=${theme.version!}" rel="stylesheet" type="text/css"/>
<link href="${theme_base!}/source/lib/social-share/css/share.min.css?v=${theme.version!}" rel="stylesheet"
type="text/css">
<link href="${theme_base!}/source/lib/zoomify/zoomify.min.css?v=${theme.version!}" rel="stylesheet" type="text/css">
<link href="${theme_base!}/source/lib/fancybox/jquery.fancybox.min.css?v=${theme.version!}" rel="stylesheet"
type="text/css" media="screen">
<link href="${theme_base!}/source/css/main.css?v=${theme.version!}" rel="stylesheet" type="text/css">
<link href="${theme_base!}/source/css/night.css?v=${theme.version!}" rel="stylesheet" type="text/css">
<link href="${theme_base!}/source/css/codeblock.css?v=${theme.version!}" rel="stylesheet" type="text/css">
<#if settings.music_enabled!false>
<link href="${theme_base!}/source/lib/aplayer/APlayer.min.css?v=${theme.version!}" rel="stylesheet">
</#if>
17 changes: 5 additions & 12 deletions layout/head.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -25,28 +25,21 @@

<@global.head />

<link rel="dns-prefetch" href="//cdn.jsdelivr.net">
<link rel="alternate" title="RSS" type="application/rss+xml" href="${rss_url!}">
<link rel="alternate" title="ATOM" type="application/atom+xml" href="${atom_url!}">
<link rel="apple-touch-icon" sizes="180x180" href="/favicon.ico">
<link rel="icon" type="image/png" sizes="32x32" href="/favicon.ico">

<#include "cdn_css.ftl">

<link href="${theme_base!}/source/css/main.css?v=${theme.version!}" rel="stylesheet" type="text/css">
<link href="${theme_base!}/source/css/night.css?v=${theme.version!}" rel="stylesheet" type="text/css">
<link href="${theme_base!}/source/css/codeblock.css?v=${theme.version!}" rel="stylesheet" type="text/css">
<#include "css.ftl">

<#if settings.custom??>
<style type="text/css">
<style>
${settings.custom!}
</style>
</#if>

<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/jquery.min.js?v=${theme.version!}"
type="text/javascript"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/vue.min.js?v=${theme.version!}"
type="text/javascript"></script>
<script src="${theme_base!}/source/lib/jquery/jquery.min.js?v=${theme.version!}" type="text/javascript"></script>
<script src="${theme_base!}/source/lib/vue/vue.min.js?v=${theme.version!}" type="text/javascript"></script>
</head>
<body itemscope itemtype="http://schema.org/WebPage">
<body>
</#macro>
34 changes: 34 additions & 0 deletions layout/js.ftl
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<script src="${theme_base!}/source/lib/bootstrap/bootstrap.min.js?v=${theme.version!}" type="text/javascript"></script>
<script src="${theme_base!}/source/lib/nprogress/nprogress.js?v=${theme.version!}" type="text/javascript"></script>
<script src="${theme_base!}/source/lib/velocity/velocity.min.js?v=${theme.version!}" type="text/javascript"></script>
<script src="${theme_base!}/source/lib/tocbot/tocbot.min.js?v=${theme.version!}" type="text/javascript"></script>
<script src="${theme_base!}/source/lib/greensock/TweenMax.min.js?v=${theme.version!}" type="text/javascript"></script>
<script src="${theme_base!}/source/lib/jquery-lazyload/jquery.lazyload.min.js?v=${theme.version!}"
type="text/javascript"></script>
<script src="${theme_base!}/source/lib/social-share/js/jquery.share.min.js?v=${theme.version!}"
type="text/javascript"></script>
<script src="${theme_base!}/source/lib/zoomify/zoomify.min.js?v=${theme.version!}" type="text/javascript"></script>
<script data-pjax src="${theme_base!}/source/lib/prism/prism.js?v=${theme.version!}" type="text/javascript"></script>
<script src="${theme_base!}/source/lib/fancybox/jquery.fancybox.min.js?v=${theme.version!}"
type="text/javascript"></script>
<script src="${theme_base!}/source/js/main.js?v=${theme.version!}" type="text/javascript"></script>
<script src="${theme_base!}/source/js/animate.js?v=${theme.version!}" type="text/javascript"></script>
<#if settings.comment_internal_plugin_js_enable!false>
<script src="${options.comment_internal_plugin_js!'https://unpkg.com/halo-comment-yu@latest/dist/halo-comment.min.js'}?v=${theme.version!}"
type="text/javascript"></script>
<#else>
<script src="https://unpkg.com/halo-comment-yu@latest/dist/halo-comment.min.js?v=${theme.version!}"
type="text/javascript"></script>
</#if>
<#if settings.pjax_enabled!false>
<script src="${theme_base!}/source/lib/jquery-pjax/jquery.pjax.js?v=${theme.version!}"
type="text/javascript"></script>
<script src="${theme_base!}/source/js/pjax.js?v=${theme.version!}" type="text/javascript"></script>
</#if>
<#if settings.music_enabled!false>
<script src="${theme_base!}/source/lib/aplayer/APlayer.min.js?v=${theme.version!}" type="text/javascript"></script>
<script src="${theme_base!}/source/lib/meting/Meting.min.js?v=${theme.version!}" type="text/javascript"></script>
</#if>
<#if settings.evanyou!true>
<script src="${theme_base!}/source/lib/evanyou/evanyou.min.js?v=${theme.version!}" type="text/javascript"></script>
</#if>
12 changes: 7 additions & 5 deletions layout/navbar.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,13 @@
</li>
</#list>
</@menuTag>
<li class="menu-item nightModeBtn" id="nightModeBtn">
<i class="fa fa-lightbulb-o"
data-background-picture-night="${settings.background_picture_night!'${theme_base!}/source/images/head.jpg'}"
data-background-picture="${settings.background_picture!'${theme_base!}/source/images/head.jpg'}"></i>
</li>
<#if settings.night_mode_enabled!false>
<li class="menu-item nightModeBtn" id="nightModeBtn">
<i class="fa fa-lightbulb"
data-background-picture-night="${settings.background_picture_night!'${theme_base!}/source/images/head_night.jpeg'}"
data-background-picture="${settings.background_picture!'${theme_base!}/source/images/head.jpg'}"></i>
</li>
</#if>
<li class="menu-item search">
<form class="search-form" action="${blog_url!}/search">
<input name="keyword" type="text" autocomplete="off" class="search-input" placeholder="站内搜索">
Expand Down
2 changes: 1 addition & 1 deletion layout/pjax_js.ftl
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<script data-pjax>
$(function () {
sagiri.affix('.affix_div');
sagiri.lazyLoadPostsImages('https://cdn.jsdelivr.net/gh/cetr/cdn@master/blog/img/loading-1.svg');
sagiri.lazyLoadPostsImages('${theme_base!}/source/images/loading-1.svg');
sagiri.wrapImageWithFancyBox()
sagiri.addPostImgZoomify()
});
Expand Down
29 changes: 4 additions & 25 deletions layout/tail.ftl
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
<#if settings.evanyou!true>
<canvas id="evanyou"></canvas>
<script src="${theme_base!}/source/js/evanyou.min.js?v=${theme.version!}" type="text/javascript"></script>
</#if>
<div class="loading" style="display: none;">
<div class="loader"></div>
</div>
<#if settings.evanyou!true>
<canvas id="evanyou"></canvas>
</#if>
<#if settings.music_enabled!false>
<meting-js
async="true"
Expand All @@ -17,29 +16,9 @@
list-folded="true"
></meting-js>
</#if>
<#if settings.pjax_enabled!false>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/jquery.pjax.min.js?v=${theme.version!}"
type="text/javascript"></script>
</#if>
<#if settings.music_enabled!false>
<link href="https://cdn.jsdelivr.net/npm/aplayer/dist/APlayer.min.css?v=${theme.version!}" rel="stylesheet">
<script src="https://cdn.jsdelivr.net/npm/aplayer/dist/APlayer.min.js?v=${theme.version!}"
type="text/javascript"></script>
<script src="https://cdn.jsdelivr.net/npm/meting@2/dist/Meting.min.js?v=${theme.version!}"
type="text/javascript"></script>
</#if>

<#include "cdn_js.ftl">

<script src="${settings.comment_internal_plugin_js!'https://cdn.jsdelivr.net/gh/cetr/halo-comment-yu@latest/dist/halo-comment.min.js'}?v=${theme.version!}"
type="text/javascript"></script>

<#if settings.pjax_enabled!false>
<script src="${theme_base!}/source/js/pjax.js?v=${theme.version!}" type="text/javascript"></script>
</#if>
<#include "js.ftl">

<script src="${theme_base!}/source/js/main.js?v=${theme.version!}" type="text/javascript"></script>
<script src="${theme_base!}/source/js/animate.js?v=${theme.version!}" type="text/javascript"></script>
<#include "pjax_js.ftl">
</body>
</html>
2 changes: 1 addition & 1 deletion post.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
</h1>
<div class="post-meta">
<span class="post-time" style="color: #00a7e0">
<span class="post-meta-item-icon"><i class="fa fa-calendar-o"></i></span>
<span class="post-meta-item-icon"><i class="fa fa-calendar"></i></span>
<span class="post-meta-item-text">发表于</span>
<time title="Post created" itemprop="dateCreated datePublished"
datetime="${post.createTime}">
Expand Down
2 changes: 1 addition & 1 deletion search.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
<div class="post-meta">
<span class="post-time" style="color: #00a7e0">
<span class="post-meta-item-icon"><i
class="fa fa-calendar-o"></i></span>
class="fa fa-calendar"></i></span>
<span class="post-meta-item-text">发表于</span>
<time title="Post created" itemprop="dateCreated datePublished"
datetime="${post.createTime}">
Expand Down
28 changes: 22 additions & 6 deletions settings.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -222,12 +222,17 @@ links:
comment:
label: 评论设置
items:
comment_internal_plugin_js:
name: comment_internal_plugin_js
label: 评论模块JS
type: text
default: 'https://cdn.jsdelivr.net/gh/cetr/halo-comment-yu@latest/dist/halo-comment.min.js'
description: '评论js请在这里设置,系统里设置的js在本主题不生效'
comment_internal_plugin_js_enable:
name: comment_internal_plugin_js_enable
label: 使用系统设置评论模块JS
type: radio
data-type: bool
default: false
options:
- value: true
label: 开启
- value: false
label: 关闭
plugin:
label: 插件设置
items:
Expand Down Expand Up @@ -315,3 +320,14 @@ other:
label: 自定义样式
type: textarea
placeholder: '不需要 <style></style> 标签'
night_mode_enabled:
name: night_mode_enabled
label: 开启黑夜模式
type: radio
data-type: bool
default: false
options:
- value: true
label: 开启
- value: false
label: 关闭
9 changes: 1 addition & 8 deletions source/css/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -7309,14 +7309,7 @@ body {
display: inline !important;
}

.menu .menu-item.nightModeBtn {
float: right;
font-size: 19px;
width: 18px;
margin: -2px 0 0 20px;
}

@font-face {
font-family: Candyshop;
src: url(https://cdn.jsdelivr.net/gh/cetr/halo-theme-sagiri@sagiri-cdn/font/Candyshop.otf)
src: url(../font/Candyshop.otf)
}
23 changes: 19 additions & 4 deletions source/css/night.css
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
color: #bec3c9
}

.nightMode .views-top a {
.nightMode .views-top a:hover {
color: #bec3c9
}

Expand All @@ -80,7 +80,7 @@
}

.nightMode .menu-item .navbar-dropdown .nav-child:hover {
background-color: #535353;
background-color: #535353
}

.nightMode .pagination .page-number.current {
Expand All @@ -95,7 +95,7 @@
}

.nightMode .pagination .page-number:hover {
background: #535353;
background: #535353
}

.nightMode .pagination .extend {
Expand All @@ -106,6 +106,13 @@
background: 0
}

.menu .menu-item.nightModeBtn {
float: right;
font-size: 19px;
width: 18px;
margin: -2px 0 0 20px;
}

.nightMode .backtop-icon {
color: #2d2d2d
}
Expand All @@ -115,7 +122,7 @@
}

.nightMode .comments {
background-color: #efefef
background-color: #1A1A1A
}

.nightMode .post-meta span, .nightMode .post-meta time {
Expand All @@ -135,6 +142,10 @@
}

.nightMode .sidebar-nav .sidebar-nav-active, .nightMode .sidebar-nav li:hover {
color: #d8d8d8
}

.nightMode .sidebar-nav .sidebar-nav-active {
color: #d8d8d8;
border-bottom-color: #d8d8d8
}
Expand All @@ -145,4 +156,8 @@

.nightMode .back-to-top .back-to-top-btn {
color: #888
}

.nightMode .post-nav-item a:hover {
color: #bec3c9
}
Binary file added source/images/head_night.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions source/images/loading-1.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit ff30e29

Please sign in to comment.