Merge branch 'release_v4.5.0'
Some checks failed
sync-2-gitee / sync-2-gitee (push) Failing after 2s

This commit is contained in:
elkan1788 2023-06-24 21:20:22 +08:00
commit 53ad048763
84 changed files with 1024 additions and 945 deletions

View File

@ -172,9 +172,11 @@ List of Donors(Order desc by Date):
| Donation time | Donors | Donation mode | Donation content | Message |
| :-------: | ------ | ------ | ---- | ---- |
| 2022.09.30 | *軒 | wechat pay | ¥66.66 | Hope it could help more people. |
| 2022.09.30 | N*l | wechat pay | ¥20.00 | / |
| 2022.07.09 | *风 | wechat pay | ¥10.00 | / |
| 2022.05.08 | *泉 | wechat pay | ¥6.60 | Good luck with next develop. |
| 2022.02.28 | *娇 | wechat pay | ¥5.00 | / |
| 2021.12.21 | z*y | wechat pay | ¥18.88 | / |
| 2023.06.01 | **霖 | alipay | RMB 10.00 | / |
| 2022.11.15 | f888 | xianyu | RMB 6.20 | Good luck. |
| 2022.09.30 | *軒 | wechat pay | RMB 66.66 | Hope it could help more people. |
| 2022.09.30 | N*l | wechat pay | RMB 20.00 | / |
| 2022.07.09 | *风 | wechat pay | RMB 10.00 | / |
| 2022.05.08 | *泉 | wechat pay | RMB 6.60 | Good luck with next develop. |
| 2022.02.28 | *娇 | wechat pay | RMB 5.00 | / |
| 2021.12.21 | z*y | wechat pay | RMB 18.88 | / |

View File

@ -181,6 +181,8 @@ Copyright (c) 2022 hugo-next 团队
| 打赏时间 | 打赏者 | 打赏方式 | 打赏内容 | 留言 |
| :-------: | ------ | ------ | ---- | ---- |
| 2023.06.01 | **霖 | 支付宝 | ¥10.00 | / |
| 2022.11.15 | f888 | 咸鱼 | ¥6.20 | 聊表心意 |
| 2022.09.30 | *軒 | 微信支付 | ¥66.66 | 愿项目造福更多人! |
| 2022.09.30 | N*l | 微信支付 | ¥20.00 | / |
| 2022.07.09 | *风 | 微信支付 | ¥10.00 | / |

View File

@ -1 +1 @@
4.4.1
4.5.0

View File

@ -15,14 +15,23 @@
list-style: none;
margin: 0;
padding: 0;
}
.category-list-item {
margin: 5px 10px;
.category-list-item:before {
font-family: var(--fa-style-family,"Font Awesome 6 Free");
font-weight: var(--fa-style,900);
content: "\f07c";
margin-right: 5px;
}
.category-list-item {
margin: 5px 10px;
font-weight: bold;
}
}
.category-list-count {
color: $grey;
padding: 0 2px;
&::before {
content: ' (';
@ -33,7 +42,19 @@
}
}
.category-list-child {
padding-left: 10px;
.category-children-list {
padding-left: 38px;
list-style: none;
.category-children-list-item:before {
font-family: var(--fa-style-family,"Font Awesome 6 Free");
font-weight: var(--fa-style,900);
content: "\f0ae";
margin-right: 5px;
}
.category-children-list-item {
font-size: 0.925em;
}
}
}

View File

@ -59,6 +59,10 @@
@include post-card();
border: none;
background: none;
li {
word-break: break-all;
}
}
}

View File

@ -113,3 +113,8 @@
flex-basis: 100%;
height: 0;
}
#comments-count {
cursor: pointer;
border-bottom: 1px solid $link-decoration-color;
}

View File

@ -1,6 +1,6 @@
// CSS Style Guide : https://codeguide.co/#css
// All variables from site's config content.
{{- $P := .Site.Params }}
{{ $P := .Site.Params }}
// Base
$scheme : {{ $P.scheme }};
$darkmode : {{ $P.darkmode }};
@ -129,18 +129,18 @@ $disqusjs_enable : false;
$livere_enable : {{ isset $P "livere" }};
$utterances_enable : {{ isset $P "utterances" }};
$waline_enable : {{ isset $P "waline" }};
{{- with .Site.Params.comments }}
{{- $tce := and (isset . "nav") (and .storage (gt (len .nav) 1)) }}
{{ with .Site.Params.comments }}
{{ $tce := and (isset . "nav") (and .storage (gt (len .nav) 1)) }}
$two_comments_enable : {{ $tce }};
{{- if $tce }}
{{- $sortNav := sort .nav "weight" }}
{{ if $tce }}
{{ $sortNav := sort .nav "weight" }}
$two_comments_actived : {{ .active }};
$first_comment_color : {{ (index $sortNav 0).color }};
$first_comment_name : {{ lower (index $sortNav 0).name }};
$second_comment_color : {{ (index $sortNav 1).color }};
$second_comment_name : {{ lower (index $sortNav 1).name }};
{{- end }}
{{- end }}
{{ end }}
{{ end }}
//
// Variables Layer
@ -175,9 +175,4 @@ $second_comment_name : {{ lower (index $sortNav 1).name }};
// Schemes Layer
// --------------------------------------------------
{{ printf "@import '_schemes/%s/';" $P.scheme }}
// Custom Layer
// TODO
// --------------------------------------------------
// @import 'theme.injects.style';
{{ printf "@import '_schemes/%s/';" $P.scheme }}

View File

@ -24,6 +24,14 @@ NexT.boot.registerEvents = function() {
// Register comment's components
NexT.plugins.register();
// Register comment counter click event
const commentCnt = document.querySelector('#comments-count');
if (commentCnt && NexT.CONFIG.page.isPage) {
commentCnt.addEventListener('click', event => {
NexT.utils.slidScrollBarAnime('comments');
});
}
// Mobile top menu bar.
document.querySelector('.site-nav-toggle .toggle').addEventListener('click', event => {
event.currentTarget.classList.toggle('toggle-close');
@ -62,7 +70,7 @@ NexT.boot.refresh = function() {
NexT.utils.registerCommonSwitch();
NexT.utils.domAddClass('#goto-comments', 'goto-comments-on');
} else {
NexT.utils.hideCommontes();
NexT.utils.hideComments();
}
NexT.utils.registerImageViewer();

View File

@ -1,35 +1,31 @@
/* Page's view & comment counter plugin */
NexT.plugins.others.counter = function() {
let busz_postview = false;
let pageview_js = undefined;
let comment_js = undefined;
const busz = NexT.CONFIG.busuanzi;
if (busz != undefined && busz.pageview) {
busz_postview = true;
}
const post_meta = NexT.CONFIG.postmeta;
// Here can append others pageview & comment plugin
const waline = NexT.CONFIG.waline;
if (waline != undefined){
if(!busz_postview && waline.cfg.pageview) {
pageview_js = NexT.utils.getCDNResource(NexT.CONFIG.page.waline.js[0]);
NexT.utils.getScript(pageview_js, function(){
Waline.pageviewCount({
serverURL: waline.cfg.serverurl
const views = post_meta.views;
if(views != undefined && views.enable) {
if (views.plugin == 'waline') {
pageview_js = NexT.utils.getCDNResource(NexT.CONFIG.page.waline.js[0]);
NexT.utils.getScript(pageview_js, function(){
Waline.pageviewCount({
serverURL: NexT.CONFIG.waline.cfg.serverurl
});
});
});
}
}
if (waline.cfg.comment) {
comment_js = NexT.utils.getCDNResource(NexT.CONFIG.page.waline.js[1]);
NexT.utils.getScript(comment_js, function(){
Waline.commentCount({
serverURL: waline.cfg.serverurl
const comments = post_meta.comments;
if (comments != undefined && comments.enable) {
if (comments.plugin == 'waline') {
comment_js = NexT.utils.getCDNResource(NexT.CONFIG.page.waline.js[1]);
NexT.utils.getScript(comment_js, function(){
Waline.commentCount({
serverURL: NexT.CONFIG.waline.cfg.serverurl
});
});
});
}
}
}
}

View File

@ -59,11 +59,13 @@ NexT.utils = {
},
slidScrollBarAnime: function (targetId, easing = 'linear', duration = 500) {
const targetObj = document.getElementById(targetId);
window.anime({
targets: document.scrollingElement,
duration: duration,
easing: easing,
scrollTop: targetId == '' ? 0 : document.getElementById(targetId).getBoundingClientRect().top + window.scrollY
scrollTop: targetId == '' || !targetObj ? 0 : targetObj.getBoundingClientRect().top + window.scrollY
});
},
@ -481,8 +483,11 @@ NexT.utils = {
});
},
hideCommontes: function () {
document.querySelector('.post-comments').style.display = 'none';
hideComments: function () {
let postComments = document.querySelector('.post-comments');
if (postComments !== null) {
postComments.style.display = 'none';
}
},
hiddeLodingCmp: function (selector) {

View File

@ -1,5 +1,5 @@
# Hugo NexT theme's custom config
version: 4.4.1
version: 4.5.0
domain: hugo-next.eu.org

View File

@ -129,6 +129,4 @@ plugins:
alias_name: '@waline/client'
version: 2.13.0
file: dist/comment.js
alias: waline
alias: waline

View File

@ -298,11 +298,11 @@ params:
# Posts / Categories / Tags in sidebar.
basic: true
# 站点访问信息
# Site information
statistic:
# Site's view information
views:
enable: true
# 组件类型,可选值为: 51la, busuanzi
# 使用51la时需要注册账号https://invite.51.la/1NUfGTS1?target=V6
# 使用51la时需要注册账号https://invite.51.la/
# Plguin value is: 51la, busuanzi
plugin: busuanzi
@ -478,6 +478,18 @@ params:
categories: true
wordCount: true
readTime: true
# 是否开启评论数显示
comments:
enable: true
# 评论统计插件暂只支持waline
# Comment counter plugin, only support waline
plugin: waline
# 是否开启页面访问数显示
views:
enable: true
# 页面访问统计插件支持busuanzi, waline, leancloud
# Page views counter plugin, support: busuanzi, waline, leancloud
plugin: busuanzi
# 文章底部的设置
# Post footer settings
@ -937,8 +949,6 @@ params:
busuanzi:
visitorsIcon: fa fa-user
viewsIcon: fa fa-eye
postViews: true
# ---------------------------------------------------------------
# 内容搜索服务

View File

@ -7,7 +7,8 @@ date: 2022-09-10T21:02:32+08:00
lastmod: 2022-09-10T21:02:32+08:00
categories:
- 示例
- 示例文章
tags:
- 自定义
- 个性化

View File

@ -7,7 +7,9 @@ date: 2022-06-04T19:46:45+08:00
lastmod: 2022-06-04T19:46:45+08:00
categories:
- 示例
- 示例文章
- 语法
tags:
- 表情
- emoji

View File

@ -7,7 +7,7 @@ date: 2022-06-01T15:59:41+08:00
lastmod: 2022-06-01T15:59:41+08:00
categories:
- 示例
- 示例文章
tags:
- Hugo
- NexT

View File

@ -6,10 +6,11 @@ lastmod: 2022-06-03T16:43:23+08:00
date: 2022-06-02T11:52:03+08:00
categories:
- 博客
- 开始建站
tags:
- Hugo
- 开始
- Hugo
- 开始
url: post/hello-world.html
toc: true

View File

@ -10,7 +10,9 @@ author: Mainroad
originLink: https://mainroad-demo.netlify.app/post/basic-elements/
categories:
- 示例
- 示例文章
- 语法
tags:
- Markdown
- 语法

View File

@ -7,7 +7,8 @@ date: 2022-09-11T10:16:02+08:00
lastmod: 2022-09-11T10:16:02+08:00
categories:
- 示例
- 第三方引入
- 数学公式
tags:
- 数学公式
- mathjax
@ -32,7 +33,7 @@ math: mathjax
{{< /note >}}
**注意:** 使用[支持的TeX功能](https://docs.mathjax.org/en/latest/input/tex/index.html)的联机参考资料。
**注意:** 使用[支持的TeX功能](https://docs.mathjax.org/en/latest/input/tex/index.html)的联机参考资料。
## 例子
@ -50,7 +51,7 @@ $$
### 几何级数之和
我把接下来的两个例子分成了几行,这样它在手机上表现得更好。这就是为什么它们包含 `\displaystyle`
我把接下来的两个例子分成了几行,这样它在手机上表现得更好。这就是为什么它们包含 `\displaystyle`或者可使用类似 `\displaylines{x = a + b \\\ y = b + c}` 语法进行截断,具体信息可见:[mathjax-issues2312](https://github.com/mathjax/MathJax/issues/2312)
$$
\displaystyle\sum_{i=1}^{k+1}i
@ -78,7 +79,12 @@ $$
### 乘记号
$$
\displaystyle 1 + \frac{q^2}{(1-q)}+\frac{q^6}{(1-q)(1-q^2)}+\cdots = \displaystyle \prod_{j=0}^{\infty}\frac{1}{(1-q^{5j+2})(1-q^{5j+3})}, \displaystyle\text{ for }\lvert q\rvert < 1.
\displaystyle 1 + \frac{q^2}{(1-q)}+\frac{q^6}{(1-q)(1-q^2)}+\cdots =
$$
$$
\displaystyle \prod_{j=0}^{\infty}\frac{1}{(1-q^{5j+2})(1-q^{5j+3})},
\displaystyle\text{ for }\lvert q\rvert < 1.
$$
@ -88,8 +94,8 @@ $$
### 希腊字母
$$
\Gamma\ \Delta\ \Theta\ \Lambda\ \Xi\ \Pi\ \Sigma\ \Upsilon\ \Phi\ \Psi\ \Omega
\alpha\ \beta\ \gamma\ \delta\ \epsilon\ \zeta\ \eta\ \theta\ \iota\ \kappa\ \lambda\ \mu\ \nu\ \xi \ \omicron\ \pi\ \rho\ \sigma\ \tau\ \upsilon\ \phi\ \chi\ \psi\ \omega\ \varepsilon\ \vartheta\ \varpi\ \varrho\ \varsigma\ \varphi
\displaylines{\Gamma\ \Delta\ \Theta\ \Lambda\ \Xi\ \Pi\ \Sigma\ \Upsilon\ \Phi\ \Psi\ \Omega
\alpha\ \beta\ \gamma\ \delta\ \epsilon\ \zeta\ \\\\ \eta\ \theta\ \iota\ \kappa\ \lambda\ \mu\ \nu\ \xi \ \omicron\ \pi\ \rho\ \sigma\ \tau\ \upsilon\ \phi\ \chi\ \psi\ \omega\ \varepsilon\ \vartheta\ \varpi\ \varrho\ \varsigma\ \varphi}
$$
@ -99,8 +105,8 @@ $$
$$
$$
\Leftarrow\ \Rightarrow\ \leftrightarrow\ \Leftrightarrow\ \mapsto\ \hookleftarrow
\leftharpoonup\ \leftharpoondown\ \rightleftharpoons\ \longleftarrow\ \Longleftarrow\ \longrightarrow
\displaylines{\Leftarrow\ \Rightarrow\ \leftrightarrow\ \Leftrightarrow\ \mapsto\ \hookleftarrow
\leftharpoonup\ \leftharpoondown\ \\\\\ \rightleftharpoons\ \longleftarrow\ \Longleftarrow\ \longrightarrow}
$$
$$

View File

@ -7,7 +7,8 @@ date: 2022-09-18T20:58:13+08:00
lastmod: 2022-09-18T20:58:13+08:00
categories:
- 示例
- 第三方引入
- 图序功能
tags:
- 流程图
- 时序图

View File

@ -7,7 +7,7 @@ date: 2022-10-06T09:02:26+08:00
lastmod: 2022-10-30T21:03:16+08:00
categories:
- 示例
- 示例文章
tags:
- toc
- 标题

View File

@ -7,7 +7,8 @@ date: 2022-08-06T14:41:50+08:00
lastmod: 2022-08-06T14:41:50+08:00
categories:
- 示例
- 示例文章
- 语法
tags:
- 短代码
- 语法

View File

@ -7,7 +7,8 @@ date: 2022-06-07T19:09:52+08:00
lastmod: 2022-06-07T19:09:52+08:00
categories:
- 示例
- 示例文章
- 语法
tags:
- 语法
- 高亮

View File

@ -7,7 +7,7 @@ date: 2022-06-08T21:12:52+08:00
lastmod: 2022-06-08T21:12:52+08:00
categories:
- 示例
- 示例文章
tags:
- 目录
- 导航

View File

@ -18,121 +18,83 @@ CateTitle:
AllSome:
other: "All {{ .Some }}"
NavToggleLabel:
other: Toggle navigation bar
MSearchLabel:
other: Search
Symbol:
colon: ":"
comma: ","
period: "."
SymbolColon:
other: ":"
SymbolComma:
other: ","
SymbolPeriod:
other: "."
Sidebar:
label:
posts: Posts
categories: Categories
tags: Tags
rss: RSS
ccommons: "Creative Commons"
toc: TOC
overview: Overview
navToggle: "Toggle Navigation Bar"
search: Search
SbPostsLable:
other: "Posts"
SbCatesTitle:
other: "Categories"
SbTagsTitle:
other: "Tags"
TableOfContents:
other: "TOC"
SiteOverview:
other: "Overview"
RSSLable:
other: "RSS Subscribe"
CCLinkTitle:
other: "Creative Commons"
Terms:
archives: "{{ .Count }} posts in total"
categories: "{{ .Count }} categories in total"
tags: "{{ .Count }} tags in total"
TagsCounterTitle:
zero: No tags
other: "{{ .Count }} tags in total"
CatesCounterTitle:
zero: No categories
other: "{{ .Count }} categories in total"
ArchiveCounterTitle:
zero: No posts.
other: "{{ .Count }} posts in total"
PostArchive:
cheers:
um: Um...
ok: Ok
nice: Nice
good: Good
great: Greate
excellent: Excellent
keepOn: Keep on posting.╰(*°▽°*)╯
PostArchiveCheersUm:
other: Um..
PostArchiveCheersOk:
other: Ok
PostArchiveCheersNice:
other: Nice
PostArchiveCheersGood:
other: Good
PostArchiveCheersGreat:
other: Great
PostArchiveCheersExcellent:
other: Excellent
PostArchiveKeepOn:
other: Keep on posting.╰(*°▽°*)╯
PostMeta:
sticky: Stickys
publish:
date: "Publish on"
time: "Create Time"
lastmod:
date: "Update on"
time: "Modify Time"
category: "Classify at"
words:
title: Words
count: "{{- .WordCount -}}"
reading:
title: Read
time: "{{- .ReadingTime -}}mins"
views: Views
comments: Comments
tags: Tags
more: "Read More"
edit: "Edit this post"
PostStickyTitle:
other: Strickys
PostPublishDate:
other: "Publish on"
PostPublishTime:
other: "Create Time"
PostLastModDate:
other: "Update on"
PostLastModTime:
other: "Modify Time"
PostCategory:
other: "Classify at"
PostWords:
other: "Words"
PostWordCount:
other: "{{- .WordCount -}}"
PostReading:
other: "Read"
PostReadTime:
other: "{{- .ReadingTime -}}min"
PostViews:
other: "Views"
PostComments:
other: "Comments"
PostTag:
other: "Tags"
PostReadMore:
other: "Read More"
PostEditTitle:
other: Edit this post
Reward:
title: Donate
wechatpay: WechatPay
alipay: Alipay
paypal: Paypal
bitcoin: Bitcoin
PostCRTitle:
other: Post Title
PostCRAuthor:
other: Post Author
PostCRLink:
other: Post Link
PostCROriginAuthor:
other: Written By
PostCROriginLink:
other: Originally From
PostCRLicenseTitle:
other: Copyright Notice
PostCRLicenseContent:
other: "All articles in this blog are licensed under <i class=\"fab fa-fw fa-creative-commons\"></i>%s unless stating additionally."
PostCopyRight:
title: Post Title
author: Post Author
link: Post Link
origin:
author: Written By
link: Originally From
license:
title: Copyright Notice
content: "All articles in this blog are licensed under <i class=\"fab fa-fw fa-creative-commons\"></i>%s unless stating additionally."
PostFollowMe:
other: Welcome to my other publishing channels
RewardDonate:
other: Donate
RewardWechatpay:
other: Wechat Pay
RewardAlipay:
other: Alipay
RewardPaypal:
other: PayPal
RewardBitcoin:
other: Bitcoin
PostCommentTitle:
other: Comments
PostComments:
title: Comments
SiteInfoItems:
title: "Web Status"
@ -147,17 +109,14 @@ SiteInfoItems:
totalViews: "Total Views"
lastUpdate: "Last Update:"
FooterPowerby:
other: "Power by %s"
Footer:
powerby: "Power by %s"
SearchPh:
other: Searching...
SearchEmpty:
other: "We didn't find any results for the search: ${query}"
SearchHits:
Search:
placeholder: Searching...
empty: "We didn't find any results for the search: ${query}"
hits: "${hits} results found"
SearchHitsTime:
other: "${hits} results found in ${time} ms"
time: "${hits} results found in ${time} ms"
DateSuffix:
years: " Year "

View File

@ -19,121 +19,82 @@ CateTitle:
AllSome:
other: "所有 {{ .Some }}"
NavToggleLabel:
other: 切换导航栏
Symbol:
colon: ""
comma: ""
period: "。"
MSearchLabel:
other: 搜索
Sidebar:
label:
posts: 日志
categories: 分类
tags: 标签
rss: RSS 订阅
ccommons: 共享知识
toc: 文章目录
overview: 站点概览
navToggle: 切换导航栏
search: 搜索
SymbolColon:
other: ""
SymbolComma:
other: ""
SymbolPeriod:
other: "。"
SbPostsLable:
other: 日志
SbCatesTitle:
other: 分类
SbTagsTitle:
other: 标签
TableOfContents:
other: 文章目录
SiteOverview:
other: 站点概览
RSSLable:
other: RSS 订阅
CCLinkTitle:
other: 共享知识
Terms:
archives: "目前共计 <strong>{{ .Count }}</strong> 篇日志"
categories: "目前共计 <strong>{{ .Count }}</strong> 个分类"
tags: "目前共计 <strong>{{ .Count }}</strong> 个标签"
TagsCounterTitle:
zero: 暂无标签
other: "目前共计 <strong>{{ .Count }}</strong> 个标签"
CatesCounterTitle:
zero: 暂无分类
other: "目前共计 <strong>{{ .Count }}</strong> 个分类"
ArchiveCounterTitle:
zero: 暂无日志
other: "目前共计 <strong>{{ .Count }}</strong> 篇日志"
PostArchive:
cheers:
um: 嗯..
ok: 还行
nice: 不错
good: 很好
great: 非常好
excellent: 太棒了
keepOn: 继续努力哟。╰(*°▽°*)╯
PostArchiveCheersUm:
other: 嗯..
PostArchiveCheersOk:
other: 还行
PostArchiveCheersNice:
other: 不错
PostArchiveCheersGood:
other: 很好
PostArchiveCheersGreat:
other: 非常好
PostArchiveCheersExcellent:
other: 太棒了
PostArchiveKeepOn:
other: 继续努力哟。╰(*°▽°*)╯
PostMeta:
sticky: 置顶
publish:
date: 发表于
time: 创建时间
lastmod:
date: 更新于
time: 修改时间
category: 分类于
words:
title: 字数
count: "{{- .WordCount -}}"
reading:
title: 阅读
time: "{{- .ReadingTime -}}分钟"
views: 浏览
comments: 评论
tags: 标签
more: 阅读全文
edit: 编辑
PostStickyTitle:
other: 置顶
PostPublishDate:
other: 发表于
PostPublishTime:
other: 创建时间
PostLastModDate:
other: 更新于
PostLastModTime:
other: 修改时间
PostCategory:
other: "分类于"
PostWords:
other: 字数
PostWordCount:
other: "{{- .WordCount -}}"
PostReading:
other: 阅读
PostReadTime:
other: "{{- .ReadingTime -}}分钟"
PostViews:
other: 浏览
PostComments:
other: 评论
PostTags:
other: 标签
PostReadMore:
other: 阅读全文
PostEditTitle:
other: 编辑
Reward:
title: 赞赏
wechatpay: 微信
alipay: 支付宝
paypal: Paypal
bitcoin: 比特币
PostCRTitle:
other: 文章标题
PostCRAuthor:
other: 本文作者
PostCRLink:
other: 本文链接
PostCROriginAuthor:
other: 原文作者
PostCROriginLink:
other: 原文链接
PostCRLicenseTitle:
other: 版权声明
PostCRLicenseContent:
other: "本博客所有文章除特别声明外,均采用 <i class=\"fab fa-fw fa-creative-commons\"></i>%s 许可协议。转载请注明出处!"
PostCopyRight:
title: 文章标题
author: 本文作者
link: 本文链接
origin:
author: 原文作者
link: 原文链接
license:
title: 版权声明
content: "本博客所有文章除特别声明外,均采用 <i class=\"fab fa-fw fa-creative-commons\"></i>%s 许可协议。转载请注明出处!"
PostFollowMe:
other: 欢迎关注我的其它发布渠道
RewardDonate:
other: 赞赏
RewardWechatpay:
other: 微信
RewardAlipay:
other: 支付宝
RewardPaypal:
other: PayPal
RewardBitcoin:
other: 比特币
PostCommentTitle:
other: 评论交流
PostComments:
title: 评论交流
SiteInfoItems:
title: "网站资讯"
@ -148,17 +109,14 @@ SiteInfoItems:
totalViews: "总访问量:"
lastUpdate: "最后更新于:"
FooterPowerby:
other: 由 %s 强力驱动
Footer:
powerby: 由 %s 强力驱动
SearchPh:
other: 搜索...
SearchEmpty:
other: "没有找到任何搜索结果:${query}"
SearchHits:
Search:
placeholder: 搜索...
empty: "没有找到任何搜索结果:${query}"
hits: "找到 ${hits} 个搜索结果"
SearchHitsTime:
other: "找到 ${hits} 个搜索结果(用时 ${time} 毫秒)"
time: "找到 ${hits} 个搜索结果(用时 ${time} 毫秒)"
DateSuffix:
years: " 年 "

136
i18n/zh-tw.yaml Normal file
View File

@ -0,0 +1,136 @@
#--------------------------------------
# 繁體版本
#--------------------------------------
archives:
other: 文章
tag:
other: 標籤
tags:
other: 標籤
TagTitle:
other: 標籤集錦
category:
other: 分類
categories:
other: 分類
CateTitle:
other: 分類欄目
AllSome:
other: "所有 {{ .Some }}"
Symbol:
colon: ""
comma: ""
period: "。"
Sidebar:
label:
posts: 日誌
categories: 分類
tags: 標籤
rss: RSS 訂閱
ccommons: 共享知識
toc: 文章目錄
overview: 站點概覽
navToggle: 切換導航欄
search: 搜索
Terms:
archives: "目前共計 <strong>{{ .Count }}</strong> 篇日誌"
categories: "目前共計 <strong>{{ .Count }}</strong> 個分類"
tags: "目前共計 <strong>{{ .Count }}</strong> 個標籤"
PostArchive:
cheers:
um: 嗯..
ok: 還行
nice: 不错
good: 很好
great: 非常好
excellent: 太棒了
keepOn: 繼續努力喲。╰(*°▽°*)╯
PostMeta:
sticky: 置頂
publish:
date: 發表於
time: 創建時間
lastmod:
date: 更新於
time: 修改時間
category: 分類於
words:
title: 字數
count: "{{- .WordCount -}}"
reading:
title: 閱讀
time: "{{- .ReadingTime -}}分鐘"
views: 瀏覽
comments: 評論
tags: 標籤
more: 閱讀全文
edit: 編輯
Reward:
title: 讚賞
wechatpay: 微信
alipay: 支付寶
paypal: Paypal
bitcoin: 比特幣
PostCopyRight:
title: 文章標題
author: 本文作者
link: 本文鏈接
origin:
author: 原文作者
link: 原文鏈接
license:
title: 版權聲明
content: "本博客所有文章除特別聲明外,均採用 <i class=\"fab fa-fw fa-creative-commons\"></i>%s 許可協議。轉載請註明出處!"
PostFollowMe:
other: 歡迎關注我的其它發布渠道
PostCommentTitle:
other: 評論交流
SiteInfoItems:
title: "網站資訊"
runTimes: "已運行:"
words: "總字數:"
readTimes: "閱讀約:"
visitors: "總訪客數:"
pageViews: "頁面瀏覽:"
todayViews: "今日訪問:"
yesterdayViews: "昨日訪問:"
monthViews: "本月訪問:"
totalViews: "總訪問量:"
lastUpdate: "最後更新於:"
FooterPowerby:
other: 由 %s 強力驅動
Search:
placeholder: 搜索...
empty: "沒有找到任何搜索結果:${query}"
hits: "找到 ${hits} 個搜索結果"
time: "找到 ${hits} 個搜索結果(用時 ${time} 毫秒)"
DateSuffix:
years: " 年 "
days: " 天 "
hours: " 小時 "
mins: " 分鐘"
month: " 個月前"
day: " 天前"
hour: " 小時前"
min: " 分鐘前"
just: "剛剛"
ToolBtns:
comment: "直達評論"
theme: "深淺模式切換"
lang: "多語言翻譯"
backTop: "返回頂部"

View File

@ -0,0 +1,3 @@
<h{{ .Level }} id="{{ .Anchor | safeURL }}">{{ .Text | safeHTML }}
<a class="header-anchor" href="#{{ .Anchor | safeURL }}"></a>
</h{{ .Level }}>

View File

@ -1,7 +1,7 @@
{{- $extURL := and .Page.Site.Params.exturl.enable (strings.HasPrefix .Destination "http") }}
{{ $extURL := and .Page.Site.Params.exturl.enable (strings.HasPrefix .Destination "http") }}
<a href="{{ .Destination | safeURL }}" title="{{ .Text }}" {{ if $extURL }}rel="noopener external nofollow noreferrer" target="_blank" class=" exturl"{{ end }}>
{{ .Text | safeHTML }}
{{- if and $extURL .Page.Site.Params.exturl.icon }}
{{ if and $extURL .Page.Site.Params.exturl.icon }}
<i class="fa fa-external-link-alt"></i>
{{- end }}
{{ end }}
</a>

View File

@ -1,13 +1,13 @@
{{- range $k, $v := (partialCached "init.html" .) -}}
{{- $.Scratch.Set $k $v -}}
{{- end -}}
{{ range $k, $v := (partialCached "init.html" .) }}
{{ $.Scratch.Set $k $v }}
{{ end }}
{{ $isComment := .Params.comment.enable | default .Site.Params.comments.enable }}
{{ .Scratch.Set "isComment" $isComment }}
<!DOCTYPE html>
<html lang="{{ .Site.LanguageCode }}" data-theme="{{ .Scratch.Get "theme" }}">
<head>
{{- partial "head.html" . }}
{{ partial "head.html" . }}
<title>{{ block "title" . }}{{ .Site.Title }}{{ end }}</title>
<noscript>
<link rel="stylesheet" href="/css/noscript.css">
@ -19,30 +19,30 @@
<main class="main">
<header class="header" itemscope itemtype="http://schema.org/WPHeader">
<div class="header-inner">
{{- partial "header.html" . }}
{{ partial "header.html" . }}
</div>
<!-- Sidebar -->
{{- if ne .Site.Params.sidebar.display "remove" }}
{{- partial "sidebar.html" . }}
{{- end }}
{{ if ne .Site.Params.sidebar.display "remove" }}
{{ partial "sidebar.html" . }}
{{ end }}
</header>
<!-- Widgets -->
{{ partial "widgets.html" . }}
<div class="main-inner {{ block "main_inner_class" . }}{{ end }}">
<!-- Submenu,Content,Comment -->
{{- block "main" . }}{{- end }}
{{- if and .IsPage $isComment }}
{{- partialCached "comments.html" . }}
{{- end }}
{{ block "main" . }}{{ end }}
{{ if and .IsPage $isComment }}
{{ partialCached "comments.html" . }}
{{ end }}
</div>
</main>
<footer class="footer">
<div class="footer-inner">
{{- partialCached "footer.html" . }}
{{ partialCached "footer.html" . }}
</div>
</footer>
{{- partial "scripts.html" . }}
{{ partial "scripts.html" . }}
</body>
</html>

View File

@ -1,6 +1,6 @@
[
{{- range $index, $entry := where .Site.RegularPages "Kind" "page" }}
{{- if $index }}, {{ end }}
{{ range $index, $entry := where .Site.RegularPages "Kind" "page" }}
{{ if $index }}, {{ end }}
{
"objectID": "{{ .Date.Unix }}",
"permalink": "{{ .Permalink | relURL }}",
@ -9,5 +9,5 @@
"date": {{ .Date.Format $.Site.Params.timeFormat | jsonify }},
"updated": {{ .Lastmod.Format $.Site.Params.timeFormat | jsonify }}
}
{{- end }}
{{ end }}
]

View File

@ -5,12 +5,12 @@
<title>{{ .Title }}</title>
<url>{{ .RelPermalink | relLangURL }}</url>
<categories>
{{- range .Params.categories }}<category>{{ . }}</category>{{- end }}
{{ range .Params.categories }}<category>{{ . }}</category>{{ end }}
</categories>
<tags>
{{- range .Params.tags }}
{{ range .Params.tags }}
<tag>{{ . }}</tag>
{{- end }}
{{ end }}
</tags>
<content type="html"><![CDATA[{{ .Content | plainify }}]]></content>
</entry>

View File

@ -1,15 +1,15 @@
{{- define "title" }}
{{- .Params.Title | default (T .Section) | default .Section }} - {{ .Site.Title -}}
{{- end -}}
{{ define "title" }}
{{ .Params.Title | default (T .Section) | default .Section }} - {{ .Site.Title }}
{{ end }}
{{ define "main_inner_class" }}index posts-expand{{ end }}
{{- define "main" }}
{{ define "main" }}
{{ $paginator := .Paginate (where .Site.RegularPages "Section" "==" .Section) }}
{{- range $paginator.Pages }}
{{ range $paginator.Pages }}
{{ partial "post.html" (dict "ctx" . "IsHome" true) }}
{{- end }}
{{ end }}
{{- partial "partials/pagination.html" . }}
{{ partial "partials/pagination.html" . }}
{{- end }}
{{ end }}

View File

@ -1,7 +1,7 @@
{{- define "title" }}{{- .Title }} - {{ .Site.Title -}}{{- end }}
{{ define "title" }}{{ .Title }} - {{ .Site.Title }}{{ end }}
{{- define "main_inner_class" }}post posts-expand{{- end }}
{{ define "main_inner_class" }}post posts-expand{{ end }}
{{- define "main" }}
{{ define "main" }}
{{ partial "post.html" (dict "ctx" . "IsHome" false) }}
{{- end }}
{{ end }}

View File

@ -1,6 +1,6 @@
{{- define "title" -}}
{{- .Title }} - {{ T .Data.Singular | default .Data.Singular }} - {{ .Site.Title -}}
{{- end -}}
{{ define "title" }}
{{ .Title }} - {{ T .Data.Singular | default .Data.Singular }} - {{ .Site.Title }}
{{ end }}
{{ define "main_inner_class" }}{{ .Data.Plural }} posts-collapse{{ end }}
{{ define "main" }}
<div class="post-block">
@ -18,5 +18,5 @@
</div>
</div>
{{- partial "pagination.html" . }}
{{- end }}
{{ partial "pagination.html" . }}
{{ end }}

View File

@ -1,55 +1,92 @@
{{- define "title" -}}
{{- .Params.Title | default (T .Data.Plural) | default .Data.Plural | dict "Some" | T "AllSome" }} - {{ .Site.Title -}}
{{- end -}}
{{- define "main_inner_class" }}{{.Data.Plural}} posts-expand{{ end -}}
{{- define "main" }}
{{ define "title" }}
{{ .Params.Title | default (T .Data.Plural) | default .Data.Plural | dict "Some" | T "AllSome" }} - {{ .Site.Title }}
{{ end }}
{{ define "main_inner_class" }}{{.Data.Plural}} posts-expand{{ end }}
{{ define "main" }}
<div class="post-block" lang="{{ .Site.LanguageCode }}">
<div class="post-header">
<h1>
{{- if eq .Data.Plural "categories" }}
{{- T "CateTitle" }}
{{- else if eq .Data.Plural "tags" }}
{{- T "TagTitle" }}
{{- end }}
{{ if eq .Data.Plural "categories" }}
{{ T "CateTitle" }}
{{ else if eq .Data.Plural "tags" }}
{{ T "TagTitle" }}
{{ end }}
</h1>
</div>
<div class="post-body">
{{- if eq .Data.Plural "categories" }}
{{ $cats := .Site.Taxonomies.categories }}
{{ if eq .Data.Plural "categories" }}
{{ $categories := .Site.Taxonomies.categories }}
<div class="category-all-page">
<div class="category-all-title">
{{- T "CatesCounterTitle" (.Scratch.Get "catsCount") | safeHTML -}}
{{ T "Terms.categories" (.Scratch.Get "catsCount") | safeHTML }}
</div>
<div class="category-all">
<ul class="category-list">
{{- range $name, $items := $cats }}
<li class="category-list-item">
<a class="category-list-link" href="{{ "/categories/" | relLangURL }}{{ $name | urlize }}" data-pjax-state="">{{ .Page.Title }}</a>
<span class="category-list-count">{{ len $items }}</span>
</li>
{{- end }}
</ul>
{{ $allSecondaryCats := slice }}
{{ range .Site.Taxonomies.categories.ByCount }}
{{ $primaryCategory := .Name }}
{{ $primaryCount := 0 }}
{{ $secondaryCategories := slice}}
{{ $pages := $.Scratch.Get "pages" }}
{{ range where $pages "Params.categories" "intersect" (slice $primaryCategory) }}
{{ if eq (index .Params.categories 0) $primaryCategory }}
{{ $primaryCount = add $primaryCount 1 }}
{{/** if and (isset .Params.categories 1) (not (in $secondaryCategories (index .Params.categories 1))) **/}}
{{ if isset .Params.categories 1 }}
{{ if not (in $secondaryCategories (index .Params.categories 1)) }}
{{ $secondaryCategories = $secondaryCategories | append (index .Params.categories 1) }}
{{ $allSecondaryCats = $allSecondaryCats | append (index .Params.categories 1) }}
{{ end }}
{{ end }}
{{ end }}
{{ end }}
{{ if not (in $allSecondaryCats $primaryCategory) }}
<li class="category-list-item">
<a class="category-list-link" href="{{ "categories/" | relURL }}{{ $primaryCategory | urlize }}">
{{ $primaryCategory }}
<span class="category-list-count">{{ $primaryCount }}</span>
</a>
</li>
<ul class="category-children-list">
{{ range $secondaryCategories }}
{{ $secondaryCategory := . }}
{{ $secondaryCount := 0 }}
{{ range where $pages "Params.categories" "intersect" (slice $secondaryCategory) }}
{{ if and (eq (index .Params.categories 0) $primaryCategory) (eq (index .Params.categories 1) $secondaryCategory) }}
{{ $secondaryCount = add $secondaryCount 1 }}
{{ end }}
{{ end }}
<li class="category-children-list-item">
<a class="category-list-link" href="{{ "categories/" | relURL }}{{ . | urlize }}">
{{ . }}
<span class="category-list-count">{{ $secondaryCount }}</span>
</a>
</li>
{{ end }}
</ul>
{{ end }}
{{ end }}
</ul>
{{ end }}
{{ if eq .Data.Plural "tags" }}
{{ $tags := .Site.Taxonomies.tags }}
<div class="tag-cloud">
<div class="tag-cloud-title">
{{ T "Terms.tags" (.Scratch.Get "tagsCount") | safeHTML }}
</div>
<div class="tag-cloud-tags">
{{ $randNums := (seq 10) }}
{{- range $name, $items := $tags }}
<a class="tag-cloud-{{ index (shuffle $randNums) 0 }}" href="{{ "/tags/" | relLangURL }}{{ $name | urlize }}">{{ .Page.Title }}
<span class="tag-list-count">
<sup>({{ len $items }})</sup>
</span>
</a>
{{ end }}
</div>
</div>
</div>
{{- end }}
{{- if eq .Data.Plural "tags" }}
{{ $tags := .Site.Taxonomies.tags }}
<div class="tag-cloud">
<div class="tag-cloud-title">
{{- T "TagsCounterTitle" (.Scratch.Get "tagsCount") | safeHTML -}}
</div>
<div class="tag-cloud-tags">
{{ $randNums := (seq 10) }}
{{- range $name, $items := $tags }}
<a class="tag-cloud-{{ index (shuffle $randNums) 0 }}" href="{{ "/tags/" | relLangURL }}{{ $name | urlize }}">{{ .Page.Title }}
<span class="tag-list-count">
<sup>({{ len $items }})</sup>
</span>
</a>
{{- end }}
</div>
</div>
{{- end }}
{{ end }}
</div>
</div>
{{- end }}
{{ end }}

View File

@ -1,30 +1,30 @@
{{- define "title" }}
{{- .Params.Title | default (T .Section) | default .Section | dict "Some" | T "AllSome" }} - {{ .Site.Title -}}
{{- end -}}
{{ define "title" }}
{{ .Params.Title | default (T .Section) | default .Section | dict "Some" | T "AllSome" }} - {{ .Site.Title }}
{{ end }}
{{ define "main_inner_class" }}archive posts-collapse{{ end }}
{{- define "main" }}
{{ define "main" }}
<div class="post-block">
<div class="post-content">
<div class="collection-title">
{{- $cheers := "Um" }}
{{- $posts := .Scratch.Get "postsCount" }}
{{- if gt $posts 210 }}
{{- $cheers = "Excellent" }}
{{- else if gt $posts 130 }}
{{- $cheers = "Great" }}
{{- else if gt $posts 80 }}
{{- $cheers = "Good" }}
{{- else if gt $posts 50 }}
{{- $cheers = "Nice" }}
{{- else if gt $posts 30 }}
{{- $cheers = "Ok" }}
{{- end }}
{{ $cheers := "um" }}
{{ $posts := .Scratch.Get "postsCount" }}
{{ if gt $posts 210 }}
{{ $cheers = "excellent" }}
{{ else if gt $posts 130 }}
{{ $cheers = "great" }}
{{ else if gt $posts 80 }}
{{ $cheers = "good" }}
{{ else if gt $posts 50 }}
{{ $cheers = "nice" }}
{{ else if gt $posts 30 }}
{{ $cheers = "ok" }}
{{ end }}
<span class="collection-header">
{{- T (printf "PostArchiveCheers%s" $cheers) }}
{{- T "SymbolComma" }}
{{- T "ArchiveCounterTitle" $posts | safeHTML }}
{{- T "SymbolComma" }}
{{- T "PostArchiveKeepOn" }}
{{ T (printf "PostArchive.cheers.%s" $cheers) }}
{{ T "Symbol.comma" }}
{{ T "Terms.archives" $posts | safeHTML }}
{{ T "Symbol.comma" }}
{{ T "PostArchive.keepOn" }}
</span>
</div>
@ -32,5 +32,5 @@
</div>
</div>
{{- partial "pagination.html" . }}
{{- end }}
{{ partial "pagination.html" . }}
{{ end }}

View File

@ -1,6 +1,6 @@
{{- define "title" }}{{- .Title }} - {{ .Site.Title -}}{{- end }}
{{ define "title" }}{{ .Title }} - {{ .Site.Title }}{{ end }}
{{- define "main_inner_class" }}flinks posts-expand{{- end }}
{{ define "main_inner_class" }}flinks posts-expand{{ end }}
{{ define "main" }}

View File

@ -1,11 +1,11 @@
{{- define "main_inner_class" }}index posts-expand{{- end }}
{{ define "main_inner_class" }}index posts-expand{{ end }}
{{- define "main" }}
{{ define "main" }}
{{ $paginator := .Paginate (where .Site.RegularPages "Section" "in" .Site.Params.mainSections) }}
{{- range $paginator.Pages }}
{{ range $paginator.Pages }}
{{ partial "post.html" (dict "ctx" . "IsHome" true) }}
{{- end }}
{{ end }}
{{- partial "partials/pagination.html" . }}
{{- end }}
{{ partial "partials/pagination.html" . }}
{{ end }}

View File

@ -6,15 +6,15 @@
{{ with .res.alias2 }}
{{ $npm = . }}
{{ end }}
{{- $file := .res.file }}
{{ $file := .res.file }}
{{- if ne .vendor "unpkg" }}
{{- with .res.alias }}
{{- $npm = . }}
{{- end }}
{{- $file = replaceRE `(dist|lib|source\/js)\/` "" .res.file }}
{{- $fmt = "%s/%s/%s/%s" }}
{{- end }}
{{ if ne .vendor "unpkg" }}
{{ with .res.alias }}
{{ $npm = . }}
{{ end }}
{{ $file = replaceRE `(dist|lib|source\/js)\/` "" .res.file }}
{{ $fmt = "%s/%s/%s/%s" }}
{{ end }}
{{ $pluginRes := printf $fmt .router $npm .res.version $file }}

View File

@ -4,7 +4,7 @@
</span>
<div class="search-input-container">
<input autocomplete="off" autocapitalize="off" maxlength="80"
placeholder="{{ T "SearchPh" }}" spellcheck="false"
placeholder="{{ T "Search.placeholder" }}" spellcheck="false"
type="search" class="search-input">
</div>
<span class="popup-btn-close" role="button">

View File

@ -1,3 +1,3 @@
{{- if isset .Site.Params "addthisid" }}
{{ if isset .Site.Params "addthisid" }}
<div class="addthis_inline_share_toolbox" style="text-align: center;"></div>
{{- end }}
{{ end }}

View File

@ -1,42 +1,42 @@
{{- $root := . -}}
{{- with .Site.Params.comments }}
{{- $tc := and .storage (gt (len .nav) 1) }}
{{- $active := .active }}
{{- $fc := .active }}
{{- $sc := "" }}
{{- $sn := "" }}
{{ $root := . }}
{{ with .Site.Params.comments }}
{{ $tc := and .storage (gt (len .nav) 1) }}
{{ $active := .active }}
{{ $fc := .active }}
{{ $sc := "" }}
{{ $sn := "" }}
<div id="comments" class="post-comments">
<div class="comment-head">
<div class="comment-headline">
<i class="fas fa-comments fa-fw"></i>
<span>{{ T "PostCommentTitle" }}</span>
<span>{{ T "PostComments.title" }}</span>
</div>
{{- if $tc }}
{{- $sn = (sort .nav "weight") }}
{{- $fc = index $sn 0 }}
{{- $sc = index $sn 1 }}
{{ if $tc }}
{{ $sn = (sort .nav "weight") }}
{{ $fc = index $sn 0 }}
{{ $sc = index $sn 1 }}
<div class="comment-switch">
<span class="first-comment">{{ $fc.title }}</span>
<span class="switch-btn {{ if eq .active (lower $sc.name) }}move{{ end }}"></span>
<span class="second-comment">{{ $sc.title }}</span>
</div>
{{- end }}
{{ end }}
</div>
<div class="comment-wrap">
{{ $cp := "_thirdparty/comment/%s.html" }}
{{- if $tc }}
{{- range $sn }}
{{ if $tc }}
{{ range $sn }}
<div>
{{- partial "_thirdparty/comment/comm_loading.html" . }}
{{- partial (printf $cp (lower .name)) $root }}
{{ partial "_thirdparty/comment/comm_loading.html" . }}
{{ partial (printf $cp (lower .name)) $root }}
</div>
{{- end }}
{{- else }}
{{ end }}
{{ else }}
<div>
{{- partial "_thirdparty/comment/comm_loading.html" . }}
{{- partial (printf $cp $fc) $root }}
{{ partial "_thirdparty/comment/comm_loading.html" . }}
{{ partial (printf $cp $fc) $root }}
</div>
{{- end }}
{{ end }}
</div>
</div>
{{- end }}
{{ end }}

View File

@ -1,4 +1,4 @@
{{- $ft := .Site.Params.footer }}
{{ $ft := .Site.Params.footer }}
{{ if $ft.translate }}
<div id="gtranslate" class="google-translate">
<i class="fa fa-language"></i>
@ -8,55 +8,55 @@
<div class="copyright">
&copy;
<span itemprop="copyrightYear">
{{- $year := now.Year }}
{{- if isset $ft "since" }}
{{- if gt $year $ft.since }}
{{ $year := now.Year }}
{{ if isset $ft "since" }}
{{ if gt $year $ft.since }}
{{ $ft.since }} - {{ $year }}
{{- else }}
{{ else }}
{{ $year }}
{{- end }}
{{- else }}
{{ end }}
{{ else }}
{{ $year }}
{{- end }}
{{ end }}
</span>
<span class="with-love">
<i class="{{ $ft.icon.name }}"></i>
</span>
<span class="author" itemprop="copyrightHolder">{{ $ft.copyright | default .Site.Params.author }}</span>
</div>
{{- if $ft.powered }}
{{ if $ft.powered }}
<div class="powered-by">
{{ $pb := printf "<a href='https://gohugo.io' title='%s' target='_blank'>Hugo</a> &amp; <a href='https://github.com/hugo-next/hugo-theme-next' title='%s' target='_blank'>Hugo NexT.%s</a>" hugo.Version .Site.Data.config.version .Site.Params.scheme }}
{{- printf (T "FooterPowerby") $pb | safeHTML }}
{{ printf (T "Footer.powerby") $pb | safeHTML }}
</div>
{{- end }}
{{- with $ft.beian }}
{{- if .enable }}
{{ end }}
{{ with $ft.beian }}
{{ if .enable }}
<div class="beian">
<a href="https://beian.miit.gov.cn" target="_blank">{{ .icp }}</a>
<img src="/imgs/gongan.png" alt="{{ .provinceAbbr }}公网安备">
<a href="http://www.beian.gov.cn/portal/registerSystemInfo?recordcode={{ .gonganNum }}" target="_blank">{{ .provinceAbbr }}公网安备 {{ .gonganNum }} 号</a>
</div>
{{- end }}
{{- end }}
{{- with $ft.vendors }}
{{ end }}
{{ end }}
{{ with $ft.vendors }}
{{ if .enable }}
<div class="vendors-list">
{{- range .list }}
{{ range .list }}
<a target="_blank" href="{{ .link }}" title="{{ .name }}">
{{- if .image }}
{{ if .image }}
<img src="/imgs/img-lazy-loading.gif" data-src="{{ .image.url }}" alt="{{ .name }}" />
{{- else }}
{{ else }}
{{ .name }}
{{- end }}
{{ end }}
</a>
{{- end }}
{{ end }}
<span>{{ .title }}</span>
</div>
{{- end }}
{{- end }}
{{ end }}
{{ end }}
{{- $custom := .Scratch.Get "footer" }}
{{- if $custom }}
{{ $custom := .Scratch.Get "footer" }}
{{ if $custom }}
{{ partialCached $custom . }}
{{- end }}
{{ end }}

View File

@ -1,10 +1,10 @@
{{- partial "head/meta.html" . }}
{{- partial "head/opengraph.html" . }}
{{- partial "head/twitter.html" . }}
{{- partial "head/googleplus.html" . }}
{{- partial "head/facebook.html" . }}
{{- partialCached "head/verify.html" . }}
{{- partialCached "head/style.html" . }}
{{ partial "head/meta.html" . }}
{{ partial "head/opengraph.html" . }}
{{ partial "head/twitter.html" . }}
{{ partial "head/googleplus.html" . }}
{{ partial "head/facebook.html" . }}
{{ partial "head/verify.html" . }}
{{ partialCached "head/style.html" . }}
<script type="text/javascript">
(function(){
localDB = {
@ -60,6 +60,6 @@
theme.active();
})(window);
</script>
{{- partial "head/config.html" . }}
{{- partialCached "head/analytics.html" . }}
{{ partial "head/config.html" . }}
{{ partialCached "head/analytics.html" . }}

View File

@ -1,12 +1,12 @@
{{- if isset .Site.Params.analytics "laid" }}
{{ if isset .Site.Params.analytics "laid" }}
{{ partial "_thirdparty/analytics/51la.html" . }}
{{- end }}
{{- if isset .Site.Params.analytics "baidu" }}
{{ end }}
{{ if isset .Site.Params.analytics "baidu" }}
{{ partial "_thirdparty/analytics/baidu.html" . }}
{{- end }}
{{- if isset .Site.Params.analytics "google" }}
{{ end }}
{{ if isset .Site.Params.analytics "google" }}
{{ partial "_thirdparty/analytics/google.html" . }}
{{- end }}
{{- if isset .Site.Params.analytics "busuanzi" }}
{{ end }}
{{ if or (isset .Site.Params.analytics "busuanzi") (eq .Site.Params.postMeta.views.plugin "busuanzi") }}
{{ partial "_thirdparty/analytics/busuanzi.html" . }}
{{- end }}
{{ end }}

View File

@ -1,14 +1,14 @@
{{- $pageCfg := dict
{{ $pageCfg := dict
"isHome" .IsHome
"isPage" .IsPage
"comments" (.Scratch.Get "isComment")
"permalink" (.Page.Permalink | absURL)
"path" (.Page.Permalink | path.Base)
"title" .Page.Title
-}}
}}
{{/* Append waline pageview & comment plugin */}}
{{ if and .Site.Params.waline ( or .Site.Params.waline.pageView .Site.Params.waline.comment) }}
{{ if or (eq .Site.Params.postMeta.views.plugin "waline") (eq .Site.Params.postMeta.comments.plugin "waline") }}
{{ $counter := dict
"js" .Site.Data.resources.plugins.waline.js
}}
@ -37,4 +37,4 @@
{{ $pageCfg = merge $pageCfg (dict "math" $math) }}
{{ end }}
<script class="next-config" data-name="page" type="application/json">{{- $pageCfg -}}</script>
<script class="next-config" data-name="page" type="application/json">{{ $pageCfg }}</script>

View File

@ -1,5 +1,5 @@
{{- with .Site.Params.openGraph.facebook }}
{{- range $attr, $val := . }}
{{ with .Site.Params.openGraph.facebook }}
{{ range $attr, $val := . }}
<meta property="fb:{{ $attr }}" content="{{ $val }}">
{{- end }}
{{- end }}
{{ end }}
{{ end }}

View File

@ -1,9 +1,9 @@
<!-- Website icons -->
{{- with .Site.Params.favicon }}
{{ with .Site.Params.favicon }}
<link rel="shortcut icon" type="image/x-icon" href="{{ .icon }}">
<link rel="icon" type="image/x-icon" href="{{ .icon }}">
<link rel="icon" type="image/png" sizes="16x16" href="{{ .small }}">
<link rel="icon" type="image/png" sizes="32x32" href="{{ .medium }}">
<link rel="apple-touch-icon" sizes="180x180" href="{{ .appleTouchIcon }}">
{{- end }}
{{ end }}
<!-- Website icons -->

View File

@ -1,3 +1,3 @@
{{- with .Site.Params.openGraph.googlePlus }}
{{ with .Site.Params.openGraph.googlePlus }}
<link rel="publisher" href=" {{ . }}">
{{- end }}
{{ end }}

View File

@ -1,10 +1,10 @@
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width">
{{- if .Site.Params.darkmode }}
{{ if .Site.Params.darkmode }}
<meta name="theme-color" content="{{ .Site.Params.themeColor.dark }}" media="(prefers-color-scheme: dark)" />
{{- else }}
{{ else }}
<meta name="theme-color" content="{{ .Site.Params.themeColor.light }}" media="(prefers-color-scheme: light)" />
{{- end }}
{{ end }}
{{ hugo.Generator }}
<link rel="shortcut icon" type="image/x-icon" href="{{ .Site.Params.favicon.icon }}">
<link rel="icon" type="image/x-icon" href="{{ .Site.Params.favicon.icon }}">
@ -13,18 +13,18 @@
<link rel="apple-touch-icon" sizes="180x180" href="{{ .Site.Params.favicon.appleTouchIcon }}">
<meta itemprop="name" content="{{ .Title }}" />
<meta itemprop="description" content="{{ .Description | default .Site.Params.description }}" />
{{- if .IsPage }}
{{- with .Date }}
{{ if .IsPage }}
{{ with .Date }}
<meta itemprop="datePublished" {{ . }} />
{{- end }}
{{- with .Lastmod }}
{{ end }}
{{ with .Lastmod }}
<meta itemprop="dateModified" {{ . }} />
{{- end }}
{{- end }}
{{- $img := .Site.Params.customLogo | default .Site.Params.avatar.url }}
{{- if and .IsPage (isset .Params "images") }}
{{- $img := index .Params.images 0 }}
{{- end }}
{{- .Scratch.Set "metaImg" $img }}
{{ end }}
{{ end }}
{{ $img := .Site.Params.customLogo | default .Site.Params.avatar.url }}
{{ if and .IsPage (isset .Params "images") }}
{{ $img := index .Params.images 0 }}
{{ end }}
{{ .Scratch.Set "metaImg" $img }}
<meta itemprop="image" content="{{ $img | absURL }}" />
<meta itemprop="keywords" content="{{ if and .IsPage (isset .Params "tags")}}{{ delimit .Params.tags "," }}{{ else }}{{ .Site.Params.keywords }}{{ end }}" />

View File

@ -1,9 +1,9 @@
{{- $Site := .Site -}}
{{- $Params := .Site.Params -}}
{{- $Page := .Page -}}
{{- $langCode := .Scratch.Get "langCode" -}}
{{- with .Site.Params.openGraph -}}
{{- if .enable -}}
{{ $Site := .Site }}
{{ $Params := .Site.Params }}
{{ $Page := .Page }}
{{ $langCode := .Scratch.Get "langCode" }}
{{ with .Site.Params.openGraph }}
{{ if .enable }}
<meta property="og:type" content="website">
<meta property="og:title" content="{{ $Page.Title }}">
<meta property="og:description" content="{{ default $Params.description $Page.Description }}">
@ -12,21 +12,21 @@
<meta property="og:site_name" content="{{ $Site.Title }}">
<meta property="og:locale" content="{{ $langCode }}">
<meta property="article:author" content="{{ default $Params.author $Page.Params.Author }}">
{{- with .twitter -}}
{{- range $attr, $val := . }}
{{ with .twitter }}
{{ range $attr, $val := . }}
<meta name="twitter:{{ $attr }}" content="{{ $val }}">
{{- end -}}
{{- end -}}
{{ end }}
{{ end }}
{{- with .googlePlus }}
{{ with .googlePlus }}
<link rel="publisher" href=" {{ . }}">
{{- end -}}
{{ end }}
{{- with .facebook -}}
{{- range $attr, $val := . }}
{{ with .facebook }}
{{ range $attr, $val := . }}
<meta property="fb:{{ $attr }}" content="{{ $val }}">
{{- end -}}
{{- end -}}
{{ end }}
{{ end }}
{{- end -}}
{{- end -}}
{{ end }}
{{ end }}

View File

@ -1,4 +1,4 @@
{{- if .Site.Params.openGraph.enable }}
{{ if .Site.Params.openGraph.enable }}
<meta property="og:type" content="{{ if .IsPage }}article{{ else }}website{{ end }}" />
<meta property="og:title" content="{{ .Title | default .Site.Title }}" />
<meta property="og:description" content="{{ .Description | default .Site.Params.Description }}" />
@ -9,9 +9,9 @@
<meta property="og:url" content="{{ .Permalink }}"/>
<meta property="og:site_name" content="{{ .Site.Title }}" />
<meta property="og:locale" content="{{ .Site.LanguageCode }}"/>
{{- if .IsPage }}
{{ if .IsPage }}
<meta property="article:author" content="{{ .Params.Author | default .Site.Params.Author }}" />
<meta property="article:published_time" content="{{ .Date }}" />
<meta property="article:modified_time" content="{{ .Lastmod }}" />
{{- end }}
{{- end }}
{{ end }}
{{ end }}

View File

@ -1,31 +1,31 @@
<!-- Plugin style files -->
{{- $cssRes := .Site.Data.resources.css }}
{{- $vendor := .Site.Params.vendors.plugins }}
{{- $router := .Scratch.Get "router" }}
{{ $cssRes := .Site.Data.resources.css }}
{{ $vendor := .Site.Params.vendors.plugins }}
{{ $router := .Scratch.Get "router" }}
{{- range $css := $cssRes }}
{{ range $css := $cssRes }}
{{ $pluginCss := partial "_funs/get_res.html" (dict "res" . "vendor" $vendor "router" $router) }}
<link type="text/css" rel="stylesheet" href="{{ $pluginCss }}" />
{{- end }}
{{ end }}
<!-- Main Style file -->
{{- $scss := resources.Get "css/main.scss" }}
{{- $scss = $scss | resources.ExecuteAsTemplate "main.scss" . }}
{{- $css := $scss | toCSS (dict "targetPath" "/css/main.css" "outputStyle" "expanded") }}
{{- if hugo.IsProduction }}
{{- $css = $css | minify | fingerprint }}
{{- end }}
{{ $scss := resources.Get "css/main.scss" }}
{{ $scss = $scss | resources.ExecuteAsTemplate "main.scss" . }}
{{ $css := $scss | toCSS (dict "targetPath" "/css/main.css" "outputStyle" "expanded") }}
{{ if hugo.IsProduction }}
{{ $css = $css | minify | fingerprint }}
{{ end }}
<link rel="stylesheet" href="{{ $css.RelPermalink }}">
{{- if .IsPage }}
{{ if .IsPage }}
<style type="text/css">
.post-footer, .flinks-list-footer hr:after {
content: "{{ .Site.Params.postFooter.endLineTip }}";
}
</style>
{{- end }}
{{ end }}
{{- $custom := .Scratch.Get "style" }}
{{- if $custom }}
{{ $custom := .Scratch.Get "style" }}
{{ if $custom }}
<link rel="stylesheet" type="text/css" href="{{ $custom }}">
{{- end }}
{{ end }}

View File

@ -1,5 +1,5 @@
{{- with .Site.Params.openGraph.twitter }}
{{- $img := $.Params.openGraph.twitter.image | default ($.Scratch.Get "metaImg") }}
{{ with .Site.Params.openGraph.twitter }}
{{ $img := $.Params.openGraph.twitter.image | default ($.Scratch.Get "metaImg") }}
<meta name="twitter:card" content="summary_large_image"/>
<meta name="twitter:creator" content="{{ .creator }}"/>
<meta name="twitter:description" content="{{ with $.Page.Description }}{{ . }}{{ else }}{{if $.Page.IsPage}}{{ .Summary }}{{ else }}{{ $.Params.description }}{{ end }}{{ end }}"/>

View File

@ -1,14 +1,14 @@
{{ if .IsHome }}
{{- with .Site.Params.googleSiteVerification }}
{{ with .Site.Params.googleSiteVerification }}
<meta name="google-site-verification" content="{{ . }}">
{{- end }}
{{- with .Site.Params.bingSiteVerification }}
{{ end }}
{{ with .Site.Params.bingSiteVerification }}
<meta name="msvalidate.01" content="{{ . }}">
{{- end }}
{{- with .Site.Params.yandexSiteVerification }}
{{ end }}
{{ with .Site.Params.yandexSiteVerification }}
<meta name="yandex-verification" content="{{ . }}">
{{- end }}
{{- with .Site.Params.baiduSiteVerification }}
{{ end }}
{{ with .Site.Params.baiduSiteVerification }}
<meta name="baidu-site-verification" content="{{ . }}">
{{- end }}
{{ end }}
{{ end }}

View File

@ -9,9 +9,9 @@
</div>
<div class="site-meta">
{{- if and .Site.Params.customLogo (eq .Site.Params.scheme "Muse") }}
{{ if and .Site.Params.customLogo (eq .Site.Params.scheme "Muse") }}
<img class="custom-logo-image" src="{{ .Site.Params.customLogo }}" alt="{{ $title }}">
{{- end }}
{{ end }}
<a href="{{ "/" | relLangURL }}" class="brand" rel="start">
<i class="logo-line"></i>
@ -20,17 +20,17 @@
</a>
{{ if isset .Site.Params "subtitle" }}
<p class="site-subtitle" itemprop="description">{{ .Site.Params.subtitle }}</p>
{{- end }}
{{- if and .Site.Params.customLogo (or (eq .Site.Params.scheme "Gemini") (eq .Site.Params.scheme "Pisces"))}}
{{ end }}
{{ if and .Site.Params.customLogo (or (eq .Site.Params.scheme "Gemini") (eq .Site.Params.scheme "Pisces"))}}
<img class="custom-logo-image" src="{{ .Site.Params.customLogo }}" alt="{{ $title }}">
{{- end }}
{{ end }}
</div>
<div class="site-nav-right">
<div class="toggle popup-trigger">
{{ if or .Site.Params.algoliaSearch.enable .Site.Params.localSearch.enable }}
<i class="fa fa-search fa-fw fa-lg"></i>
{{- end }}
{{ end }}
</div>
</div>
</div>

View File

@ -1,25 +1,25 @@
{{- $ms := .Site.Params.menuSets }}
{{- $curP := .Page }}
{{ $ms := .Site.Params.menuSets }}
{{ $curP := .Page }}
<nav class="site-nav">
<ul class="main-menu menu">
{{- range .Site.Menus.main }}
{{- $active := $curP.IsMenuCurrent "main" . }}
{{ range .Site.Menus.main }}
{{ $active := $curP.IsMenuCurrent "main" . }}
<li class="menu-item menu-item-{{ .Identifier }}">
<a href="{{ .URL | relLangURL }}" class="hvr-icon-pulse {{if $active }} menu-item-active{{ end }}" rel="section">
{{- if $ms.icons }}<i class="fa fa-{{ .Pre }} hvr-icon"></i>{{ end }}{{- .Name }}
{{- if and $ms.badges (eq .Identifier "archives") }}
{{ if $ms.icons }}<i class="fa fa-{{ .Pre }} hvr-icon"></i>{{ end }}{{ .Name }}
{{ if and $ms.badges (eq .Identifier "archives") }}
<span class="badge">{{ $.Scratch.Get "postsCount" }}</span>
{{- end }}
{{ end }}
</a>
</li>
{{- end }}
{{ end }}
{{- if or .Site.Params.algoliaSearch.enable .Site.Params.localSearch.enable }}
{{ if or .Site.Params.algoliaSearch.enable .Site.Params.localSearch.enable }}
<li class="menu-item menu-item-search">
<a role="button" class="popup-trigger hvr-icon-pulse">
{{- if $ms.icons }}<i class="fa fa-search fa-fw hvr-icon"></i>{{ end }}{{ T "MSearchLabel" }}
{{ if $ms.icons }}<i class="fa fa-search fa-fw hvr-icon"></i>{{ end }}{{ T "Sidebar.label.search" }}
</a>
</li>
{{- end }}
{{ end }}
</ul>
</nav>

View File

@ -1,11 +1,11 @@
{{- if or .Site.Params.algoliaSearch.enable .Site.Params.localSearch.enable }}
{{ if or .Site.Params.algoliaSearch.enable .Site.Params.localSearch.enable }}
<div class="search-pop-overlay">
<div class="popup search-popup">
{{- if .Site.Params.algoliaSearch.enable }}
{{ if .Site.Params.algoliaSearch.enable }}
{{ partial "_thirdparty/search/algolia.html" . }}
{{- else if .Site.Params.localSearch.enable }}
{{ else if .Site.Params.localSearch.enable }}
{{ partial "_thirdparty/search/local.html" . }}
{{- end }}
{{ end }}
</div>
</div>
{{- end }}
{{ end }}

View File

@ -1,82 +0,0 @@
{{- $SP := .Site.Params -}}
<aside class="sidebar">
<div class="sidebar-inner sidebar-overview-active">
<ul class="sidebar-nav">
<li class="sidebar-nav-toc">{{ T "TableOfContents" }}</li>
<li class="sidebar-nav-overview">{{ T "SiteInfo" }}</li>
</ul>
<div class="sidebar-panel-container">
<div class="post-toc-wrap sidebar-panel">
</div>
<div class="site-overview-wrap sidebar-panel">
<div class="site-author site-overview-item animated" itemprop="author" itemscope itemtype="http://schema.org/Person">
<img class="site-author-image" itemprop="image" alt="{{ $SP.author }}" src="{{ $SP.avatar.url }}">
<p class="site-author-name" itemprop="name">{{ $SP.author }}</p>
<div class="site-description" itemprop="description">{{ $SP.description }}</div>
</div>
<div class="site-state-wrap site-overview-item animated">
{{- if $SP.siteState }}
<nav class="site-state">
<div class="site-state-item site-state-posts">
<a href="{{ "/archives/" | relLangURL }}">
<span class="site-state-item-count">{{ len (where .Site.RegularPages "Section" "in" .Site.Params.mainSections) }}</span>
<span class="site-state-item-name">{{ T "SitePostsTitle" }}</span>
</a>
</div>
<div class="site-state-item site-state-categories">
<a href="{{ "/categories/" | relLangURL }}">
<span class="site-state-item-count">{{ len .Site.Taxonomies.categories }}</span>
<span class="site-state-item-name">{{ T "SiteCatesTitle" }}</span>
</a>
</div>
<div class="site-state-item site-state-tags">
<a href="{{ "/tags/" | relLangURL }}">
<span class="site-state-item-count">{{ len .Site.Taxonomies.tags }}</span>
<span class="site-state-item-name">{{ T "SiteTagsTitle" }}</span>
</a>
</div>
</nav>
{{- end }}
<div class="rss-link">
<a href="{{ "/index.xml" | relLangURL }}" rel="alternate" type="application/rss+xml" target="_blank">
<i class="fa fa-rss"></i>
{{ T "RSSTitle" }}
</a>
</div>
</div>
<div class="links-of-social site-overview-item animated">
{{ $si := $SP.socialIcons }}
{{- range $SP.socials }}
{{- range $name,$val := . }}
{{- $vals := split $val "||" }}
{{- $url := trim (index $vals 0) " " }}
{{- $icon := trim (index $vals 1) " " }}
<span class="links-of-social-item">
<a href="{{- $url }}" title="{{- $name }} → {{- $url }}" rel="noopener" {{- if and $si.enable $si.transition }} class="hvr-icon-pulse" {{- end }} target="_blank">
{{- if $si.enable }}
<i class="{{- $icon }} fa-fw {{ if $si.transition }} hvr-icon {{ end }}"></i>
{{- end }}
{{- if or (not $si.enable) (not $si.iconsOnly) }}
{{- $name }}
{{- end }}
</a>
</span>
{{- end }}
{{- end }}
</div>
{{- $cc := $SP.creativeCommons }}
{{- if and $cc $cc.sidebar }}
<div class="cc-license animated" itemprop="license">
<a href="https://creativecommons.org/licenses/by-nc-sa/4.0/deed.{{ substr .Site.Language 0 2 }}" class="cc-opacity" rel="noopener" target="_blank" title="{{ T "CCLinkTitle" }}">
<img src="/imgs/cc/{{ $cc.size }}/{{ replace $cc.license "-" "_" }}.svg" alt="{{ T "CCLinkTitle" }}">
</a>
</div>
{{ end }}
</div>
</div>
<div class="back-to-top" role="button" aria-label="返回顶部">
<i class="fa fa-arrow-up"></i>
<span>0%</span>
</div>
</div>
</aside>

View File

@ -14,7 +14,9 @@
{{ $globalVars := newScratch }}
{{ $globalVars.Set "postsCount" (len (where .Page.Site.RegularPages "Section" "in" .Site.Params.mainSections)) }}
{{ $pages := (where .Page.Site.RegularPages "Section" "in" .Site.Params.mainSections) }}
{{ $globalVars.Set "pages" $pages}}
{{ $globalVars.Set "postsCount" (len $pages)}}
{{ $globalVars.Set "catsCount" (len .Site.Taxonomies.categories) }}
{{ $globalVars.Set "tagsCount" (len .Site.Taxonomies.tags) }}
@ -37,10 +39,10 @@
"lazyload" .Site.Params.lazyload
"motion" .Site.Params.motion
"i18n" (dict
"placeholder" (T "SearchPh")
"empty" (T "SearchEmpty")
"hits_time" (T "SearchHitsTime")
"hits" (T "SearchHits")
"placeholder" (T "Search.placeholder")
"empty" (T "Search.empty")
"hits_time" (T "Search.time")
"hits" (T "Search.hits")
"ds_years" (T "DateSuffix.years")
"ds_days" (T "DateSuffix.days")
"ds_hours" (T "DateSuffix.hours")
@ -58,6 +60,16 @@
{{ $config = merge $config $localSearch }}
{{ end }}
{{ with .Site.Params.postMeta }}
{{ $postmeta := dict
"views" .views
"comments" .comments
}}
{{ $config = merge $config (dict "postmeta" $postmeta) }}
{{ else }}
{{ end }}
{{ if .Site.Params.algoliaSearch.enable }}
{{ $algoliaSearch := dict
"js" .Site.Data.resources.algolia
@ -127,11 +139,6 @@
{{ $config = merge $config (dict "lawidget" $lawidget) }}
{{ end }}
{{ with .Site.Params.analytics.busuanzi }}
{{ $busz := dict "pageview" .postViews }}
{{ $config = merge $config (dict "busuanzi" $busz) }}
{{ end }}
{{ $globalVars.Set "config" $config }}
{{ with .Site.Params.customFilePath }}

View File

@ -12,16 +12,16 @@
</time>
</div>
<div class="post-title">
{{- if isset .Params "extlink" }}
{{ if isset .Params "extlink" }}
<a href="{{ .Params.extlink }}" rel="noopener external nofollow noreferrer" target="_blank" class="exturl post-title-link post-title-link-external" title="">
<span itemprop="name">{{- .Title -}}</span>
<span itemprop="name">{{ .Title }}</span>
<i class="fa fa-external-link-alt"></i>
</a>
{{- else }}
{{ else }}
<a class="post-title-link" href="{{ .RelPermalink | relLangURL }}" itemprop="url">
<span itemprop="name">{{ .Title }}</span>
</a>
{{- end }}
{{ end }}
</div>
</header>
</article>

View File

@ -1,42 +1,42 @@
{{- $pag := .Paginator }}
{{- $tps := $pag.TotalPages }}
{{ $pag := .Paginator }}
{{ $tps := $pag.TotalPages }}
{{- $begin := sub $pag.PageNumber 4}}
{{- $.Scratch.Set "begin" $begin }}
{{- $end := add $pag.PageNumber 4}}
{{- $.Scratch.Set "end" $end }}
{{ $begin := sub $pag.PageNumber 4}}
{{ $.Scratch.Set "begin" $begin }}
{{ $end := add $pag.PageNumber 4}}
{{ $.Scratch.Set "end" $end }}
{{- if lt $begin 0}}
{{- $end := sub $end $begin }}
{{- $.Scratch.Set "end" $end }}
{{- end}}
{{- $end := $.Scratch.Get "end"}}
{{ if lt $begin 0}}
{{ $end := sub $end $begin }}
{{ $.Scratch.Set "end" $end }}
{{ end}}
{{ $end := $.Scratch.Get "end"}}
{{- $over := sub $tps $end }}
{{ $over := sub $tps $end }}
{{- if lt $over 0}}
{{- $begin := add $begin $over}}
{{- $.Scratch.Set "begin" $begin }}
{{- end }}
{{- $begin := $.Scratch.Get "begin"}}
{{ if lt $over 0}}
{{ $begin := add $begin $over}}
{{ $.Scratch.Set "begin" $begin }}
{{ end }}
{{ $begin := $.Scratch.Get "begin"}}
<nav class="pagination">
{{- if $pag.HasPrev }}
<a class="extend prev" rel="prev" href="{{- $pag.Prev.URL }}">
{{ if $pag.HasPrev }}
<a class="extend prev" rel="prev" href="{{ $pag.Prev.URL }}">
<i class="fa fa-angle-left"></i>
</a>
{{- end }}
{{- range $p := $pag.Pagers }}
{{- if and (ge $p.PageNumber $begin) (le $p.PageNumber $end) }}
{{- if eq $p $pag }}
<span class="page-number current">{{- $p.PageNumber }}</span>
{{- else }}
<a class="page-number" href="{{- $p.URL }}">{{- $p.PageNumber }}</a>
{{- end }}
{{- end }}
{{- end }}
{{- if $pag.HasNext }}
<a class="extend next" rel="next" href="{{- $pag.Next.URL }}">
{{ end }}
{{ range $p := $pag.Pagers }}
{{ if and (ge $p.PageNumber $begin) (le $p.PageNumber $end) }}
{{ if eq $p $pag }}
<span class="page-number current">{{ $p.PageNumber }}</span>
{{ else }}
<a class="page-number" href="{{ $p.URL }}">{{ $p.PageNumber }}</a>
{{ end }}
{{ end }}
{{ end }}
{{ if $pag.HasNext }}
<a class="extend next" rel="next" href="{{ $pag.Next.URL }}">
<i class="fa fa-angle-right"></i>
</a>
{{- end }}
{{ end }}
</nav>

View File

@ -1,6 +1,6 @@
<div class="post-block">
<article itemscope itemtype="http://schema.org/Article" class="post-content" lang="{{ .Site.LauageCode }}">
{{- with .ctx }}
{{ with .ctx }}
<link itemprop="mainEntityOfPage" href="{{ .Permalink }}">
<span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
<meta itemprop="image" content="{{ .Site.Params.avatar.url }}">
@ -14,7 +14,7 @@
<meta itemprop="name" content="{{ .Title }}">
<meta itemprop="description" content="{{ .Description | default .Summary }}">
</span>
{{- end }}
{{ end }}
<header class="post-header">
{{ partial "post/header.html" (dict "ctx" .ctx "IsHome" .IsHome) }}
</header>

View File

@ -1,11 +1,11 @@
{{ with .ctx }}
{{- if $.IsHome }}
{{- if .Params.Expand }}
{{ if $.IsHome }}
{{ if .Params.Expand }}
{{ .Content }}
{{- else }}
{{ else }}
{{ .Summary }}
{{- end }}
{{- else }}
{{ end }}
{{ else }}
{{ .Content }}
{{- end }}
{{ end }}
{{ end }}

View File

@ -1,44 +1,44 @@
{{ with .ctx }}
{{- if $.IsHome }}
{{- if and .Site.Params.readMoreBtn (not .Params.Expand) }}
{{ if $.IsHome }}
{{ if and .Site.Params.readMoreBtn (not .Params.Expand) }}
<div class="post-button">
<a class="btn" href="{{ .RelPermalink | relLangURL }}#more" rel="contents">
{{ T "PostReadMore" }} &raquo;
{{ T "PostMeta.more" }} &raquo;
</a>
</div>
{{- end }}
{{ end }}
<div class="post-eof"></div>
{{- else }}
{{ else }}
{{ partial "post/footer_meta/tags.html" . }}
{{- if and (not (isset .Params "share")) (not .Params.share) }}
{{ if and (not (isset .Params "share")) (not .Params.share) }}
{{ partial "_thirdparty/share/addthis.html" . }}
{{- end }}
{{ end }}
<hr/>
{{ partial "post/footer_meta/reward.html" . }}
{{- if and (not (isset .Params "copyright")) (not .Params.copyright) }}
{{ if and (not (isset .Params "copyright")) (not .Params.copyright) }}
{{ partial "post/footer_meta/copyright.html" . }}
{{- end }}
{{- if and (not (isset .Params "followme")) (not .Params.followme) }}
{{ end }}
{{ if and (not (isset .Params "followme")) (not .Params.followme) }}
{{ partial "post/footer_meta/followme.html" . }}
{{- end }}
{{- if and (not (isset .Params "nav")) (not .Params.nav) }}
{{ end }}
{{ if and (not (isset .Params "nav")) (not .Params.nav) }}
<div class="post-nav">
<div class="post-nav-next post-nav-item">
{{- with .NextInSection }}
{{ with .NextInSection }}
<a href="{{ .RelPermalink | relLangURL }}" rel="next" title="{{ .Title }}">
<i class="fa fa-chevron-left"></i> {{ .Title }}
</a>
{{- end }}
{{ end }}
</div>
<div class="post-nav-prev post-nav-item">
{{- with .PrevInSection }}
{{ with .PrevInSection }}
<a href="{{ .RelPermalink | relLangURL }}" rel="prev" title="{{ .Title }}">
{{ .Title }}
<i class="fa fa-chevron-right"></i>
</a>
{{- end }}
{{ end }}
</div>
</div>
{{- end }}
{{- end }}
{{- end }}
{{ end }}
{{ end }}
{{ end }}

View File

@ -1,35 +1,35 @@
{{- if .Site.Params.creativeCommons.post }}
{{ if .Site.Params.creativeCommons.post }}
<div class="post-copyright">
<img src="/imgs/cc/cc.svg" width="75" height="75" align="right" />
<img src="/imgs/cc/cc.svg" width="75" height="75" align="right" alt="{{ T "Sidebar.label.ccommons" }}"/>
<ul>
<li class="post-copyright-title">
<strong>{{ print (T "PostCRTitle") (T "SymbolColon") }}</strong>
<strong>{{ print (T "PostCopyRight.title") (T "Symbol.colon") }}</strong>
{{ .Title }}
</li>
<li class="post-copyright-author">
{{- if isset .Params "author" }}
<strong>{{ print (T "PostCROriginAuthor") (T "SymbolColon") }} </strong>
{{ .Params.Author }}
{{- else }}
<strong>{{ print (T "PostCRAuthor") (T "SymbolColon") }} </strong>
{{ .Site.Params.author }}
{{- end }}
{{ if isset .Params "author" }}
<strong>{{ print (T "PostCopyRight.origin.author") (T "Symbol.colon") }} </strong>
{{ .Params.Author }}
{{ else }}
<strong>{{ print (T "PostCopyRight.author") (T "Symbol.colon") }} </strong>
{{ .Site.Params.author }}
{{ end }}
</li>
<li class="post-copyright-link">
{{- if isset .Params "link" }}
<strong>{{ print (T "PostCROriginLink") (T "SymbolColon") }} </strong>
<a target="_blank" href="{{ .Params.OriginLink }}" title="{{ .Title }}">{{ .Params.Link }}</a>
{{- else }}
<strong>{{ print (T "PostCRLink") (T "SymbolColon") }}</strong>
<a id="post-cr-link" href="{{ .Permalink | absLangURL }}" title="{{ .Title }}">{{ .Permalink | absLangURL }}</a>
{{- end }}
{{ if isset .Params "link" }}
<strong>{{ print (T "PostCopyRight.origin.link") (T "Symbol.colon") }} </strong>
<a target="_blank" href="{{ .Params.OriginLink }}" title="{{ .Title }}">{{ .Params.Link }}</a>
{{ else }}
<strong>{{ print (T "PostCopyRight.link") (T "Symbol.colon") }}</strong>
<a id="post-cr-link" href="{{ .Permalink | absLangURL }}" title="{{ .Title }}">{{ .Permalink | absLangURL }}</a>
{{ end }}
</li>
<li class="post-copyright-license">
<strong>{{ print (T "PostCRLicenseTitle") (T "SymbolColon") }} </strong>
{{- $ccText := .Site.Params.creativeCommons.license | upper }}
{{- $ccLink := printf "<a target='_blank' href='https://creativecommons.org/licenses/by-nc-sa/4.0/deed.%s'>%s</a>" (substr .Site.LanguageCode 0 2) $ccText }}
{{ printf (T "PostCRLicenseContent") $ccLink | safeHTML }}
<strong>{{ print (T "PostCopyRight.license.title") (T "Symbol.colon") }} </strong>
{{ $ccText := .Site.Params.creativeCommons.license | upper }}
{{ $ccLink := printf "<a target='_blank' href='https://creativecommons.org/licenses/by-nc-sa/4.0/deed.%s'>%s</a>" (substr .Site.LanguageCode 0 2) $ccText }}
{{ printf (T "PostCopyRight.license.content") $ccLink | safeHTML }}
</li>
</ul>
</div>
{{- end }}
{{ end }}

View File

@ -1,12 +1,12 @@
{{- with .Site.Params.followMe }}
{{ with .Site.Params.followMe }}
<div class="followme">
<span>{{ T "PostFollowMe" }}</span>
<div class="social-list">
{{ range . }}
{{- $vals := split . "||" }}
{{- $name := trim (index $vals 0) " " }}
{{- $url := trim (index $vals 1) " " }}
{{- $icon := trim (index $vals 2) " " }}
{{ $vals := split . "||" }}
{{ $name := trim (index $vals 0) " " }}
{{ $url := trim (index $vals 1) " " }}
{{ $icon := trim (index $vals 2) " " }}
<div class="social-item">
<a target="_blank" class="social-link" href="{{ $url }}">
<span class="icon">
@ -15,7 +15,7 @@
<span class="label">{{ $name }}</span>
</a>
</div>
{{- end }}
{{ end }}
</div>
</div>
{{- end }}
{{ end }}

View File

@ -1,21 +1,19 @@
{{- with .Site.Params.rewardSets }}
{{- if .enable }}
{{ with .Site.Params.rewardSets }}
{{ if .enable }}
<div class="reward-container">
<div>{{- .comment | safeHTML -}}</div>
<div>{{ .comment | safeHTML }}</div>
<button>
{{- T "RewardDonate" -}}
{{ T "Reward.title" }}
</button>
<div class="post-reward">
{{- range $name,$img := .reward }}
{{- $fw := substr $name 0 1 }}
{{- $pay := replace $name $fw ($fw | upper) 1 }}
{{- $payName := T (printf "Reward%s" $pay) }}
<div class="post-reward-item">
<img src="/imgs/img-lazy-loading.gif" data-src="{{ $img }}" alt="{{ $.Site.Params.author }} - {{ $payName }}">
<span>{{ $payName }}</span>
</div>
{{- end }}
{{ range $name,$img := .reward }}
{{ $payName := T (printf "Reward.%s" $name) }}
<div class="post-reward-item">
<img src="/imgs/img-lazy-loading.gif" data-src="{{ $img }}" alt="{{ $.Site.Params.author }} - {{ $payName }}">
<span>{{ $payName }}</span>
</div>
{{ end }}
</div>
</div>
{{- end }}
{{- end }}
{{ end }}
{{ end }}

View File

@ -1,9 +1,9 @@
{{- with .Params.tags }}
{{ with .Params.tags }}
<div class="post-tags">
{{ range . }}
<a href="{{ "/tags/" | relLangURL }}{{ . | urlize | lower }}">
{{ . }}
</a>
{{- end }}
{{ end }}
</div>
{{- end }}
{{ end }}

View File

@ -1,51 +1,49 @@
{{ with .ctx }}
{{- if $.IsHome }} <h2 {{ else }} <h1 {{ end -}} class="post-title" itemprop="name headline">
{{- if and .Weight (gt .Weight 0) }}
<span class="post-sticky-flag" title="{{ T "PostStickyTitle" }}">
{{ if $.IsHome }} <h2 {{ else }} <h1 {{ end }} class="post-title" itemprop="name headline">
{{ if and .Weight (gt .Weight 0) }}
<span class="post-sticky-flag" title="{{ T "PostMeta.sticky" }}">
<i class="fa fa-thumbtack"></i>
</span>
{{- end }}
{{- if $.IsHome }}
{{- if and (isset .Params "extlink") (ne .Params.Extlink "") }}
{{ end }}
{{ if $.IsHome }}
{{ if and (isset .Params "extlink") (ne .Params.Extlink "") }}
<a href="{{ .Params.Extlink }}" rel="noopener external nofollow noreferrer" target="_blank" class="exturl post-title-link post-title-link-external">
{{ .Title }}
<i class="fa fa-external-link-alt"></i>
</a>
{{- else }}
{{ else }}
<a href="{{ .RelPermalink | relLangURL }}" itemprop="url" class="post-title-link">{{ .Title }}</a>
{{- end }}
{{- else }}
{{- .Title }}
{{- if .Site.Params.postEdit.enable }}
{{- $editURL := printf "%s%s" .Site.Params.postEdit.url (path.Clean .File.Path) }}
<a href="{{ $editURL }}" rel="noopener external nofollow noreferrer" target="_blank" class="exturl post-edit-link" title="{{ T "PostEditTitle" }}"><i class="fa fa-pen-nib"></i></a>
{{- end }}
{{- end }}
{{- if $.IsHome }} </h2> {{ else }} </h1> {{ end -}}
{{ $isComment := and (.Scratch.Get "isComment") .Site.Params.waline.comment }}
{{ end }}
{{ else }}
{{ .Title }}
{{ if .Site.Params.postEdit.enable }}
{{ $editURL := printf "%s%s" .Site.Params.postEdit.url (path.Clean .File.Path) }}
<a href="{{ $editURL }}" rel="noopener external nofollow noreferrer" target="_blank" class="exturl post-edit-link" title="{{ T "PostMeta.edit" }}"><i class="fa fa-pen-nib"></i></a>
{{ end }}
{{ end }}
{{ if $.IsHome }} </h2> {{ else }} </h1> {{ end }}
{{ $isComment := and (.Scratch.Get "isComment") .Site.Params.postMeta.comments.enable }}
<div class="post-meta-container">
<div class="post-meta-items">
{{ partial "post/header_meta/created_date.html" . }}
{{ partial "post/header_meta/update_date.html" . }}
{{ partial "post/header_meta/categories.html" . }}
{{ if and $.IsHome (not (isset .Params "extlink")) }}
<div class="post-meta-items">
{{ if .Site.Params.waline.pageView }}
{{ if and .Site.Params.postMeta.views.enable (ne .Site.Params.postMeta.views.plugin "busuanzi") }}
{{ partial "post/header_meta/views.html" . }}
{{ end }}
{{ if $isComment }}
{{ partial "post/header_meta/comments.html" . }}
{{ end }}
</div>
{{ end }}
</div>
{{- if not $.IsHome }}
{{ if not $.IsHome }}
<div class="post-meta-items">
{{ partial "post/header_meta/words.html" . }}
{{ partial "post/header_meta/readtime.html" . }}
{{ partial "post/header_meta/views.html" . }}
{{ if $isComment }}
{{ partial "post/header_meta/comments.html" . }}
{{ partial "post/header_meta/comments.html" . }}
{{ end }}
</div>
{{ end }}

View File

@ -1,17 +1,17 @@
{{- if .Site.Params.postMeta.categories }}
{{- with .Params.categories }}
{{ if .Site.Params.postMeta.categories }}
{{ with .Params.categories }}
<span class="post-meta-item">
<span class="post-meta-item-icon">
<i class="far fa-folder-open"></i>
</span>
<span class="post-meta-item-text">{{- print (T "PostCategory") (T "SymbolColon") -}}</span>
{{- range (first 1 .) }}
<span class="post-meta-item-text" title="{{ T "PostMeta.category" }}">
{{ print (T "PostMeta.category") (T "Symbol.colon") }}
</span>
<span itemprop="about" itemscope itemtype="http://schema.org/Thing">
<a href="{{ "/categories/" | relLangURL }}{{ . | urlize }}" itemprop="url" rel="index">
<span itemprop="name">{{- . -}}</span>
<a href="{{ "/categories/" | relLangURL }}{{ (index (last 1 .) 0) | urlize }}" itemprop="url" rel="index">
<span itemprop="name">{{ delimit . "/" }}</span>
</a>
</span>
{{- end }}
</span>
{{- end }}
{{- end }}
{{ end }}
{{ end }}

View File

@ -2,10 +2,10 @@
<span class="post-meta-item-icon">
<i class="far fa-comments"></i>
</span>
<span class="post-meta-item-text">
{{ print (T "PostComments") (T "SymbolColon") }}
<span class="post-meta-item-text" title="{{ T "PostMeta.comments" }}">
{{ print (T "PostMeta.comments") (T "Symbol.colon") }}
</span>
<span {{ with .Site.Params.waline.comment }}class="waline-comment-count"{{end}} data-path="{{ .RelPermalink | relLangURL }}">
<span id="comments-count" {{ if eq .Site.Params.postMeta.comments.plugin "waline" }}class="waline-comment-count"{{end}} data-path="{{ .RelPermalink | relLangURL }}">
<i class="fa fa-sync fa-spin"></i>
</span>
</span>

View File

@ -1,13 +1,15 @@
{{- if .Site.Params.postMeta.created }}
{{ if .Site.Params.postMeta.created }}
{{ $timeF := .Site.Params.timeFormat }}
{{ $createdTime := (.Date.Format $timeF) | default (.Date.Format $timeF) }}
<span class="post-meta-item">
<span class="post-meta-item-icon">
<i class="far fa-calendar"></i>
</span>
<span class="post-meta-item-text">{{- print (T "PostPublishDate") (T "SymbolColon") -}}</span>
<time title="{{ print (T "PostPublishDate") (T "SymbolColon") }}{{ .Date }}" itemprop="dateCreated datePublished" datetime="{{ .Date }}">
{{- .Date.Format .Site.Params.dateFormat -}}
<span class="post-meta-item-text" title="{{ T "PostMeta.publish.date" }}">
{{ print (T "PostMeta.publish.date") (T "Symbol.colon") }}
</span>
<time title="{{ print (T "PostMeta.publish.time") (T "Symbol.colon") }}{{ .Date }}" itemprop="dateCreated datePublished" datetime="{{ .Date }}">
{{ .Date.Format .Site.Params.dateFormat }}
</time>
</span>
{{- end }}
{{ end }}

View File

@ -1,9 +1,9 @@
{{- if .Site.Params.postMeta.readTime }}
<span class="post-meta-item" title="{{ T "PostReading" }}">
{{ if .Site.Params.postMeta.readTime }}
<span class="post-meta-item" title="{{ T "PostMeta.reading.title" }}">
<span class="post-meta-item-icon">
<i class="far fa-clock"></i>
</span>
<span class="post-meta-item-text">{{- print (T "PostReading") (T "SymbolColon") -}}&asymp;</span>
<span>{{- T "PostReadTime" . -}}</span>
<span class="post-meta-item-text">{{ print (T "PostMeta.reading.title") (T "Symbol.colon") }}&asymp;</span>
<span>{{ T "PostMeta.reading.time" . }}</span>
</span>
{{- end }}
{{ end }}

View File

@ -1,12 +1,14 @@
{{- if and .Site.Params.postMeta.updated.enable .Site.Params.postMeta.updated.anotherDay }}
{{- if and .Lastmod (gt .Lastmod .Date) }}
{{ if and .Site.Params.postMeta.updated.enable .Site.Params.postMeta.updated.anotherDay }}
{{ if and .Lastmod (gt .Lastmod .Date) }}
{{ $modTime := .Lastmod.Format .Site.Params.timeFormat }}
<span class="post-meta-item">
<span class="post-meta-item-icon">
<i class="far fa-calendar-check"></i>
</span>
<span class="post-meta-item-text">{{- print (T "PostLastModDate") (T "SymbolColon") -}}</span>
<time title="{{ print (T "PostLastModTime") (T "SymbolColon") }}{{ $modTime }}" itemprop="dateModified" datetime="{{ $modTime }}">{{- .Lastmod.Format .Site.Params.dateFormat -}}</time>
<span class="post-meta-item-text" title="{{ T "PostMeta.lastmod.date" }}">
{{ print (T "PostMeta.lastmod.date") (T "Symbol.colon") }}
</span>
<time title="{{ print (T "PostMeta.lastmod.time") (T "Symbol.colon") }}{{ $modTime }}" itemprop="dateModified" datetime="{{ $modTime }}">{{ .Lastmod.Format .Site.Params.dateFormat }}</time>
</span>
{{- end }}
{{- end }}
{{ end }}
{{ end }}

View File

@ -1,18 +1,19 @@
{{- $pageViewId := "" }}
{{- if .Site.Params.leancloudVisitors.enable }}
{{- $pageViewId = "leancloud-visitors-count" }}
{{- end }}
{{- if .Site.Params.analytics.busuanzi.postViews }}
{{- $pageViewId = "busuanzi_value_page_pv" }}
{{- end }}
<span class="post-meta-item" title="{{ T "PostViews" }}">
{{ if .Site.Params.postMeta.views.enable }}
{{ $pageViewId := "" }}
{{ if eq .Site.Params.postMeta.views.plugin "leancloud" }}
{{ $pageViewId = "leancloud-visitors-count" }}
{{ else if eq .Site.Params.postMeta.views.plugin "busuanzi" }}
{{ $pageViewId = "busuanzi_value_page_pv" }}
{{ end }}
<span class="post-meta-item" title="{{ T "PostMeta.views" }}">
<span class="post-meta-item-icon">
<i class="far fa-eye"></i>
</span>
<span class="post-meta-item-text">
{{ print (T "PostViews") (T "SymbolColon") }}
{{ print (T "PostMeta.views") (T "Symbol.colon") }}
</span>
<span {{ with $pageViewId }}id="{{ . }}"{{end}} {{ with .Site.Params.waline.pageView }}class="waline-pageview-count"{{end}} data-path="{{ .RelPermalink | relLangURL }}">
<span {{ with $pageViewId }}id="{{ . }}"{{end}} {{ if eq .Site.Params.postMeta.views.plugin "waline" }}class="waline-pageview-count"{{end}} data-path="{{ .RelPermalink | relLangURL }}">
<i class="fa fa-sync fa-spin"></i>
</span>
</span>
{{ end }}

View File

@ -1,8 +1,9 @@
{{- if .Site.Params.postMeta.wordCount }}
<span class="post-meta-item" title="{{ T "PostWords" }}">
{{ if .Site.Params.postMeta.wordCount }}
<span class="post-meta-item" title="{{ T "PostMeta.words.title" }}">
<span class="post-meta-item-icon">
<i class="far fa-file-word"></i>
</span>
<span class="post-meta-item-text">{{- print (T "PostWords") (T "SymbolColon") -}}</span><span>{{- T "PostWordCount" . -}}</span>
<span class="post-meta-item-text">{{ print (T "PostMeta.words.title") (T "Symbol.colon") }}</span>
<span>{{ T "PostMeta.words.count" . }}</span>
</span>
{{- end }}
{{ end }}

View File

@ -1,2 +1,2 @@
{{- partialCached "scripts/global.html" . -}}
{{- partial "scripts/plugins.html" . -}}
{{ partialCached "scripts/global.html" . }}
{{ partial "scripts/plugins.html" . }}

View File

@ -7,7 +7,7 @@
<script type="text/javascript" src="{{ $pluginJS }}" defer></script>
{{ end }}
<script class="next-config" data-name="main" type="application/json">{{ .Scratch.Get "config" -}}</script>
<script class="next-config" data-name="main" type="application/json">{{ .Scratch.Get "config" }}</script>
{{/* Core scripts */}}
{{ $config := resources.Get "js/config.js" }}
@ -49,7 +49,7 @@
{{ if isset .Site.Params "waline" }}
{{ $walinejs := resources.Get "js/third-party/comments/waline.js" }}
{{ $nextjs = $nextjs | append $walinejs }}
{{ if or .Site.Params.waline.pageView .Site.Params.waline.comment }}
{{ if or .Site.Params.postMeta.views.enable .Site.Params.postMeta.comments.enable }}
{{ $counterjs := resources.Get "js/third-party/others/counter.js" }}
{{ $nextjs = $nextjs | append $counterjs }}
{{ end }}

View File

@ -3,16 +3,15 @@
<span class="toggle-line"></span>
<span class="toggle-line"></span>
</div>
{{ $tocEnable := and .IsPage .Params.toc | default .Site.Params.toc.enable }}
<aside class="sidebar">
{{ $tocEnable := and .IsPage .Params.toc | default .Site.Params.toc.enable }}
<div class="sidebar-inner {{ if $tocEnable }}sidebar-nav-active sidebar-toc-active{{ else }}sidebar-overview-active{{ end }}">
<ul class="sidebar-nav">
<li class="sidebar-nav-toc">
{{ T "TableOfContents" }}
{{ T "Sidebar.label.toc" }}
</li>
<li class="sidebar-nav-overview">
{{ T "SiteOverview" }}
{{ T "Sidebar.label.overview" }}
</li>
</ul>
<div class="sidebar-panel-container">
@ -22,28 +21,27 @@
</div>
<!--/noindex-->
<div class="site-overview-wrap sidebar-panel">
{{- partialCached "sidebar/overview.html" . -}}
{{ partialCached "sidebar/overview.html" . }}
{{- $custom := .Scratch.Get "sidebar" }}
{{- if $custom }}
{{ $custom := .Scratch.Get "sidebar" }}
{{ if $custom }}
{{ partialCached $custom . }}
{{- end }}
{{ end }}
</div>
</div>
</div>
{{- if .Site.Params.siteState.statistic.enable }}
{{- partial "sidebar/siteinfo.html" . }}
{{- end }}
{{ if .Site.Params.siteState.views.enable }}
{{ partialCached "sidebar/siteinfo.html" . }}
{{ end }}
{{- if and .Site.Params.backTop.enable .Site.Params.backTop.sidebar }}
{{ if and .Site.Params.backTop.enable .Site.Params.backTop.sidebar }}
<div class="sidebar-card-widget back-to-top-card">
<div class="back-to-top animated" role="button" aria-label="{{ T "BackTop" }}">
<i class="fa fa-arrow-up"></i>
<span>0%</span>
</div>
</div>
{{- end }}
{{ end }}
</aside>
<div class="sidebar-dimmer"></div>

View File

@ -1,92 +1,92 @@
{{- $author := .Site.Params.author }}
{{ $author := .Site.Params.author }}
<div class="site-author site-overview-item animated" itemprop="author" itemscope itemtype="http://schema.org/Person">
{{- with .Site.Params.avatar.url }}
{{ with .Site.Params.avatar.url }}
<img class="site-author-image" itemprop="image" alt="{{ $author }}"
src="/imgs/img-lazy-loading.gif" data-src="{{ . }}">
{{- end }}
{{ end }}
<p class="site-author-name" itemprop="name">{{ $author }}</p>
<div class="site-description" itemprop="description">{{ .Site.Params.description }}</div>
</div>
{{- if .Site.Params.siteState.basic }}
{{ if .Site.Params.siteState.basic }}
<div class="site-state-wrap site-overview-item animated">
<nav class="site-state">
<div class="site-state-item site-state-posts">
<a href="{{ "/archives/" | relLangURL }}">
<span class="site-state-item-count">{{ .Scratch.Get "postsCount" }}</span>
<span class="site-state-item-name">{{ T "SbPostsLable" }}</span>
<span class="site-state-item-name">{{ T "Sidebar.label.posts" }}</span>
</a>
</div>
<div class="site-state-item site-state-categories">
<a href="{{ "/categories/" | relLangURL }}">
<span class="site-state-item-count">{{ .Scratch.Get "catsCount" }}</span>
<span class="site-state-item-name">{{ T "SbCatesTitle" }}</span>
<span class="site-state-item-name">{{ T "Sidebar.label.categories" }}</span>
</a>
</div>
<div class="site-state-item site-state-tags">
<a href="{{ "/tags/" | relLangURL }}">
<span class="site-state-item-count">{{ .Scratch.Get "tagsCount" }}</span>
<span class="site-state-item-name">{{ T "SbTagsTitle" }}</span>
<span class="site-state-item-name">{{ T "Sidebar.label.tags" }}</span>
</a>
</div>
</nav>
</div>
{{- end }}
{{- if and .Site.Params.chat.enable (or (or .Site.Params.chatra.enable .Site.Params.tidio.enable) .Site.Params.gitter.enable) }}
{{ end }}
{{ if and .Site.Params.chat.enable (or (or .Site.Params.chatra.enable .Site.Params.tidio.enable) .Site.Params.gitter.enable) }}
<div class="sidebar-button site-overview-item animated">
<button {{ if .Site.Params.gitter.enable }} class="js-gitter-toggle-chat-button" {{ end }}>
{{- if .Site.Params.chat.icon }}<i class="{{ .Site.Params.chat.icon }}"></i>{{ end }}
{{ if .Site.Params.chat.icon }}<i class="{{ .Site.Params.chat.icon }}"></i>{{ end }}
{{ .Site.Params.chat.text }}
</button>
</div>
{{- end }}
{{ end }}
<div class="links-of-social site-overview-item animated">
{{ $si := .Site.Params.socialIcons }}
{{ range $key,$val := .Site.Params.socials }}
{{- $vals := split $val "||" }}
{{- $name := trim (index $vals 0) " " }}
{{- $url := trim (index $vals 1) " " }}
{{- $icon := trim (index $vals 2) " " }}
{{ $vals := split $val "||" }}
{{ $name := trim (index $vals 0) " " }}
{{ $url := trim (index $vals 1) " " }}
{{ $icon := trim (index $vals 2) " " }}
<span class="links-of-social-item">
<a href="{{ $url }}" title="{{ $name }} → {{ $url }}" rel="noopener" {{- if and $si.enable $si.transition }} class="hvr-icon-pulse" {{- end }} target="_blank">
{{- if $si.enable }}
<i class="{{- $icon }} fa-fw {{ if $si.transition }} hvr-icon {{ end }}"></i>
{{- end }}
{{- if or (not $si.enable) (not $si.iconsOnly) }}
{{- $name }}
{{- end }}
<a href="{{ $url }}" title="{{ $name }} → {{ $url }}" rel="noopener" {{ if and $si.enable $si.transition }} class="hvr-icon-pulse" {{ end }} target="_blank">
{{ if $si.enable }}
<i class="{{ $icon }} fa-fw {{ if $si.transition }} hvr-icon {{ end }}"></i>
{{ end }}
{{ if or (not $si.enable) (not $si.iconsOnly) }}
{{ $name }}
{{ end }}
</a>
</span>
{{- end }}
{{ end }}
</div>
{{- with .Site.Params.creativeCommons }}
{{- if .sidebar }}
{{ with .Site.Params.creativeCommons }}
{{ if .sidebar }}
<div class="cc-license animated" itemprop="license">
<a href="https://creativecommons.org/licenses/by-nc-sa/4.0/deed.{{ substr $.Site.LanguageCode 0 2 }}" class="cc-opacity" rel="noopener" target="_blank" title="{{ T "CCLinkTitle" }}">
<img src="/imgs/img-lazy-loading.gif" data-src="/imgs/cc/{{ .size }}/{{ replace .license "-" "_" }}.svg" alt="{{ T "CCLinkTitle" }}">
<a href="https://creativecommons.org/licenses/by-nc-sa/4.0/deed.{{ substr $.Site.LanguageCode 0 2 }}" class="cc-opacity" rel="noopener" target="_blank" title="{{ T "Sidebar.label.ccommons" }}">
<img src="/imgs/img-lazy-loading.gif" data-src="/imgs/cc/{{ .size }}/{{ replace .license "-" "_" }}.svg" alt="{{ T "Sidebar.label.ccommons" }}">
</a>
</div>
{{- end }}
{{- end }}
{{ end }}
{{ end }}
{{- if .Site.Params.links }}
{{ if .Site.Params.links }}
<div class="links-of-blogroll site-overview-item animated">
<div class="links-of-blogroll-title">
{{- if .Site.Params.linksSets.icon }}
{{ if .Site.Params.linksSets.icon }}
<i class="{{ .Site.Params.linksSets.icon }} fa-fw"></i>
{{- end }}
{{- .Site.Params.linksSets.title }}
{{ end }}
{{ .Site.Params.linksSets.title }}
</div>
<ul class="links-of-blogroll-list">
{{- range $key,$val := .Site.Params.links }}
{{- $vals := split $val "||" }}
{{- $name := trim (index $vals 0) " " }}
{{- $url := trim (index $vals 1) " " }}
{{ range $key,$val := .Site.Params.links }}
{{ $vals := split $val "||" }}
{{ $name := trim (index $vals 0) " " }}
{{ $url := trim (index $vals 1) " " }}
<li class="links-of-blogroll-item">
<a href="{{ $url }}" title="{{ $url }}" target="_blank">{{ $name }}</a>
</li>
{{- end }}
{{ end }}
</ul>
</div>
{{- end }}
{{ end }}

View File

@ -9,23 +9,23 @@
<div class="item-name"><i class="fa-solid fa-calendar-check"></i>{{ T "SiteInfoItems.runTimes" }}</div>
<div class="item-count" id="runTimes" data-publishdate="{{ $scratch.Get "last" }}"></div>
</div>
{{- if eq .Site.Params.siteState.statistic.plugin "busuanzi" }}
{{- with .Site.Params.analytics.busuanzi }}
<div class="siteinfo-item">
<div class="item-name">
<i class="fas {{ .visitorsIcon }}"></i>{{ T "SiteInfoItems.visitors" }}
</div>
<div class="item-count" id="busuanzi_value_site_uv"><i class="fa fa-sync fa-spin"></i></div>
{{ if eq .Site.Params.siteState.views.plugin "busuanzi" }}
{{ with .Site.Params.analytics.busuanzi }}
<div class="siteinfo-item">
<div class="item-name">
<i class="fas {{ .visitorsIcon }}"></i>{{ T "SiteInfoItems.visitors" }}
</div>
<div class="siteinfo-item">
<div class="item-name">
<i class="fas {{ .viewsIcon }}"></i>{{ T "SiteInfoItems.pageViews" }}
</div>
<div class="item-count" id="busuanzi_value_site_pv"><i class="fa fa-sync fa-spin"></i></div>
<div class="item-count" id="busuanzi_value_site_uv"><i class="fa fa-sync fa-spin"></i></div>
</div>
<div class="siteinfo-item">
<div class="item-name">
<i class="fas {{ .viewsIcon }}"></i>{{ T "SiteInfoItems.pageViews" }}
</div>
{{- end }}
{{- end }}
{{- if eq .Site.Params.siteState.statistic.plugin "51la" }}
<div class="item-count" id="busuanzi_value_site_pv"><i class="fa fa-sync fa-spin"></i></div>
</div>
{{ end }}
{{ end }}
{{ if eq .Site.Params.siteState.views.plugin "51la" }}
<div id="la-siteinfo-widget" style="display: none;"></div>
<div class="siteinfo-item">
<div class="item-name">
@ -51,7 +51,7 @@
</div>
<div class="item-count" id="total_site_pv"><i class="fa fa-sync fa-spin"></i></div>
</div>
{{- end }}
{{ end }}
<div class="siteinfo-item">
<div class="item-name"><i class="fa fa-font"></i>{{ T "SiteInfoItems.words" }}</div>
<div class="item-count" id="wordsCount" data-count="{{ $scratch.Get "totalWords" }}"></div>

View File

@ -12,33 +12,33 @@
<div id="toggle-theme" class="button" title="{{ T "ToolBtns.theme" }}">
<i class="fas fa-adjust"></i>
</div>
{{- if and .Site.Params.backTop.enable (not .Site.Params.backTop.sidebar) }}
{{ if and .Site.Params.backTop.enable (not .Site.Params.backTop.sidebar) }}
<div class="back-to-top" role="button" title="{{ T "ToolBtns.backTop" }}">
<i class="fa fa-arrow-up"></i>
<span>0%</span>
</div>
{{- end }}
{{ end }}
</div>
{{- if .Site.Params.readingProgress.enable }}
{{ if .Site.Params.readingProgress.enable }}
<div class="reading-progress-bar"></div>
{{- end }}
{{ end }}
{{- if .Site.Params.bookmark.enable }}
{{ if .Site.Params.bookmark.enable }}
<a role="button" class="book-mark-link book-mark-link-fixed"></a>
{{- end }}
{{ end }}
{{- with .Site.Params.githubBanner }}
{{- if .enable }}
{{ with .Site.Params.githubBanner }}
{{ if .enable }}
<a href="{{ .permalink }}" rel="noopener external nofollow noreferrer" target="_blank" title="{{ .title }}" class="exturl github-corner">
<svg width="80" height="80" viewBox="0 0 250 250" aria-hidden="true"><path d="M0,0 L115,115 L130,115 L142,142 L250,250 L250,0 Z"></path><path d="M128.3,109.0 C113.8,99.7 119.0,89.6 119.0,89.6 C122.0,82.7 120.5,78.6 120.5,78.6 C119.2,72.0 123.4,76.3 123.4,76.3 C127.3,80.9 125.5,87.3 125.5,87.3 C122.9,97.6 130.6,101.9 134.4,103.2" fill="currentColor" style="transform-origin: 130px 106px;" class="octo-arm"></path><path d="M115.0,115.0 C114.9,115.1 118.7,116.5 119.8,115.4 L133.7,101.6 C136.9,99.2 139.9,98.4 142.2,98.6 C133.8,88.0 127.5,74.4 143.8,58.0 C148.5,53.4 154.0,51.2 159.7,51.0 C160.3,49.4 163.2,43.6 171.4,40.1 C171.4,40.1 176.1,42.5 178.8,56.2 C183.1,58.6 187.2,61.8 190.9,65.4 C194.5,69.0 197.7,73.2 200.1,77.6 C213.8,80.2 216.3,84.9 216.3,84.9 C212.7,93.1 206.9,96.0 205.4,96.6 C205.1,102.4 203.0,107.8 198.3,112.5 C181.9,128.9 168.3,122.5 157.7,114.1 C157.9,116.9 156.7,120.9 152.7,124.9 L141.0,136.5 C139.8,137.7 141.6,141.9 141.8,141.8 Z" fill="currentColor" class="octo-body"></path></svg>
</a>
{{- end }}
{{- end }}
{{ end }}
{{ end }}
{{- if .Site.Params.gitter.enable }}
{{ if .Site.Params.gitter.enable }}
{{ partial "_thirdparty/chat/gitter.html" . }}
{{- end }}
{{ end }}
<noscript>
<div class="noscript-warning">Theme NexT works best with JavaScript enabled</div>