85 Commits

Author SHA1 Message Date
elkan1788
b4c5e79c1b Merge branch 'hotfix_v4.5.1'
Some checks failed
sync-2-gitee / sync-2-gitee (push) Failing after 3s
2023-06-28 10:17:26 +08:00
elkan1788
7be11c4b7f 🐛 Fixed the issue of converting English letters to lowercase in category names. 2023-06-27 23:06:38 +08:00
elkan1788
03b83da513 🐛 Fixed the issue of highlighting comma format error. 2023-06-27 23:01:13 +08:00
elkan1788
53ad048763 Merge branch 'release_v4.5.0'
Some checks failed
sync-2-gitee / sync-2-gitee (push) Failing after 2s
2023-06-24 21:20:22 +08:00
elkan1788
85871aadfc 🐛 Fixed the yaml syntax error. 2023-06-24 21:18:24 +08:00
elkan1788
61079367ef 🔧 Update the zh_tw i18n config file. 2023-06-24 20:27:00 +08:00
elkan1788
07e199ba11 🔖 Start new release version to 4.5.0 2023-06-24 16:49:05 +08:00
elkan1788
92a55d49e5 💄 Add magrin pixes from icon between text. 2023-06-24 16:37:33 +08:00
elkan1788
ee86b0d152 🐛 Fixed the comment enabled setting. 2023-06-24 15:24:04 +08:00
elkan1788
53f3a902c1 💄 Upgrade categories display in post meta. 2023-06-24 14:30:15 +08:00
elkan1788
05dba844d7 💄 Add support subcategory feature. 2023-06-24 11:08:17 +08:00
elkan1788
d44d4c2a79 💄 add page comment counter click event. 2023-06-23 22:06:42 +08:00
elkan1788
a4f496b796 📝 Upgrade README content with add new donor. 2023-06-23 20:09:17 +08:00
凡梦星尘
03ebd658ea Merge pull request #96 from vishnucho/main
feat i18n zh-tw
2023-04-23 09:52:31 +08:00
Vishnu Cho
77a33df023 feat i18n zh-tw 2023-04-15 15:47:21 +08:00
elkan1788
588740f27b 💄 Add header anchor in post page. Close #35 2023-04-07 14:17:15 +08:00
elkan1788
726349a2e0 🔀 sync main branch code 2023-04-05 15:49:39 +08:00
elkan1788
fbac63d70e 🎨 Improved page & comment counter, Close #74. 2023-04-05 12:16:05 +08:00
elkan1788
c7e4f52499 🎨 Update the site stat paramter format. 2023-04-02 17:07:29 +08:00
凡梦星尘
fdaabac210 Merge branch 'develop' of github.com:hugo-next/hugo-theme-next into develop 2023-02-20 10:30:42 +08:00
凡梦星尘
76bb84d195 Merge pull request #89 from ego/fix/utils-hideComments
Minor improvements for utils
2023-02-20 10:24:21 +08:00
凡梦星尘
88e6bc5993 🐛 Fixed the verify code build error. 2023-02-16 16:19:45 +08:00
Alter Ego
3feea66b49 * Fix utils function hideComments.
* Fix function name.
2023-02-10 01:20:07 +00:00
凡梦星尘
6b589a8206 :wrench:💄 Update the i18n config files. 2023-01-02 20:08:48 +08:00
凡梦星尘
835e98d85d :lipstick:🔧 Update the sidebar info. 2023-01-02 18:00:44 +08:00
凡梦星尘
a2019876a2 :wrench:💄 Update the post archive info. 2023-01-02 14:58:17 +08:00
凡梦星尘
dca196c315 :lipstick:🔧 Update the post meta info. 2023-01-01 22:06:59 +08:00
凡梦星尘
85b7dc11ca :lipstick:🔧 Upate the reward tip info. 2023-01-01 21:43:06 +08:00
凡梦星尘
03fd9dc829 :lipstick:🔧 Update the post copyright info. 2023-01-01 21:32:18 +08:00
凡梦星尘
a2f37c8470 Remove trim blank charsets flag to improve speed. 2023-01-01 21:12:58 +08:00
凡梦星尘
d0a6d943e0 📝 Find other way to break down math formula. 2023-01-01 17:48:24 +08:00
凡梦星尘
fa0f7856bf 📝 Update the math formula break down description. 2023-01-01 17:18:56 +08:00
凡梦星尘
dac9b379dc 💄 Move fixed post copyright word break limit. 2022-12-31 21:54:21 +08:00
凡梦星尘
a59b6a6f32 🔍 Add copyright's img attribute of alt. 2022-12-21 09:09:01 +08:00
凡梦星尘
40674ad12b 📝 Upgrade the README content to add new Donor. 2022-12-19 11:43:52 +08:00
凡梦星尘
b0ad23d764 Merge pull request #76 from ehlxr/patch-1
fix bug  404 of uppercase tag or category name
2022-12-19 11:39:34 +08:00
凡梦星尘
6db5f5c3f9 Merge pull request #76 from ehlxr/patch-1
fix bug  404 of uppercase tag or category name
2022-12-19 11:23:47 +08:00
ḕℏỈẍȓ
7b7b50fe1a fix bug 404 of uppercase tag or category name
fix bug of 404 when the tag or category  name is uppercase

Signed-off-by: ḕℏỈẍȓ <ehlxr.me@gmail.com>
2022-12-12 10:40:00 +08:00
kaolengmian7
73b15c7271 Merge remote-tracking branch 'origin/develop' into develop 2022-11-06 22:58:29 +08:00
凡梦星尘
24b135ca4b Merge branch 'hotfix_v4.4.1' into develop 2022-11-06 18:26:54 +08:00
凡梦星尘
86b9b5aa50 Merge branch 'hotfix_v4.4.1' 2022-11-06 18:26:14 +08:00
凡梦星尘
8918bff71f 🐛 Fixed the page views counter in home page. 2022-11-06 18:23:55 +08:00
凡梦星尘
dd3766bce3 📝 Startup hotfix for v4.4.1 2022-11-06 17:24:23 +08:00
kaolengmian7
8310dd347d [fix]修复样式BUG,调整 li 标签和 a 标签 css 样式 2022-11-05 10:31:41 +08:00
凡梦星尘
d6de03a2d0 Merge branch 'release_v4.4.0' into develop 2022-10-30 22:19:31 +08:00
凡梦星尘
21395a0263 Merge branch 'release_v4.4.0'
Some checks failed
sync-2-gitee / sync-2-gitee (push) Failing after 3s
2022-10-30 21:21:00 +08:00
凡梦星尘
54ada081c7 🐛 Fixed the busuanzi post view counter in home page. 2022-10-30 21:19:34 +08:00
凡梦星尘
51221f0f91 📝 Upgrade the README content about post front matter. 2022-10-30 21:12:01 +08:00
凡梦星尘
f84d590023 🐛 Fixed the comment setting in front matter. 2022-10-30 21:04:08 +08:00
凡梦星尘
7c9b834729 Add new CDN vendor who name is qiniu & bootcdn. 2022-10-30 16:54:38 +08:00
凡梦星尘
e1c088c355 💄 Add comment counter in home & page. 2022-10-30 11:43:18 +08:00
凡梦星尘
d609eecb23 ⬆️ Upgrade the Waline component version. 2022-10-30 10:40:58 +08:00
凡梦星尘
08156f22b8 Use lazy loading image function & add image viewer. Close #65 2022-10-29 22:37:41 +08:00
凡梦星尘
fa414e827a 💄 Make home post view only work for waline. 2022-10-29 20:35:19 +08:00
凡梦星尘
146bf52038 💄 Update use waline pageview & add to homepage. Close #41, #42 2022-10-29 18:15:39 +08:00
凡梦星尘
ac712b9277 🐛 Fixed the 51la widget load data issue. 2022-10-27 17:29:18 +08:00
凡梦星尘
0d1b00f7b0 🔥 Refactor struct & code for loading 3rd scripts. 2022-10-27 15:57:42 +08:00
凡梦星尘
9160a33053 💄 Fixed the waline reaction icon pixes in mobile driver. 2022-10-27 08:54:54 +08:00
凡梦星尘
525c8a7cf5 Upgrade third party js logic improve load speed. 2022-10-26 22:37:03 +08:00
凡梦星尘
90df1e1247 Refactoring the comments component js scripts. 2022-10-24 22:08:17 +08:00
凡梦星尘
b9511728f3 🔥 Remove unused the gt.scss file. 2022-10-24 20:38:28 +08:00
凡梦星尘
cc91cd0e07 🔥 Remove the busuanzi layout in footer. 2022-10-23 18:37:29 +08:00
凡梦星尘
aaa3a1449f Make the google translate script lazy load. 2022-10-23 18:36:10 +08:00
凡梦星尘
dacf4cd2c7 🙈 Add VSCode IDEA setting ignore. 2022-10-23 17:43:30 +08:00
凡梦星尘
913ae1821a 🐛 Fixed toggle theme color will refresh page. 2022-10-23 16:05:23 +08:00
凡梦星尘
1ae0ca2488 🐛 Fixed the theme schema listener of system's media. 2022-10-23 09:06:58 +08:00
凡梦星尘
72972e3a10 💄 Use smaller font size on tool button by default. 2022-10-22 17:24:13 +08:00
凡梦星尘
50f17ff502 💄 Uniform the tool buttons font size. 2022-10-22 13:24:28 +08:00
凡梦星尘
6865ec72c7 🚑 Enable the home page register tool button click. 2022-10-22 12:55:11 +08:00
凡梦星尘
0d4e0b9b84 🚑 Fixed the tool buttons click event. 2022-10-22 12:52:27 +08:00
凡梦星尘
c0ba7eda06 🎨 Try to remove the post link in creative commons. 2022-10-16 20:16:24 +08:00
凡梦星尘
e0cfe0c50c 🔥 🚚 Remove no used code & rename startup shell script file name. 2022-10-12 20:06:14 +08:00
凡梦星尘
e4cb4f0188 🔥 Remove no used code. 2022-10-09 21:54:02 +08:00
凡梦星尘
989e2c43dc 💄 Try to add reaction image with pixes in mobile driver. 2022-10-09 21:53:03 +08:00
凡梦星尘
2d736b8f35 💄 Add Algolia link with source reference content. 2022-10-07 10:13:10 +08:00
凡梦星尘
b04c1b9aa0 🐛 Fixed the tool button scroll Y pixes. 2022-10-06 13:57:37 +08:00
凡梦星尘
6a42188853 💄 Design search box footer with pagination & fixed toc enable in home page. 2022-10-06 12:00:10 +08:00
凡梦星尘
0536ac37fc 💄 Add tool button click events make it more silky. 2022-10-06 10:48:52 +08:00
凡梦星尘
0abad2539a 💄 Fixed the TOC enable in global set & implement the auto follow in TOC list with content scroll. 2022-10-06 10:02:19 +08:00
凡梦星尘
48df6401d8 💄 Remove margin in Algolia pagination widget. 2022-10-06 08:49:03 +08:00
凡梦星尘
9632707ece 💄 Redesign the Algolia search result display UI. 2022-10-05 22:56:13 +08:00
凡梦星尘
ea8a4f1dca 🔖 Start new development version to 4.4.0 2022-10-05 22:20:51 +08:00
凡梦星尘
bebd279735 👷 Upgrade Algolia search indexes with objectID. 2022-10-04 14:19:01 +08:00
凡梦星尘
9f2b1f37f8 Merge branch 'hotfix_v4.3.1' into develop 2022-10-02 13:46:50 +08:00
凡梦星尘
01f2c10ec8 Merge branch 'release_v4.3.0' into develop 2022-10-02 13:46:34 +08:00
126 changed files with 1935 additions and 2548 deletions

4
.gitignore vendored
View File

@@ -20,9 +20,11 @@ exampleSite/content/**/
# Exclude special files # Exclude special files
!exampleSite/config.yaml !exampleSite/config.yaml
!exampleSite/start.sh !exampleSite/startup.sh
data/* data/*
!data/config.yaml !data/config.yaml
!data/resources.yaml !data/resources.yaml
# vscode
.vscode/

View File

@@ -112,10 +112,12 @@ tags:
#expand: true #expand: true
# It's means that will redirecting to external links # It's means that will redirecting to external links
#extlink: #extlink:
# Switch to enabled or disabled comment plugins in this post # Disabled comment plugins in this post
#comment: #comment:
# enable: false # enable: false
# Enable table of content # Disable table of content int this post
# Notice: By default will automatic build table of content
# with h2-h4 title in post and without other settings
#toc: false #toc: false
# Absolute link for visit # Absolute link for visit
#url: "{{ lower .Name }}.html" #url: "{{ lower .Name }}.html"
@@ -170,9 +172,11 @@ List of Donors(Order desc by Date):
| Donation time | Donors | Donation mode | Donation content | Message | | Donation time | Donors | Donation mode | Donation content | Message |
| :-------: | ------ | ------ | ---- | ---- | | :-------: | ------ | ------ | ---- | ---- |
| 2022.09.30 | * | wechat pay | ¥66.66 | Hope it could help more people. | | 2023.06.01 | **霖 | alipay | RMB 10.00 | / |
| 2022.09.30 | N*l | wechat pay | ¥20.00 | / | | 2022.11.15 | f888 | xianyu | RMB 6.20 | Good luck. |
| 2022.07.09 | * | wechat pay | ¥10.00 | / | | 2022.09.30 | * | wechat pay | RMB 66.66 | Hope it could help more people. |
| 2022.05.08 | *泉 | wechat pay | ¥6.60 | Good luck with next develop. | | 2022.09.30 | N*l | wechat pay | RMB 20.00 | / |
| 2022.02.28 | * | wechat pay | ¥5.00 | / | | 2022.07.09 | * | wechat pay | RMB 10.00 | / |
| 2021.12.21 | z*y | wechat pay | ¥18.88 | / | | 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

@@ -120,10 +120,11 @@ tags:
#expand: true #expand: true
# 外部链接地址,访问时直接跳转 # 外部链接地址,访问时直接跳转
#extlink: #extlink:
# 在当前页面开启或关闭评论功能 # 在当前页面关闭评论功能
#comment: #comment:
# enable: false # enable: false
# 开启文章目录功能 # 关闭当前页面目录功能
# 注意正常情况下文章中有H2-H4标题会自动生成目录无需额外配置
#toc: false #toc: false
# 绝对访问路径 # 绝对访问路径
#url: "{{ lower .Name }}.html" #url: "{{ lower .Name }}.html"
@@ -180,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 | *軒 | 微信支付 | ¥66.66 | 愿项目造福更多人! |
| 2022.09.30 | N*l | 微信支付 | ¥20.00 | / | | 2022.09.30 | N*l | 微信支付 | ¥20.00 | / |
| 2022.07.09 | *风 | 微信支付 | ¥10.00 | / | | 2022.07.09 | *风 | 微信支付 | ¥10.00 | / |

View File

@@ -1 +1 @@
4.3.1 4.5.1

View File

@@ -27,12 +27,12 @@ tags:
# 外部链接地址,访问时直接跳转 # 外部链接地址,访问时直接跳转
# It's means that will redirecting to external links # It's means that will redirecting to external links
#extlink: #extlink:
# 在当前页面开启或关闭评论功能 # 在当前页面关闭评论功能
# Switch to enabled or disabled comment plugins in this post # Disabled comment plugins in this post
#comment: #comment:
# enable: false # enable: false
# 开启文章目录功能 # 关闭文章目录功能
# Enable table of content # Disable table of content
#toc: false #toc: false
# 绝对访问路径 # 绝对访问路径
# Absolute link for visit # Absolute link for visit

View File

@@ -15,14 +15,23 @@
list-style: none; list-style: none;
margin: 0; margin: 0;
padding: 0; padding: 0;
.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 { .category-list-item {
margin: 5px 10px; margin: 5px 10px;
font-weight: bold;
}
} }
.category-list-count { .category-list-count {
color: $grey; color: $grey;
padding: 0 2px;
&::before { &::before {
content: ' ('; content: ' (';
@@ -33,7 +42,19 @@
} }
} }
.category-list-child { .category-children-list {
padding-left: 10px; 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

@@ -42,6 +42,7 @@
} }
} }
@if $toc_number {
.autonumber { .autonumber {
h2 { h2 {
counter-reset: h3; counter-reset: h3;
@@ -67,6 +68,7 @@
} }
} }
} }
}
@import 'post-collapse'; @import 'post-collapse';
@import 'post-body'; @import 'post-body';

View File

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

View File

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

View File

@@ -24,7 +24,7 @@
.search-popup { .search-popup {
background: var(--card-bg-color); background: var(--card-bg-color);
border-radius: 5px; border-radius: 5px;
height: 80%; height: 65%;
margin: auto; margin: auto;
transform: scale(0); transform: scale(0);
transition: transform .4s; transition: transform .4s;
@@ -55,12 +55,7 @@
} }
.search-header { .search-header {
background: $gainsboro; background: var(--content-bg-color);
@if $darkmode {
@media (prefers-color-scheme: dark) {
background: $grey-dim;
}
}
border-top-left-radius: 5px; border-top-left-radius: 5px;
border-top-right-radius: 5px; border-top-right-radius: 5px;
display: flex; display: flex;
@@ -72,6 +67,7 @@
border: 0; border: 0;
outline: 0; outline: 0;
width: 100%; width: 100%;
color: var(--text-color);
&::-webkit-search-cancel-button { &::-webkit-search-cancel-button {
display: none; display: none;
@@ -81,17 +77,48 @@
.search-result-container { .search-result-container {
height: calc(100% - 55px); height: calc(100% - 55px);
overflow: auto; overflow: auto;
padding: 5px 25px; padding: 0px 25px;
}
hr { .search-footer {
margin: 5px 0 10px; background: var(--content-bg-color);
border-bottom-left-radius: 5px;
border-bottom-right-radius: 5px;
padding: 0 5px;
color: var(--text-color);
&:first-child { .search-meta-info {
display: none; height: 26px;
display: flex;
padding: 5px 0;
.search-hit-stats {
font-size: $font-size-smaller;
width: 65%;
padding: 2px 8px;
}
.search-vendor {
width: 34%;
text-align: right;
font-size: $font-size-small;
font-weight: bold;
img {
width: 68px;
margin: 5px;
vertical-align: middle;
display: inline;
}
a {
border: none;
} }
} }
} }
}
.search-result-list { .search-result-list {
margin: 0 5px; margin: 0 5px;
padding: 0; padding: 0;
@@ -137,9 +164,16 @@
.algolia-pagination { .algolia-pagination {
// Override default style of ul // Override default style of ul
margin: 40px 0; //margin: 40px 0;
opacity: 1; opacity: 1;
padding: 0; padding: 0;
font-size: $font-size-smallest;
margin-bottom: -16px;
.pagination {
visibility: visible;
margin: 0;
}
.pagination-item { .pagination-item {
display: inline-block; display: inline-block;

View File

@@ -2,4 +2,17 @@
.wl-actions>button:nth-child(3) { .wl-actions>button:nth-child(3) {
display: none display: none
} }
@include mobile() {
.wl-reaction-img {
width: 28px;
height: 28px;
}
.wl-reaction-votes {
padding: 0.85px;
font-weight: 500;
font-size: .65em;
line-height: .85;
}
}
} }

View File

@@ -2,9 +2,12 @@
@include sidebar-toggle(); @include sidebar-toggle();
background: none; background: none;
bottom: 55px; bottom: 58px;
filter: alpha(opacity=0); filter: alpha(opacity=0);
font-size: 12px; font-size: $font-size-smaller;
@include mobile() {
font-size: $font-size-smallest;
}
.button { .button {
display: block; display: block;
@@ -15,7 +18,6 @@
background-color: $tool-btn-bg; background-color: $tool-btn-bg;
color: $tool-btn-color; color: $tool-btn-color;
text-align: center; text-align: center;
font-size: $font-size-larger;
line-height: 35px; line-height: 35px;
padding: 0; padding: 0;
outline: 0; outline: 0;
@@ -25,6 +27,13 @@
opacity: $tool-btn-opacity; opacity: $tool-btn-opacity;
touch-action: manipulation; touch-action: manipulation;
@include mobile() {
width: 24px;
height: 24px;
line-height: 24px;
border-radius: 3px;
}
&:hover { &:hover {
color: $tool-btn-hover-fore-color; color: $tool-btn-hover-fore-color;
opacity: $tool-btn-opacity-hover; opacity: $tool-btn-opacity-hover;
@@ -42,7 +51,6 @@
@if $back2top_enable { @if $back2top_enable {
.back-to-top { .back-to-top {
font-size: $font-size-smaller;
@if not $back2top_scrollpercent { @if not $back2top_scrollpercent {
span { span {

View File

@@ -32,10 +32,10 @@
.google-translate { .google-translate {
display: flex; display: flex;
justify-content: center; justify-content: center;
.fa {
i {
font-size: $font-size-larger; font-size: $font-size-larger;
margin: auto 0; margin: auto 0;
line-height: normal;
} }
} }

View File

@@ -27,6 +27,8 @@
img { img {
display: inline-block; display: inline-block;
max-width: 120px;
max-height: 42px;
} }
} }

View File

@@ -1,6 +1,7 @@
.site-author-image { .site-author-image {
border: $site-author-image-border-width solid $site-author-image-border-color; border: $site-author-image-border-width solid $site-author-image-border-color;
max-width: $site-author-image-width; width: $site-author-image-width;
height: $site-author-image-width;
padding: 2px; padding: 2px;
@if $avatar_rounded { @if $avatar_rounded {

View File

@@ -2,6 +2,10 @@
font-size: $font-size-small; font-size: $font-size-small;
padding: 0 8px; padding: 0 8px;
.active-current {
color: $orange;
}
ul { ul {
list-style: none; list-style: none;
@@ -15,7 +19,7 @@
> ul { > ul {
border-left: 1px solid; border-left: 1px solid;
margin-left: 6px; margin-left: 4px;
li { li {
position: relative; position: relative;
@@ -26,7 +30,7 @@
content: ' '; content: ' ';
top: 0.14em; top: 0.14em;
left: -0.75em; left: -0.75em;
width: 0.68em; width: 0.65em;
height: 0.815em; height: 0.815em;
border-style: none none dashed none; border-style: none none dashed none;
border-width: 0.05em; border-width: 0.05em;
@@ -42,11 +46,12 @@
a { a {
transition: all $transition-ease; transition: all $transition-ease;
border: none; border: none;
@if $toc_number {
&:before { &:before {
content: counters(item, ".") ". "; content: counters(item, ".") ". ";
counter-increment: item; counter-increment: item;
} }
}
&:hover { &:hover {
text-decoration: underline; text-decoration: underline;

View File

@@ -1,6 +1,6 @@
@mixin mobile-smallest() { @mixin mobile-smallest() {
@media (max-width: 413px) { @media (max-width: 413px) {
@content;; @content;
} }
} }

View File

@@ -296,7 +296,7 @@ $b2t-opacity-hover : 1;
$b2t-position-bottom : -100px; $b2t-position-bottom : -100px;
$b2t-position-bottom-on : 19px; $b2t-position-bottom-on : 19px;
$b2t-position-right : 30px; $b2t-position-right : 30px;
$b2t-position-right-mobile : 20px; $b2t-position-right-mobile : 16px;
$b2t-font-size : 12px; $b2t-font-size : 12px;
$b2t-color : white; $b2t-color : white;
$b2t-bg-color : $black-deep; $b2t-bg-color : $black-deep;

View File

@@ -1,892 +0,0 @@
:root {
--gt-blue: #2640b2;
--gt-border: #d1d5db;
}
@keyframes "goog-te-spinner-rotator" {
0% {
transform: rotate(0deg);
}
100% {
transform: rotate(270deg);
}
}
@keyframes "goog-te-spinner-dash" {
0% {
stroke-dashoffset: 187;
}
50% {
stroke-dashoffset: 46.75;
transform: rotate(135deg);
}
100% {
stroke-dashoffset: 187;
transform: rotate(450deg);
}
}
.goog-te-banner-frame {
left: 0px;
top: 0px;
height: 39px;
width: 100%;
z-index: 10000001;
position: fixed;
border: none;
border-bottom: 1px solid #6b90da;
margin: 0;
box-shadow: 0 0 8px 1px #999999;
_position: absolute;
}
.goog-te-menu-frame {
z-index: 10000002;
position: fixed;
box-shadow: 0.5rem 0.875rem 2.375rem rgba(39, 44, 49, 0.06), 0.0625rem 0.1875rem 0.5rem rgba(39, 44, 49, 0.03);
_position: absolute;
}
.goog-te-ftab-frame {
z-index: 10000000;
border: none;
margin: 0;
}
.goog-te-gadget {
font-family: arial;
font-size: 11px;
color: #666;
white-space: nowrap;
display: inline-flex;
img {
vertical-align: middle;
border: none;
display: inline-block;
}
.goog-te-combo {
margin: 4px 0;
}
div:first-child {
margin: 0 10px;
}
}
.goog-te-gadget-simple {
background-color: #fff;
border-left: 1px solid #d5d5d5;
border-top: 1px solid #9b9b9b;
border-bottom: 1px solid #e8e8e8;
border-right: 1px solid #d5d5d5;
font-size: 10pt;
display: inline-block;
padding-top: 1px;
padding-bottom: 2px;
cursor: pointer;
zoom: 1;
*display: inline;
.goog-te-menu-value {
color: #000;
span {
text-decoration: none;
}
}
}
.goog-te-gadget-icon {
margin-left: 2px;
margin-right: 2px;
width: 19px;
height: 19px;
border: none;
vertical-align: middle;
}
.goog-te-combo {
margin-left: 4px;
margin-right: 4px;
vertical-align: baseline;
*vertical-align: middle;
font-family: arial;
font-size: 10pt;
}
.goog-logo-link {
font-size: 12px;
font-weight: bold;
color: #444;
text-decoration: none;
margin: 0 5px;
border-bottom: 0;
&:link {
font-size: 12px;
font-weight: bold;
color: #444;
text-decoration: none;
}
&:visited {
font-size: 12px;
font-weight: bold;
color: #444;
text-decoration: none;
}
&:hover {
font-size: 12px;
font-weight: bold;
color: #444;
text-decoration: none;
}
&:active {
font-size: 12px;
font-weight: bold;
color: #444;
text-decoration: none;
}
}
.goog-te-banner {
.goog-logo-link {
display: block;
margin: 0px 10px;
padding-top: 2px;
padding-left: 4px;
}
* {
font-family: arial;
font-size: 10pt;
}
margin: 0;
background-color: #fff;
overflow: hidden;
img {
border: none;
}
table {
tbody {
tr {
td {
&:nth-child(2) {
display: none;
}
}
}
}
}
}
.goog-close-link {
display: block;
margin: 0px 10px;
}
.goog-te-ftab {
* {
font-family: arial;
font-size: 10pt;
}
margin: 0px;
background-color: #fff;
white-space: nowrap;
}
.goog-te-menu {
* {
font-family: arial;
font-size: 10pt;
}
background-color: #ffffff;
text-decoration: none;
border: 2px solid #c3d9ff;
overflow-y: scroll;
overflow-x: hidden;
position: absolute;
left: 0;
top: 0;
}
.goog-te-menu2 {
* {
font-family: arial;
font-size: 10pt;
}
background-color: #ffffff;
text-decoration: none;
overflow: hidden;
padding: 4px;
border: 1px solid var(--gt-border);
border-radius: 4px;
}
.goog-te-balloon {
* {
font-family: arial;
font-size: 10pt;
}
background-color: #ffffff;
overflow: hidden;
padding: 8px;
border: none;
border-radius: 10px;
img {
border: none;
}
}
.goog-te-banner-content {
color: #000;
img {
vertical-align: middle;
}
}
.goog-te-banner-info {
color: #666;
vertical-align: top;
margin-top: 0px;
font-size: 7pt;
}
.goog-te-banner-margin {
width: 8px;
}
.goog-te-button {
div {
border: 1px solid var(--gt-border);
height: 20px;
}
button {
background: transparent;
border: none;
cursor: pointer;
height: 20px;
overflow: hidden;
margin: 0;
vertical-align: top;
white-space: nowrap;
&:active {
background: none repeat scroll 0 0 #cccccc;
}
}
}
.goog-te-ftab-link {
text-decoration: none;
font-weight: bold;
font-size: 10pt;
border: 1px outset #888;
padding: 6px 10px;
white-space: nowrap;
position: absolute;
left: 0px;
top: 0px;
img {
margin-left: 2px;
margin-right: 2px;
width: 19px;
height: 19px;
border: none;
vertical-align: middle;
}
span {
text-decoration: underline;
margin-left: 2px;
margin-right: 2px;
vertical-align: middle;
}
}
.goog-float-top {
.goog-te-ftab-link {
padding: 2px 2px;
border-top-width: 0px;
}
}
.goog-float-bottom {
.goog-te-ftab-link {
padding: 2px 2px;
border-bottom-width: 0px;
}
}
.goog-te-menu-value {
text-decoration: none;
color: var(--gt-blue);
white-space: nowrap;
margin-left: 4px;
margin-right: 4px;
span {
text-decoration: underline;
&::after {
content: "";
}
}
img {
margin-left: 2px;
margin-right: 2px;
display: none;
}
}
.goog-te-menu-item {
padding: 3px;
text-decoration: none;
color: var(--gt-blue);
background: #ffffff;
&:link {
color: var(--gt-blue);
background: #ffffff;
}
&:visited {
color: #551a8b;
}
&:hover {
background: #c3d9ff;
}
&:active {
color: var(--gt-blue);
}
}
.goog-te-menu2-colpad {
width: 16px;
}
.goog-te-menu2-separator {
margin: 6px 0;
height: 1px;
background-color: var(--gt-border);
overflow: hidden;
}
.goog-te-menu2-item {
div {
padding: 4px;
color: var(--gt-blue);
background: #ffffff;
}
.indicator {
display: none;
}
text-decoration: none;
&:link {
div {
color: var(--gt-blue);
background: #ffffff;
}
}
&:visited {
div {
color: var(--gt-blue);
background: #ffffff;
}
}
&:active {
div {
color: var(--gt-blue);
background: #ffffff;
}
}
&:hover {
div {
color: #ffffff;
background: #3366cc;
border-radius: 2px;
}
}
}
.goog-te-menu2-item-selected {
div {
padding: 4px;
color: #000;
font-weight: bold;
}
.indicator {
display: auto;
}
.text {
padding-left: 4px;
padding-right: 4px;
}
text-decoration: none;
&:link {
div {
color: #000;
font-weight: bold;
}
}
&:visited {
div {
color: #000;
font-weight: bold;
}
}
&:hover {
div {
color: #000;
font-weight: bold;
}
}
&:active {
div {
color: #000;
font-weight: bold;
}
}
}
.goog-te-balloon-frame {
background-color: #ffffff;
border: 1px solid #6b90da;
box-shadow: 0.5rem 0.875rem 2.375rem rgba(39, 44, 49, 0.06), 0.0625rem 0.1875rem 0.5rem rgba(39, 44, 49, 0.03);
border-radius: 8px;
}
.goog-te-balloon-text {
margin-top: 6px;
}
.goog-te-balloon-zippy {
margin-top: 6px;
white-space: nowrap;
* {
vertical-align: middle;
}
.minus {
background-image: url(//www.google.com/images/zippy_minus_sm.gif);
}
.plus {
background-image: url(//www.google.com/images/zippy_plus_sm.gif);
}
span {
color: #00c;
text-decoration: underline;
cursor: pointer;
margin: 0 4px;
}
}
.goog-te-balloon-form {
margin: 6px 0 0 0;
form {
margin: 0;
textarea {
margin-bottom: 4px;
width: 100%;
}
}
}
.goog-te-balloon-footer {
margin: 6px 0 4px 0;
}
.goog-te-spinner-pos {
z-index: 1000;
position: fixed;
transition-delay: 0.6s;
left: -1000px;
top: -1000px;
}
.goog-te-spinner-animation {
background: #ccc;
display: flex;
align-items: center;
justify-content: center;
width: 104px;
height: 104px;
border-radius: 50px;
background: #fff url(//www.gstatic.com/images/branding/product/2x/translate_24dp.png) 50% 50% no-repeat;
transition: all 0.6s ease-in-out;
transform: scale(0.4);
opacity: 0;
}
.goog-te-spinner-animation-show {
transform: scale(0.5);
opacity: 1;
}
.goog-te-spinner {
margin: 2px 0 0 2px;
animation: goog-te-spinner-rotator 1.4s linear infinite;
}
.goog-te-spinner-path {
stroke-dasharray: 187;
stroke-dashoffset: 0;
stroke: #4285f4;
transform-origin: center;
animation: goog-te-spinner-dash 1.4s ease-in-out infinite;
}
#goog-gt-tt {
color: #222;
background-color: #ffffff;
border: 1px solid #eee;
box-shadow: 0 4px 16px rgba(0,0,0,.2);
display: none;
font-family: arial;
font-size: 10pt;
width: 420px;
padding: 12px;
position: absolute;
z-index: 10000;
.original-text {
clear: both;
font-size: 10pt;
position: relative;
text-align: justify;
width: 100%;
}
.title {
color: #999;
font-family: arial,sans-serif;
margin: 4px 0;
text-align: left;
}
.close-button {
display: none;
}
.logo {
float: left;
margin: 0px;
}
.activity-links {
display: inline-block;
}
.started-activity-container {
display: none;
width: 100%;
}
.activity-root {
margin-top: 20px;
}
.left {
float: left;
}
.right {
float: right;
}
.bottom {
min-height: 15px;
position: relative;
height: 1%;
}
.status-message {
background: linear-gradient(top,#29910d 0%,#20af0e 100%);
background: #29910d;
border-radius: 4px;
box-shadow: inset 0px 2px 2px #1e6609;
color: white;
font-size: 9pt;
font-weight: bolder;
margin-top: 12px;
padding: 6px;
text-shadow: 1px 1px 1px #1e6609;
}
.activity-link {
color: #1155cc;
cursor: pointer;
font-family: arial;
font-size: 11px;
margin-right: 15px;
text-decoration: none;
}
textarea {
font-family: arial;
resize: vertical;
width: 100%;
margin-bottom: 10px;
border-radius: 1px;
border: 1px solid #d9d9d9;
border-top: 1px solid silver;
font-size: 13px;
height: auto;
overflow-y: auto;
padding: 1px;
&:focus {
box-shadow: inset 0 1px 2px rgba(0,0,0,0.3);
border: 1px solid #4d90fe;
outline: none;
}
}
.activity-cancel {
margin-right: 10px;
}
.translate-form {
min-height: 25px;
vertical-align: middle;
padding-top: 8px;
.activity-form {
margin-bottom: 5px;
margin-bottom: 0px;
input {
display: inline-block;
min-width: 54px;
*min-width: 70px;
border: 1px solid #dcdcdc;
border: 1px solid rgba(0,0,0,0.1);
text-align: center;
color: #444;
font-size: 11px;
font-weight: bold;
height: 27px;
outline: 0;
padding: 0 8px;
vertical-align: middle;
line-height: 27px;
margin: 0 16px 0 0;
box-shadow: 0 1px 2px rgba(0,0,0,.1);
border-radius: 2px;
transition: all 0.218s;
background-color: #f5f5f5;
background-image: linear-gradient(top,#f5f5f5,#f1f1f1);
-webkit-user-select: none;
-moz-user-select: none;
cursor: default;
&:hover {
border: 1px solid #c6c6c6;
color: #222;
transition: all 0.0s;
background-color: #f8f8f8;
background-image: linear-gradient(top,#f8f8f8,#f1f1f1);
border-color: #3079ed;
}
&:active {
border: 1px solid #c6c6c6;
color: #333;
background-color: #f6f6f6;
background-image: linear-gradient(top,#f6f6f6,#f1f1f1);
border-color: #3079ed;
}
&:focus {
#goog-gt-tt {
.translate-form {
.activity-form {
input.focus {
#goog-gt-tt {
.translate-form {
.activity-form {
input {
&:active {
box-shadow: inset 0 0 0 1px rgba(255,255,255,0.5);
}
}
}
}
}
}
}
}
}
&:active {
box-shadow: inset 0 0 0 1px rgba(255,255,255,0.5);
}
outline: none;
border: 1px solid #4d90fe;
z-index: 4 !important;
border-color: #3079ed;
}
&.focus {
&:active {
box-shadow: inset 0 0 0 1px rgba(255,255,255,0.5);
}
}
}
input.focus {
outline: none;
border: 1px solid #4d90fe;
z-index: 4 !important;
border-color: #3079ed;
}
input.selected {
background-color: #eeeeee;
background-image: linear-gradient(top,#eeeeee,#e0e0e0);
box-shadow: inset 0px 1px 2px rgba(0,0,0,0.1);
border: 1px solid #ccc;
color: #333;
}
input.activity-submit {
color: white;
border-color: #3079ed;
background-color: #4d90fe;
background-image: linear-gradient(top,#4d90fe,#4787ed);
&:hover {
#goog-gt-tt {
.translate-form {
.activity-form {
input.activity-submit {
&:focus {
border-color: #3079ed;
background-color: #357ae8;
background-image: linear-gradient(top,#4d90fe,#357ae8);
}
}
}
}
}
box-shadow: inset 0 0 0 1px #fff,0px 1px 1px rgba(0,0,0,0.1);
border-color: #3079ed;
}
&:focus {
border-color: #3079ed;
}
&:active {
border-color: #3079ed;
}
}
input.activity-submit.focus {
#goog-gt-tt {
.translate-form {
.activity-form {
input.activity-submit {
&:active {
border-color: #3079ed;
background-color: #357ae8;
background-image: linear-gradient(top,#4d90fe,#357ae8);
}
}
}
}
}
border-color: #3079ed;
}
}
}
.gray {
color: #999;
font-family: arial,sans-serif;
}
.alt-helper-text {
color: #999;
font-size: 11px;
font-family: arial,sans-serif;
margin: 15px 0px 5px 0px;
}
.alt-error-text {
color: #800;
display: none;
font-size: 9pt;
}
.alt-menu.goog-menu {
background: #ffffff;
border: 1px solid #dddddd;
box-shadow: 0px 2px 4px #99a;
min-width: 0;
outline: none;
padding: 0;
position: absolute;
z-index: 2000;
}
.alt-menu {
.goog-menuitem {
cursor: pointer;
padding: 2px 5px 5px;
margin-right: 0px;
border-style: none;
h1 {
font-size: 100%;
font-weight: bold;
margin: 4px 0px;
}
strong {
color: #345aad;
}
}
div.goog-menuitem {
&:hover {
background: #ddd;
}
}
}
.goog-submenu-arrow {
text-align: right;
position: absolute;
right: 0;
left: auto;
}
.goog-menuitem-rtl {
.goog-submenu-arrow {
text-align: left;
position: absolute;
left: 0;
right: auto;
}
}
.gt-hl-text {
background-color: #f1ea00;
border-radius: 4px;
box-shadow: rgba(0,0,0,.5) 3px 3px 4px;
box-sizing: border-box;
color: #f1ea00;
cursor: pointer;
margin: -2px -2px -2px -3px;
padding: 2px 2px 2px 3px;
position: relative;
}
.trans-target-highlight {
background-color: #f1ea00;
border-radius: 4px;
box-shadow: rgba(0,0,0,.5) 3px 3px 4px;
box-sizing: border-box;
color: #f1ea00;
cursor: pointer;
margin: -2px -2px -2px -3px;
padding: 2px 2px 2px 3px;
position: relative;
color: #222;
}
.gt-hl-layer {
color: white;
position: absolute !important;
}
.trans-target {
background-color: #c9d7f1;
border-radius: 4px 4px 0px 0px;
box-shadow: rgba(0,0,0,.5) 3px 3px 4px;
box-sizing: border-box;
cursor: pointer;
margin: -2px -2px -2px -3px;
padding: 2px 2px 3px 3px;
position: relative;
.trans-target-highlight {
background-color: #c9d7f1;
border-radius: 4px 4px 0px 0px;
box-shadow: rgba(0,0,0,.5) 3px 3px 4px;
box-sizing: border-box;
cursor: pointer;
margin: -2px -2px -2px -3px;
padding: 2px 2px 3px 3px;
position: relative;
}
}
.trans-edit {
background-color: transparent;
border: 1px solid #4d90fe;
border-radius: 0em;
margin: -2px;
padding: 1px;
}
.gt-trans-highlight-l {
border-left: 2px solid red;
margin-left: -2px;
}
.gt-trans-highlight-r {
border-right: 2px solid red;
margin-right: -2px;
}
#alt-input {
padding: 2px;
}
#alt-input-text {
font-size: 11px;
padding: 2px 2px 3px;
margin: 0;
background-color: #fff;
color: #333;
border: 1px solid #d9d9d9;
border-top: 1px solid #c0c0c0;
display: inline-block;
vertical-align: top;
height: 21px;
box-sizing: border-box;
&:hover {
border: 1px solid #b9b9b9;
border-top: 1px solid #a0a0a0;
box-shadow: inset 0px 1px 2px rgba(0,0,0,0.1);
}
&:focus {
box-shadow: inset 0px 1px 2px rgba(0,0,0,0.3);
outline: none;
border: 1px solid #4d90fe;
}
}
#alt-input-submit {
font-size: 11px;
padding: 2px 6px 3px;
margin: 0 0 0 2px;
height: 21px;
}
}
div#goog-gt-tt {
padding: 10px 14px;
}
.gt-hl-layer {
clear: both;
font-size: 10pt;
position: relative;
text-align: justify;
width: 100%;
}
.goog-text-highlight {
background-color: #c9d7f1;
box-shadow: 2px 2px 4px #9999aa;
box-sizing: border-box;
position: relative;
}

View File

@@ -1,6 +1,6 @@
// CSS Style Guide : https://codeguide.co/#css // CSS Style Guide : https://codeguide.co/#css
// All variables from site's config content. // All variables from site's config content.
{{- $P := .Site.Params }} {{ $P := .Site.Params }}
// Base // Base
$scheme : {{ $P.scheme }}; $scheme : {{ $P.scheme }};
$darkmode : {{ $P.darkmode }}; $darkmode : {{ $P.darkmode }};
@@ -70,6 +70,7 @@ $social_icons_only : {{ $P.socialIcons.iconsOnly }};
$social_icons_transition : {{ $P.socialIcons.transition }}; $social_icons_transition : {{ $P.socialIcons.transition }};
$links_settings_layout : {{ $P.linksSets.layout }}; $links_settings_layout : {{ $P.linksSets.layout }};
$toc_enable : {{ $P.toc.enable }}; $toc_enable : {{ $P.toc.enable }};
$toc_number : {{ $P.toc.number }};
$toc_expand_all : {{ $P.toc.expandAll }}; $toc_expand_all : {{ $P.toc.expandAll }};
$toc_wrap : {{ $P.toc.wrap }}; $toc_wrap : {{ $P.toc.wrap }};
@@ -128,18 +129,18 @@ $disqusjs_enable : false;
$livere_enable : {{ isset $P "livere" }}; $livere_enable : {{ isset $P "livere" }};
$utterances_enable : {{ isset $P "utterances" }}; $utterances_enable : {{ isset $P "utterances" }};
$waline_enable : {{ isset $P "waline" }}; $waline_enable : {{ isset $P "waline" }};
{{- with .Site.Params.comments }} {{ with .Site.Params.comments }}
{{- $tce := and (isset . "nav") (and .storage (gt (len .nav) 1)) }} {{ $tce := and (isset . "nav") (and .storage (gt (len .nav) 1)) }}
$two_comments_enable : {{ $tce }}; $two_comments_enable : {{ $tce }};
{{- if $tce }} {{ if $tce }}
{{- $sortNav := sort .nav "weight" }} {{ $sortNav := sort .nav "weight" }}
$two_comments_actived : {{ .active }}; $two_comments_actived : {{ .active }};
$first_comment_color : {{ (index $sortNav 0).color }}; $first_comment_color : {{ (index $sortNav 0).color }};
$first_comment_name : {{ lower (index $sortNav 0).name }}; $first_comment_name : {{ lower (index $sortNav 0).name }};
$second_comment_color : {{ (index $sortNav 1).color }}; $second_comment_color : {{ (index $sortNav 1).color }};
$second_comment_name : {{ lower (index $sortNav 1).name }}; $second_comment_name : {{ lower (index $sortNav 1).name }};
{{- end }} {{ end }}
{{- end }} {{ end }}
// //
// Variables Layer // Variables Layer
@@ -175,8 +176,3 @@ $second_comment_name : {{ lower (index $sortNav 1).name }};
// Schemes Layer // Schemes Layer
// -------------------------------------------------- // --------------------------------------------------
{{ printf "@import '_schemes/%s/';" $P.scheme }} {{ printf "@import '_schemes/%s/';" $P.scheme }}
// Custom Layer
// TODO
// --------------------------------------------------
// @import 'theme.injects.style';

View File

@@ -1,4 +1,52 @@
if (!window.NexT) window.NexT = {}; /* global NexT, boot, CONFIG */
window.NexT = {};
NexT.boot = {};
NexT.plugins = {};
// Defined comment component & add register event
NexT.plugins.comments = {};
NexT.plugins.comments.register = function() {
if (!NexT.CONFIG.page.comments) return;
for(var c in NexT.plugins.comments) {
if (c === 'register') continue;
eval('NexT.plugins.comments.'+c)();
};
}
// Defined search engine & add register event
NexT.plugins.search = {}
NexT.plugins.search.register = function() {
for(var s in NexT.plugins.search) {
if (s === 'register') continue;
eval('NexT.plugins.search.'+s)();
};
}
// Defined share plugin & add register event
NexT.plugins.share = {}
NexT.plugins.share.register = function() {
for(var s in NexT.plugins.share) {
if (s === 'register') continue;
eval('NexT.plugins.share.'+s)();
};
}
// Defined other plugin & add register event
NexT.plugins.others = {}
NexT.plugins.others.register = function() {
for(var o in NexT.plugins.others) {
if (o === 'register') continue;
eval('NexT.plugins.others.'+o)();
};
}
// Add event to register all third party plugins
NexT.plugins.register = function() {
for(var p in NexT.plugins) {
if (p === 'register') continue;
eval('NexT.plugins.'+p+'.register')();
}
};
(function() { (function() {
const className = 'next-config'; const className = 'next-config';

View File

@@ -1,15 +1,36 @@
/* global NexT, CONFIG */ /* boot starup */
NexT.boot = {}; (function () {
const onPageLoaded = () => document.dispatchEvent(
new Event('page:loaded', {
bubbles: true
})
);
NexT.boot.activeThemeMode = function(){ if (document.readyState === 'loading') {
NexT.utils.activeThemeMode(); document.addEventListener('readystatechange', onPageLoaded, { once: true });
}; } else {
onPageLoaded();
}
document.addEventListener('pjax:success', onPageLoaded);
})();
NexT.boot.registerEvents = function() { NexT.boot.registerEvents = function() {
NexT.utils.registerImageLoadEvent();
NexT.utils.registerScrollPercent(); NexT.utils.registerScrollPercent();
// NexT.utils.registerCanIUseTag(); // NexT.utils.registerCanIUseTag();
NexT.utils.registerToolButtons();
// 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. // Mobile top menu bar.
document.querySelector('.site-nav-toggle .toggle').addEventListener('click', event => { document.querySelector('.site-nav-toggle .toggle').addEventListener('click', event => {
@@ -37,14 +58,11 @@ NexT.boot.registerEvents = function() {
NexT.boot.refresh = function() { NexT.boot.refresh = function() {
NexT.utils.calSiteInfo(); NexT.utils.fmtSiteInfo();
NexT.utils.regSwitchThemeBtn();
if (!NexT.CONFIG.page.isPage) return; if (!NexT.CONFIG.page.isPage) return;
NexT.utils.registerSidebarTOC(); NexT.utils.registerSidebarTOC();
NexT.utils.replacePostCRLink();
NexT.utils.registerCopyCode(); NexT.utils.registerCopyCode();
NexT.utils.registerPostReward(); NexT.utils.registerPostReward();
if(NexT.CONFIG.page.comments) { if(NexT.CONFIG.page.comments) {
@@ -52,8 +70,9 @@ NexT.boot.refresh = function() {
NexT.utils.registerCommonSwitch(); NexT.utils.registerCommonSwitch();
NexT.utils.domAddClass('#goto-comments', 'goto-comments-on'); NexT.utils.domAddClass('#goto-comments', 'goto-comments-on');
} else { } else {
NexT.utils.hideCommontes(); NexT.utils.hideComments();
} }
NexT.utils.registerImageViewer();
//TODO //TODO
/** /**
@@ -88,7 +107,6 @@ NexT.boot.motion = function() {
}; };
document.addEventListener('DOMContentLoaded', () => { document.addEventListener('DOMContentLoaded', () => {
NexT.boot.activeThemeMode();
NexT.boot.registerEvents(); NexT.boot.registerEvents();
NexT.boot.motion(); NexT.boot.motion();
NexT.boot.refresh(); NexT.boot.refresh();

View File

@@ -1,13 +1,9 @@
document.addEventListener('DOMContentLoaded', () => { /* Artalk comment plugin */
NexT.plugins.comments.artalk = function() {
const element = '.artalk-container'; const element = '.artalk-container';
if (!NexT.CONFIG.page.comments if (!NexT.CONFIG.artalk
|| !NexT.CONFIG.artalk
|| !NexT.utils.checkDOMExist(element)) return; || !NexT.utils.checkDOMExist(element)) return;
const artalk_css = NexT.utils.getCDNResource(NexT.CONFIG.artalk.css);
NexT.utils.getStyle(artalk_css, null);
const artalk_js = NexT.utils.getCDNResource(NexT.CONFIG.artalk.js); const artalk_js = NexT.utils.getCDNResource(NexT.CONFIG.artalk.js);
const { const {
site, site,
@@ -15,10 +11,10 @@ document.addEventListener('DOMContentLoaded', () => {
server, server,
} = NexT.CONFIG.artalk.cfg; } = NexT.CONFIG.artalk.cfg;
NexT.utils.loadComments(element) NexT.utils.lazyLoadComponent(element, function() {
.then(() => NexT.utils.getScript(artalk_js, { NexT.utils.getScript(artalk_js, function(){
})) const artalk_css = NexT.utils.getCDNResource(NexT.CONFIG.artalk.css);
.then(() => { NexT.utils.getStyle(artalk_css);
new Artalk({ new Artalk({
el : element, el : element,
@@ -30,7 +26,8 @@ document.addEventListener('DOMContentLoaded', () => {
placeholder : placeholder, placeholder : placeholder,
darkMode : 'auto' darkMode : 'auto'
}); });
});
NexT.utils.hiddeLodingCmp(element); NexT.utils.hiddeLodingCmp(element);
}); });
}); }

View File

@@ -1,5 +1,5 @@
document.addEventListener('DOMContentLoaded', () => { /* Giscus comment plugin */
NexT.plugins.comments.giscus = function() {
const element = '.giscus-container'; const element = '.giscus-container';
if (!NexT.CONFIG.page.comments if (!NexT.CONFIG.page.comments
|| !NexT.CONFIG.giscus || !NexT.CONFIG.giscus
@@ -17,8 +17,8 @@ document.addEventListener('DOMContentLoaded', () => {
theme } = NexT.CONFIG.giscus.cfg; theme } = NexT.CONFIG.giscus.cfg;
NexT.utils.loadComments(element) NexT.utils.lazyLoadComponent(element, function() {
.then(() => NexT.utils.getScript(NexT.CONFIG.giscus.js, { NexT.utils.getScript(NexT.CONFIG.giscus.js, {
attributes: { attributes: {
'async' : true, 'async' : true,
'crossorigin' : 'anonymous', 'crossorigin' : 'anonymous',
@@ -35,7 +35,8 @@ document.addEventListener('DOMContentLoaded', () => {
'data-loading' : 'lazy' 'data-loading' : 'lazy'
}, },
parentNode: document.querySelector(element) parentNode: document.querySelector(element)
})); });
NexT.utils.hiddeLodingCmp(element); NexT.utils.hiddeLodingCmp(element);
}); });
}

View File

@@ -1,11 +1,10 @@
document.addEventListener('DOMContentLoaded', () => { /* LiveRe comment plugin */
NexT.plugins.comments.livere = function() {
const element = '#lv-container'; const element = '#lv-container';
if (!NexT.CONFIG.page.comments if (!NexT.CONFIG.livere
|| !NexT.CONFIG.livere
|| !NexT.utils.checkDOMExist(element)) return; || !NexT.utils.checkDOMExist(element)) return;
NexT.utils.loadComments(element).then(() => { NexT.utils.lazyLoadComponent(element, function() {
NexT.utils.getScript(NexT.CONFIG.livere.js, { NexT.utils.getScript(NexT.CONFIG.livere.js, {
attributes: { attributes: {
async: true async: true
@@ -15,4 +14,4 @@ document.addEventListener('DOMContentLoaded', () => {
NexT.utils.hiddeLodingCmp(element); NexT.utils.hiddeLodingCmp(element);
}); });
}); }

View File

@@ -1,8 +1,7 @@
document.addEventListener('DOMContentLoaded', () => { /* Utterances comment plugin */
NexT.plugins.comments.utterances = function() {
const element = '.utterances-container'; const element = '.utterances-container';
if (!NexT.CONFIG.page.comments if (!NexT.CONFIG.utterances
|| !NexT.CONFIG.utterances
|| !NexT.utils.checkDOMExist(element)) return; || !NexT.utils.checkDOMExist(element)) return;
const { const {
@@ -11,17 +10,19 @@ document.addEventListener('DOMContentLoaded', () => {
label, label,
theme } = NexT.CONFIG.utterances.cfg; theme } = NexT.CONFIG.utterances.cfg;
NexT.utils.loadComments(element) NexT.utils.lazyLoadComponent(element, function() {
.then(() => NexT.utils.getScript(NexT.CONFIG.utterances.js, { NexT.utils.getScript(NexT.CONFIG.utterances.js, {
attributes: { attributes: {
'async' : true, 'async' : true,
'crossorigin' : 'anonymous', 'crossorigin' : 'anonymous',
'repo' : repo, 'repo' : repo,
'issue-term' : issueterm, 'issue-term' : issueterm,
'label' : label,
'theme' : theme 'theme' : theme
}, },
parentNode: document.querySelector(element) parentNode: document.querySelector(element)
})); });
NexT.utils.hiddeLodingCmp(element); NexT.utils.hiddeLodingCmp(element);
}); });
}

View File

@@ -1,11 +1,11 @@
document.addEventListener('DOMContentLoaded', () => { /* Waline comment plugin */
NexT.plugins.comments.waline = function() {
const element = '.waline-container'; const element = '.waline-container';
if (!NexT.CONFIG.page.comments if (!NexT.CONFIG.waline
|| !NexT.CONFIG.waline
|| !NexT.utils.checkDOMExist(element)) return; || !NexT.utils.checkDOMExist(element)) return;
const { const {
comment,
emoji, emoji,
imguploader, imguploader,
pageview, pageview,
@@ -19,10 +19,6 @@ document.addEventListener('DOMContentLoaded', () => {
reactiontitle reactiontitle
} = NexT.CONFIG.waline.cfg; } = NexT.CONFIG.waline.cfg;
const waline_css = NexT.utils.getCDNResource(NexT.CONFIG.waline.css);
NexT.utils.getStyle(waline_css, null);
const waline_js = NexT.utils.getCDNResource(NexT.CONFIG.waline.js); const waline_js = NexT.utils.getCDNResource(NexT.CONFIG.waline.js);
let locale = { let locale = {
@@ -35,15 +31,16 @@ document.addEventListener('DOMContentLoaded', () => {
locale['reaction'+index] = value; locale['reaction'+index] = value;
}); });
NexT.utils.loadComments(element) NexT.utils.lazyLoadComponent(element, function () {
.then(() => NexT.utils.getScript(waline_js, { NexT.utils.getScript(waline_js, function(){
})) const waline_css = NexT.utils.getCDNResource(NexT.CONFIG.waline.css);
.then(() => { NexT.utils.getStyle(waline_css, 'before');
Waline.init({ Waline.init({
locale, locale,
el : element, el : element,
pageview : pageview, pageview : pageview,
comment : comment,
emoji : emoji, emoji : emoji,
imageUploader : imguploader, imageUploader : imguploader,
wordLimit : wordlimit, wordLimit : wordlimit,
@@ -55,5 +52,6 @@ document.addEventListener('DOMContentLoaded', () => {
}); });
NexT.utils.hiddeLodingCmp(element); NexT.utils.hiddeLodingCmp(element);
})
}); });
}); }

31
assets/js/third-party/others/counter.js vendored Normal file
View File

@@ -0,0 +1,31 @@
/* Page's view & comment counter plugin */
NexT.plugins.others.counter = function() {
let pageview_js = undefined;
let comment_js = undefined;
const post_meta = NexT.CONFIG.postmeta;
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
});
});
}
}
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

@@ -1,173 +0,0 @@
(function () {
var gtConstEvalStartTime = new Date();
var h = this || self,
l = /^[\w+/_-]+[=]{0,2}$/,
m = null;
function n(a) {
return (a = a.querySelector && a.querySelector("script[nonce]")) && (a = a.nonce || a.getAttribute("nonce")) &&
l.test(a) ? a : ""
}
function p(a, b) {
function c() {}
c.prototype = b.prototype;
a.i = b.prototype;
a.prototype = new c;
a.prototype.constructor = a;
a.h = function (g, f, k) {
for (var e = Array(arguments.length - 2), d = 2; d < arguments.length; d++) e[d - 2] = arguments[d];
return b.prototype[f].apply(g, e)
}
}
function q(a) {
return a
};
function r(a) {
if (Error.captureStackTrace) Error.captureStackTrace(this, r);
else {
var b = Error().stack;
b && (this.stack = b)
}
a && (this.message = String(a))
}
p(r, Error);
r.prototype.name = "CustomError";
function u(a, b) {
a = a.split("%s");
for (var c = "", g = a.length - 1, f = 0; f < g; f++) c += a[f] + (f < b.length ? b[f] : "%s");
r.call(this, c + a[g])
}
p(u, r);
u.prototype.name = "AssertionError";
function v(a, b) {
throw new u("Failure" + (a ? ": " + a : ""), Array.prototype.slice.call(arguments, 1));
};
var w;
function x(a, b) {
this.g = b === y ? a : ""
}
x.prototype.toString = function () {
return this.g + ""
};
var y = {};
function z(a) {
var b = document.getElementsByTagName("head")[0];
b || (b = document.body.parentNode.appendChild(document.createElement("head")));
b.appendChild(a)
}
function _loadJs(a) {
var b = document;
var c = "SCRIPT";
"application/xhtml+xml" === b.contentType && (c = c.toLowerCase());
c = b.createElement(c);
c.type = "text/javascript";
c.charset = "UTF-8";
if (void 0 === w) {
b = null;
var g = h.trustedTypes;
if (g && g.createPolicy) {
try {
b = g.createPolicy("goog#html", {
createHTML: q,
createScript: q,
createScriptURL: q
})
} catch (t) {
h.console && h.console.error(t.message)
}
w = b
} else w = b
}
a = (b = w) ? b.createScriptURL(a) : a;
a = new x(a, y);
a: {
try {
var f = c && c.ownerDocument,
k = f && (f.defaultView || f.parentWindow);
k = k || h;
if (k.Element && k.Location) {
var e = k;
break a
}
} catch (t) {}
e = null
}
if (e && "undefined" != typeof e.HTMLScriptElement && (!c || !(c instanceof e.HTMLScriptElement) && (c instanceof e
.Location || c instanceof e.Element))) {
e = typeof c;
if ("object" == e && null != c || "function" == e) try {
var d = c.constructor.displayName || c.constructor.name || Object.prototype.toString.call(c)
} catch (t) {
d = "<object could not be stringified>"
} else d = void 0 === c ? "undefined" : null === c ? "null" : typeof c;
v("Argument is not a %s (or a non-Element, non-Location mock); got: %s",
"HTMLScriptElement", d)
}
a instanceof x && a.constructor === x ? d = a.g : (d = typeof a, v(
"expected object of type TrustedResourceUrl, got '" + a + "' of type " + ("object" != d ? d : a ?
Array.isArray(a) ? "array" : d : "null")), d = "type_error:TrustedResourceUrl");
c.src = d;
(d = c.ownerDocument && c.ownerDocument.defaultView) && d != h ? d = n(d.document) : (null === m && (m = n(
h.document)), d = m);
d && c.setAttribute("nonce", d);
z(c)
}
function _loadCss(a) {
var b = document.createElement("link");
b.type = "text/css";
b.rel = "stylesheet";
b.charset = "UTF-8";
b.href = a;
z(b)
}
function _isNS(a) {
a = a.split(".");
for (var b = window, c = 0; c < a.length; ++c)
if (!(b = b[a[c]])) return !1;
return !0
}
function _setupNS(a) {
a = a.split(".");
for (var b = window, c = 0; c < a.length; ++c) b.hasOwnProperty ? b.hasOwnProperty(a[c]) ? b = b[a[c]] : b =
b[a[c]] = {} : b = b[a[c]] || (b[a[c]] = {});
return b
}
window.addEventListener && "undefined" == typeof document.readyState && window.addEventListener(
"DOMContentLoaded",
function () {
document.readyState = "complete"
}, !1);
if (_isNS('google.translate.Element')) {
return
}(function () {
var c = _setupNS('google.translate._const');
c._cest = gtConstEvalStartTime;
gtConstEvalStartTime = undefined;
c._cl = navigator.language || navigator.userLanguage;
c._cuc = 'googleTranslateElementInit';
c._cac = '';
c._cam = '';
c._ctkk = '449649.3822363247';
var h = 'translate.googleapis.com';
var s = (true ? 'https' : window.location.protocol == 'https:' ? 'https' : 'http') + '://';
var b = s + h;
c._pah = h;
c._pas = s;
// c._pbi = b + '/translate_static/img/te_bk.gif';
c._pbi = '';
c._pci = b + '/translate_static/img/te_ctrl3.gif';
c._pli = b + '/translate_static/img/loading.gif';
c._plla = h + '/translate_a/l';
c._pmi = b + '/translate_static/img/mini_google.png';
c._ps = window.translateelement_styles;
c._puh = 'translate.google.cn';
_loadCss(c._ps);
_loadJs(b + `/translate_static/js/element/main_${navigator.language || navigator.userLanguage}.js`);
})();
})();
function googleTranslateElementInit(){
new google.translate.TranslateElement({
includedLanguages: 'zh-CN,zh-TW,en,ru',
autoDisplay:false
},'google_translate_element');
}

View File

@@ -0,0 +1,17 @@
/* 51La sidebar data widget */
NexT.plugins.others.lawidget = function() {
const element = '#siteinfo-card-widget';
const lawt_js = NexT.CONFIG.lawidget.js.replace('laId', NexT.CONFIG.lawidget.id);
NexT.utils.lazyLoadComponent(element, function () {
NexT.utils.getScript(lawt_js,{
attributes: {
id: 'LA-DATA-WIDGET',
crossorigin: 'anonymous',
charset: 'UTF-8',
defer: true
},
parentNode: document.getElementById('la-siteinfo-widget')
}, NexT.utils.fmtLaWidget());
});
}

38
assets/js/third-party/others/math.js vendored Normal file
View File

@@ -0,0 +1,38 @@
/* Math render plugin */
NexT.plugins.others.math = function() {
const render = NexT.CONFIG.page.math.render;
if (render === 'mathjax') {
const render_js = NexT.utils.getCDNResource(NexT.CONFIG.page.math.js);
NexT.utils.getScript(render_js, function(){
window.MathJax = {
tex: {
inlineMath: [["$", "$"]],
}
};
});
}
if (render === 'katex') {
const render_css = NexT.utils.getCDNResource(NexT.CONFIG.page.math.css);
NexT.utils.getStyle(render_css);
const render_js_list = NexT.CONFIG.page.math.js;
render_js_list.forEach(js => {
const js_loader = NexT.utils.getScript(NexT.utils.getCDNResource(js));
if(js.name === 'auto-render') {
js_loader.then(function(){
renderMathInElement(document.body, {
delimiters: [
{left: '$$', right: '$$', display: true},
{left: '$', right: '$', display: false},
{left: '\\(', right: '\\)', display: false},
{left: '\\[', right: '\\]', display: true}
],
throwOnError : false
})
});
}
});
}
}

15
assets/js/third-party/others/mermaid.js vendored Normal file
View File

@@ -0,0 +1,15 @@
/* Mermaid plugin */
NexT.plugins.others.mermaid = function() {
const mermaid_js = NexT.utils.getCDNResource(NexT.CONFIG.page.mermaid.js);
NexT.utils.getScript(mermaid_js, function(){
mermaid.initialize({
sequence: {
showSequenceNumbers: true,
actorMargin: 50,
diagramMarginX:10,
diagramMarginY:10
}
});
});
}

View File

@@ -0,0 +1,9 @@
/* Google translate plugin */
NexT.plugins.others.translate = function() {
const element = '#gtranslate';
if (!NexT.utils.checkDOMExist(element)) return;
NexT.utils.lazyLoadComponent(element, function() {
window.translateelement_styles='/css/google-translate.min.css';
NexT.utils.getScript('/js/third-party/google-translate.min.js');
});
}

View File

@@ -1,12 +1,11 @@
/* global instantsearch, algoliasearch, CONFIG, pjax */ /* Algolia search engine */
NexT.plugins.search.algolia = function() {
document.addEventListener('DOMContentLoaded', () => { const algoliajs = NexT.utils.getCDNResource(NexT.CONFIG.algolia.js);
const algoiajs = NexT.utils.getCDNResource(NexT.CONFIG.algolia.js);
const instantschjs = NexT.utils.getCDNResource(NexT.CONFIG.algolia.instantjs); const instantschjs = NexT.utils.getCDNResource(NexT.CONFIG.algolia.instantjs);
NexT.utils.getScript(algoiajs, {}); NexT.utils.getScript(algoliajs);
NexT.utils.getScript(instantschjs, {}).then(() => { NexT.utils.getScript(instantschjs, function() {
const { indexname, appid, apikey, hits } = NexT.CONFIG.algolia.cfg; const { indexname, appid, apikey, hits } = NexT.CONFIG.algolia.cfg;
const indexName = indexname; const indexName = indexname;
@@ -56,7 +55,7 @@ document.addEventListener('DOMContentLoaded', () => {
const stats = NexT.CONFIG.i18n.hits_time const stats = NexT.CONFIG.i18n.hits_time
.replace('${hits}', data.nbHits) .replace('${hits}', data.nbHits)
.replace('${time}', data.processingTimeMS); .replace('${time}', data.processingTimeMS);
return `<span>${stats}</span><img src="/imgs/algolia-logo.svg" alt="Algolia">`; return `${stats}`;
} }
}, },
cssClasses: { cssClasses: {
@@ -138,7 +137,6 @@ document.addEventListener('DOMContentLoaded', () => {
onPopupClose(); onPopupClose();
} }
}); });
});;
}); });
}

View File

@@ -1,4 +1,4 @@
/* global CONFIG, pjax, LocalSearch */ /* LocalSearch engine */
class LocalSearch { class LocalSearch {
constructor({ constructor({
path = '', path = '',
@@ -227,7 +227,7 @@ class LocalSearch {
} }
} }
document.addEventListener('DOMContentLoaded', () => { NexT.plugins.search.localsearch = function() {
if (! NexT.CONFIG.localSearch.path) { if (! NexT.CONFIG.localSearch.path) {
// Search DB path // Search DB path
console.warn('`search indexes file` is not configurate!'); console.warn('`search indexes file` is not configurate!');
@@ -323,4 +323,4 @@ document.addEventListener('DOMContentLoaded', () => {
onPopupClose(); onPopupClose();
} }
}); });
}); }

View File

@@ -1,16 +1,16 @@
document.addEventListener('DOMContentLoaded', () => { /* AddThis share plugin */
NexT.plugins.share.addthis = function() {
const element = '.addthis_inline_share_toolbox'; const element = '.addthis_inline_share_toolbox';
if (!NexT.CONFIG.addthis || !NexT.utils.checkDOMExist(element)) return; if (!NexT.CONFIG.addthis || !NexT.utils.checkDOMExist(element)) return;
const addthis_js = NexT.CONFIG.addthis.js + '?pubid=' + NexT.CONFIG.addthis.cfg.pubid; const addthis_js = NexT.CONFIG.addthis.js + '?pubid=' + NexT.CONFIG.addthis.cfg.pubid;
NexT.utils.loadComments(element).then(() => { NexT.utils.lazyLoadComponent(element, function() {
NexT.utils.getScript(addthis_js, { NexT.utils.getScript(addthis_js, {
attributes: { attributes: {
async: true async: false
}, },
parentNode: document.querySelector(element) parentNode: document.querySelector(element)
}); });
}); });
}); }

View File

@@ -1,4 +1,4 @@
/* global NexT, CONFIG */ /* util tools */
HTMLElement.prototype.wrap = function (wrapper) { HTMLElement.prototype.wrap = function (wrapper) {
this.parentNode.insertBefore(wrapper, this); this.parentNode.insertBefore(wrapper, this);
@@ -6,95 +6,67 @@ HTMLElement.prototype.wrap = function(wrapper) {
wrapper.appendChild(this); wrapper.appendChild(this);
}; };
(function() {
const onPageLoaded = () => document.dispatchEvent(
new Event('page:loaded', {
bubbles: true
})
);
if (document.readyState === 'loading') {
document.addEventListener('readystatechange', onPageLoaded, { once: true });
} else {
onPageLoaded();
}
document.addEventListener('pjax:success', onPageLoaded);
})();
NexT.utils = { NexT.utils = {
registerImageLoadEvent: function() {
const images = document.querySelectorAll('.sidebar img, .post-block img, .vendors-list img');
regSwitchThemeBtn: function() { const callback = (entries) => {
const switchThemeBtn = document.getElementById('switch-theme'); entries.forEach(item => {
if (!switchThemeBtn) return; if (item.intersectionRatio > 0) {
switchThemeBtn.addEventListener('click', () => { let ele = item.target;
const colorTheme = document.documentElement.getAttribute('data-theme'); let imgSrc = ele.getAttribute('data-src');
NexT.utils.toggleDarkMode(!(colorTheme == 'dark')); if (imgSrc) {
let img = new Image();
}); img.addEventListener('load', function() {
}, ele.src = imgSrc;
}, false);
activeThemeMode: function() { ele.src = imgSrc;
// Prevent load image again
const useDark = window.matchMedia("(prefers-color-scheme: dark)"); ele.removeAttribute('data-src');
let darkModeState = NexT.CONFIG.darkmode || useDark.matches;
const localState = NexT.utils.getLocalStorage('theme');
if (localState == 'light'
|| (localState == undefined && !NexT.CONFIG.darkmode)) {
darkModeState = false;
} }
NexT.utils.toggleDarkMode(darkModeState);
useDark.addListener(function(evt) {
toggleDarkMode(evt.matches);
});
},
toggleDarkMode: function(state) {
if(state) {
document.documentElement.setAttribute('data-theme', 'dark');
NexT.utils.setLocalStorage('theme', 'dark', 2);
} else {
document.documentElement.setAttribute('data-theme', 'light');
NexT.utils.setLocalStorage('theme', 'light', 2);
} }
})
const theme = state ? 'dark' : 'light';
NexT.utils.toggleGiscusDarkMode(theme);
},
toggleGiscusDarkMode: function(theme) {
const iframe = document.querySelector('iframe.giscus-frame');
if (iframe) {
const config = { setConfig: { theme: theme } };
iframe.contentWindow.postMessage({ giscus: config }, 'https://giscus.app');
}
},
setLocalStorage: function(key, value, ttl) {
if (ttl === 0) return;
const now = new Date();
const expiryDay = ttl * 86400000;
const item = {
value: value,
expiry: now.getTime() + expiryDay
}; };
localStorage.setItem(key, JSON.stringify(item));
const observer = new IntersectionObserver(callback);
images.forEach(img => {
observer.observe(img);
});
}, },
getLocalStorage: function(key) { registerImageViewer: function() {
const itemStr = localStorage.getItem(key); new Viewer(document.querySelector('.post-body'),{ navbar:2, toolbar:2 });
if (!itemStr) { },
return undefined;
}
const item = JSON.parse(itemStr); registerToolButtons: function () {
const now = new Date(); const buttons = document.querySelector('.tool-buttons');
if (now.getTime() > item.expiry) { const scrollbar_buttons = buttons.querySelectorAll('div:not(#toggle-theme)');
localStorage.removeItem(key); scrollbar_buttons.forEach(button => {
return undefined; let targetId = button.id;
if (targetId != '') {
targetId = targetId.substring(5);
} }
return item.value; button.addEventListener('click', () => {
this.slidScrollBarAnime(targetId);
});
});
buttons.querySelector('div#toggle-theme').addEventListener('click', () => {
const cur_theme = document.documentElement.getAttribute('data-theme');
window.theme.toggle(cur_theme === 'dark' ? 'light' : 'dark');
});
},
slidScrollBarAnime: function (targetId, easing = 'linear', duration = 500) {
const targetObj = document.getElementById(targetId);
window.anime({
targets: document.scrollingElement,
duration: duration,
easing: easing,
scrollTop: targetId == '' || !targetObj ? 0 : targetObj.getBoundingClientRect().top + window.scrollY
});
}, },
domAddClass: function (selector, cls) { domAddClass: function (selector, cls) {
@@ -106,18 +78,18 @@ NexT.utils = {
} }
}, },
calSiteInfo: function() { fmtSiteInfo: function () {
const runtimeCount = document.getElementById('runTimes'); const runtimeCount = document.getElementById('runTimes');
if (runtimeCount) { if (runtimeCount) {
const publishDate = runtimeCount.getAttribute('data-publishDate'); const publishDate = runtimeCount.getAttribute('data-publishDate');
const runTimes = NexT.utils.diffDate(publishDate, 2); const runTimes = this.diffDate(publishDate, 2);
runtimeCount.innerText = runTimes; runtimeCount.innerText = runTimes;
} }
const wordsCount = document.getElementById('wordsCount'); const wordsCount = document.getElementById('wordsCount');
if (wordsCount) { if (wordsCount) {
const words = wordsCount.getAttribute('data-count'); const words = wordsCount.getAttribute('data-count');
wordsCount.innerText = NexT.utils.numberFormat(words); wordsCount.innerText = this.numberFormat(words);
} }
const readTimes = document.getElementById('readTimes'); const readTimes = document.getElementById('readTimes');
@@ -144,24 +116,27 @@ NexT.utils = {
const lastPushDate = document.getElementById('last-push-date'); const lastPushDate = document.getElementById('last-push-date');
if (lastPushDate) { if (lastPushDate) {
const pushDateVal = NexT.utils.diffDate(lastPushDate.getAttribute('data-lastPushDate'), 1); const pushDateVal = this.diffDate(lastPushDate.getAttribute('data-lastPushDate'), 1);
lastPushDate.innerText = pushDateVal; lastPushDate.innerText = pushDateVal;
} }
},
const statisWidget = document.querySelectorAll('#la-siteinfo-widget span'); fmtLaWidget: function(){
if (statisWidget.length > 0) { setTimeout(function(){
const laWidget = document.querySelectorAll('#la-siteinfo-widget span');
if (laWidget.length > 0) {
const valIds = [0, 2, 4, 6]; const valIds = [0, 2, 4, 6];
const domIds = ['today_site_pv', 'yesterday_site_pv', 'month_site_pv', 'total_site_pv'] const domIds = ['today_site_pv', 'yesterday_site_pv', 'month_site_pv', 'total_site_pv']
for (var i in valIds) { for (let i in valIds) {
let pv = NexT.utils.numberFormat(statisWidget[valIds[i]].innerText); let pv = NexT.utils.numberFormat(laWidget[valIds[i]].innerText);
document.getElementById(domIds[i]).innerText = pv; document.getElementById(domIds[i]).innerText = pv;
} }
} }
}, 800);
setTimeout(()=>{ NexT.utils.fmtBusuanzi(); }, 500);
}, },
fmtBusuanzi: function () { fmtBusuanzi: function () {
setTimeout(function(){
const bszUV = document.getElementById('busuanzi_value_site_uv'); const bszUV = document.getElementById('busuanzi_value_site_uv');
if (bszUV) { if (bszUV) {
bszUV.innerText = NexT.utils.numberFormat(bszUV.innerText); bszUV.innerText = NexT.utils.numberFormat(bszUV.innerText);
@@ -170,6 +145,7 @@ NexT.utils = {
if (bszPV) { if (bszPV) {
bszPV.innerText = NexT.utils.numberFormat(bszPV.innerText); bszPV.innerText = NexT.utils.numberFormat(bszPV.innerText);
} }
}, 800);
}, },
numberFormat: function (number) { numberFormat: function (number) {
@@ -240,14 +216,20 @@ NexT.utils = {
getCDNResource: function (res) { getCDNResource: function (res) {
let { plugins, router } = NexT.CONFIG.vendor; let { plugins, router } = NexT.CONFIG.vendor;
let { name, version, file, alias } = res; let { name, version, file, alias, alias_name } = res;
let npm_name = name; let npm_name = name;
if (alias_name) npm_name = alias_name;
let res_src = ''; let res_src = '';
switch (plugins) { switch (plugins) {
case 'cdnjs': case 'cdnjs':
case 'bootcdn':
case 'qiniu':
let cdnjs_name = alias || name; let cdnjs_name = alias || name;
let cdnjs_file = file.replace(/\.js$/, '.min.js').replace(/^(dist|lib|source\/js|)\/(browser\/|)/, ''); let cdnjs_file = file.replace(/^(dist|lib|source|\/js|)\/(browser\/|)/, '');
if (cdnjs_file.indexOf('min') == -1) {
cdnjs_file = cdnjs_file.replace(/\.js$/, '.min.js');
}
res_src = `${router}/${cdnjs_name}/${version}/${cdnjs_file}` res_src = `${router}/${cdnjs_name}/${version}/${cdnjs_file}`
break; break;
default: default:
@@ -257,19 +239,6 @@ NexT.utils = {
return res_src; return res_src;
}, },
replacePostCRLink: function() {
if (NexT.CONFIG.hostname.startsWith('http')) return;
// Try to support mutli domain without base URL sets.
let href = window.location.href;
if (href.indexOf('#')>-1){
href = href.split('#')[0];
}
let postLink = document.getElementById('post-cr-link');
if (!postLink) return;
postLink.text = href;
postLink.href = href;
},
/** /**
* One-click copy code support. * One-click copy code support.
*/ */
@@ -379,15 +348,6 @@ NexT.utils = {
} }
this.activateNavByIndex(index); this.activateNavByIndex(index);
}, { passive: true }); }, { passive: true });
backToTop && backToTop.addEventListener('click', () => {
window.anime({
targets : document.scrollingElement,
duration : 500,
easing : 'linear',
scrollTop: 0
});
});
}, },
/** /**
@@ -464,7 +424,13 @@ NexT.utils = {
},*/ },*/
registerSidebarTOC: function () { registerSidebarTOC: function () {
this.sections = [...document.querySelectorAll('.post-toc li a.nav-link')].map(element => { const toc = document.getElementById('TableOfContents');
if (!toc.hasChildNodes()) {
const tocActive = document.querySelector('.sidebar-inner');
tocActive.classList.remove('sidebar-nav-active', 'sidebar-toc-active');
tocActive.classList.add('sidebar-overview-active');
}
this.sections = [...document.querySelectorAll('.post-toc li a')].map(element => {
const target = document.getElementById(decodeURI(element.getAttribute('href')).replace('#', '')); const target = document.getElementById(decodeURI(element.getAttribute('href')).replace('#', ''));
// TOC item animation navigate. // TOC item animation navigate.
element.addEventListener('click', event => { element.addEventListener('click', event => {
@@ -496,7 +462,7 @@ NexT.utils = {
const comms = document.querySelectorAll('.comment-wrap > div'); const comms = document.querySelectorAll('.comment-wrap > div');
if (comms.length <= 1) return; if (comms.length <= 1) return;
comms.forEach(function (item) { comms.forEach(function (item) {
var dis = window.getComputedStyle(item, null).display; let dis = window.getComputedStyle(item, null).display;
item.style.display = dis; item.style.display = dis;
}); });
}, },
@@ -517,8 +483,11 @@ NexT.utils = {
}); });
}, },
hideCommontes:function() { hideComments: function () {
document.querySelector('.post-comments').style.display = 'none'; let postComments = document.querySelector('.post-comments');
if (postComments !== null) {
postComments.style.display = 'none';
}
}, },
hiddeLodingCmp: function (selector) { hiddeLodingCmp: function (selector) {
@@ -527,7 +496,7 @@ NexT.utils = {
}, },
activateNavByIndex: function (index) { activateNavByIndex: function (index) {
const target = document.querySelectorAll('.post-toc li a.nav-link')[index]; const target = document.querySelectorAll('.post-toc li a')[index];
if (!target || target.classList.contains('active-current')) return; if (!target || target.classList.contains('active-current')) return;
document.querySelectorAll('.post-toc .active').forEach(element => { document.querySelectorAll('.post-toc .active').forEach(element => {
@@ -592,13 +561,18 @@ NexT.utils = {
}); });
}, },
getStyle: function(src, parent) { getStyle: function (src, position='after', parent) {
const link = document.createElement('link'); const link = document.createElement('link');
link.setAttribute('rel', 'stylesheet'); link.setAttribute('rel', 'stylesheet');
link.setAttribute('type', 'text/css'); link.setAttribute('type', 'text/css');
link.setAttribute('href', src); link.setAttribute('href', src);
(parent || document.head).appendChild(link); const head = (parent || document.head);
if (position === 'before') {
head.prepend(link);
} else {
head.append(link);
}
}, },
getScript: function (src, options = {}, legacyCondition) { getScript: function (src, options = {}, legacyCondition) {
@@ -653,9 +627,9 @@ NexT.utils = {
}); });
}, },
loadComments: function(selector, legacyCallback) { lazyLoadComponent: function(selector, legacyCallback) {
if (legacyCallback) { if (legacyCallback) {
return this.loadComments(selector).then(legacyCallback); return this.lazyLoadComponent(selector).then(legacyCallback);
} }
return new Promise(resolve => { return new Promise(resolve => {
const element = document.querySelector(selector); const element = document.querySelector(selector);

View File

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

View File

@@ -3,6 +3,8 @@
vendors: vendors:
cdnjs: "https://cdnjs.cloudflare.com/ajax/libs" cdnjs: "https://cdnjs.cloudflare.com/ajax/libs"
unpkg: "https://unpkg.com" unpkg: "https://unpkg.com"
bootcdn: "https://cdn.bootcdn.net/ajax/libs"
qiniu: "https://cdn.staticfile.org"
# JavaScript 资源 # JavaScript 资源
# JavaScript Resources # JavaScript Resources
@@ -10,6 +12,9 @@ js:
- name: animejs - name: animejs
version: 3.2.1 version: 3.2.1
file: lib/anime.min.js file: lib/anime.min.js
- name: viewerjs
version: 1.11.0
file: dist/viewer.min.js
# CSS 资源 # CSS 资源
# CSS Resources # CSS Resources
@@ -21,6 +26,9 @@ css:
- name: animate.css - name: animate.css
version: 3.1.1 version: 3.1.1
file: animate.min.css file: animate.min.css
- name: viewerjs
version: 1.11.0
file: dist/viewer.min.css
# 第三方服务组件资源 # 第三方服务组件资源
# 3rd servcies Resource # 3rd servcies Resource
@@ -44,12 +52,12 @@ addthis:
waline: waline:
js: js:
name: '@waline/client' name: '@waline/client'
version: 2.11.3 version: 2.13.0
file: dist/waline.js file: dist/waline.js
alias: waline alias: waline
css: css:
name: '@waline/client' name: '@waline/client'
version: 2.11.3 version: 2.13.0
file: dist/waline.css file: dist/waline.css
alias: waline alias: waline
@@ -76,18 +84,18 @@ livere:
# Full text search # Full text search
algolia: algolia:
name: algoliasearch name: algoliasearch
version: 4.13.0 version: 4.14.2
file: dist/algoliasearch-lite.umd.js file: dist/algoliasearch-lite.umd.js
instant: instant:
name: instantsearch.js name: instantsearch.js
version: 4.40.5 version: 4.49.0
file: dist/instantsearch.production.min.js file: dist/instantsearch.production.min.js
plugins: plugins:
# 数学公式渲染 # 数学公式渲染
mathjax: mathjax:
js: js:
- name: mathjax name: mathjax
version: 3.2.0 version: 3.2.0
file: es5/tex-mml-chtml.js file: es5/tex-mml-chtml.js
katex: katex:
@@ -96,18 +104,29 @@ plugins:
version: 0.16.0 version: 0.16.0
file: dist/katex.min.js file: dist/katex.min.js
- name: auto-render - name: auto-render
alias2: katex alias_name: katex
version: 0.16.0 version: 0.16.0
file: dist/contrib/auto-render.min.js file: dist/contrib/auto-render.min.js
css: css:
- name: katex name: katex
version: 0.16.0 version: 0.16.0
file: dist/katex.min.css file: dist/katex.min.css
# 画图渲染 # 画图渲染
mermaid: mermaid:
js: js:
- name: mermaid name: mermaid
version: 9.1.7 version: 9.1.7
file: dist/mermaid.min.js file: dist/mermaid.min.js
# 文章访问/评论统计
waline:
js:
- name: pageview
alias_name: '@waline/client'
version: 2.13.0
file: dist/pageview.js
alias: waline
- name: comment
alias_name: '@waline/client'
version: 2.13.0
file: dist/comment.js
alias: waline

View File

@@ -39,10 +39,6 @@ markup:
renderer: renderer:
unsafe: true unsafe: true
highlight: highlight:
# codeFences: true
# lineNos: true
# lineNumbersInTable: true
# noClasses: true
# # 高亮代码的样式名称可选monokai | emacs | api | dracula | friendly # # 高亮代码的样式名称可选monokai | emacs | api | dracula | friendly
# # 更多的样式https://xyproto.github.io/splash/docs/all.html # # 更多的样式https://xyproto.github.io/splash/docs/all.html
# # Highlight style: monokai | emacs | api | dracula | friendly # # Highlight style: monokai | emacs | api | dracula | friendly
@@ -107,6 +103,7 @@ enableRobotsTXT: true
# 强制输出时压缩文件 # 强制输出时压缩文件
# Compress all files when output # Compress all files when output
minify: minify:
minifyOutput: true
#-------------------------------------- #--------------------------------------
# 菜单配置说明 # 菜单配置说明
@@ -301,12 +298,12 @@ params:
# Posts / Categories / Tags in sidebar. # Posts / Categories / Tags in sidebar.
basic: true basic: true
# 站点访问信息 # 站点访问信息
# Site information # Site's view information
statistic: views:
enable: true enable: true
# 组件类型,可选值为: 51la, busuanzi # 组件类型,可选值为: 51la, busuanzi
# 使用51la时需要注册账号https://invite.51.la/1NUfGTS1?target=V6 # 使用51la时需要注册账号https://invite.51.la/
# Plguin value is: 51la, busuzazi # Plguin value is: 51la, busuanzi
plugin: busuanzi plugin: busuanzi
# 社交链接地址 # 社交链接地址
@@ -481,6 +478,18 @@ params:
categories: true categories: true
wordCount: true wordCount: true
readTime: 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 # Post footer settings
@@ -813,7 +822,8 @@ params:
# Waline comments system # Waline comments system
# More info seee: https://waline.js.org/ # More info seee: https://waline.js.org/
waline: waline:
pageView: '#waline-pageview-count' pageView: true
comment: true
placeholder: "请文明发言哟 ヾ(≧▽≦*)o" placeholder: "请文明发言哟 ヾ(≧▽≦*)o"
sofa: "快来发表你的意见吧 (≧∀≦)ゞ" sofa: "快来发表你的意见吧 (≧∀≦)ゞ"
emoji: false emoji: false
@@ -939,8 +949,6 @@ params:
busuanzi: busuanzi:
visitorsIcon: fa fa-user visitorsIcon: fa fa-user
viewsIcon: fa fa-eye viewsIcon: fa fa-eye
postViews: true
# --------------------------------------------------------------- # ---------------------------------------------------------------
# 内容搜索服务 # 内容搜索服务
@@ -1094,15 +1102,16 @@ params:
# CDN Settings # CDN Settings
# --------------------------------------------------------------- # ---------------------------------------------------------------
vendors:
vendors: vendors:
# The CDN provider of NexT internal scripts. # The CDN provider of NexT internal scripts.
# Available values: local | unpkg | cdnjs | custom # Available values: local | unpkg | cdnjs | qiniu | bootcdn | custom
# Warning: If you are using the latest master branch of NexT, please set `internal: local` # Warning: If you are using the latest master branch of NexT, please set `internal: local`
internal: local internal: local
# The default CDN provider of third-party plugins. # The default CDN provider of third-party plugins.
# Available values: local | unpkg | cdnjs | custom # Available values: local | unpkg | cdnjs| qiniu | bootcdn | custom
# Dependencies for `plugins: local`: https://github.com/next-theme/plugins # Dependencies for `plugins: local`: https://github.com/next-theme/plugins
plugins: unpkg plugins: qiniu
# TODO # TODO
# Custom CDN URL # Custom CDN URL
# For example: # For example:

View File

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

View File

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

View File

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

View File

@@ -6,7 +6,8 @@ lastmod: 2022-06-03T16:43:23+08:00
date: 2022-06-02T11:52:03+08:00 date: 2022-06-02T11:52:03+08:00
categories: categories:
- 博客 - 开始建站
tags: tags:
- Hugo - Hugo
- 开始 - 开始

View File

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

View File

@@ -7,7 +7,8 @@ date: 2022-09-11T10:16:02+08:00
lastmod: 2022-09-11T10:16:02+08:00 lastmod: 2022-09-11T10:16:02+08:00
categories: categories:
- 示例 - 第三方引入
- 数学公式
tags: tags:
- 数学公式 - 数学公式
- mathjax - mathjax
@@ -34,23 +35,23 @@ math: mathjax
**注意:** 使用[支持的TeX功能](https://docs.mathjax.org/en/latest/input/tex/index.html)的联机参考资料。 **注意:** 使用[支持的TeX功能](https://docs.mathjax.org/en/latest/input/tex/index.html)的联机参考资料。
### 例子 ## 例子
## 重复的分数 ### 重复的分数
$$ $$
\frac{1}{\Bigl(\sqrt{\phi \sqrt{5}}-\phi\Bigr) e^{\frac25 \pi}} \equiv 1+\frac{e^{-2\pi}} {1+\frac{e^{-4\pi}} {1+\frac{e^{-6\pi}} {1+\frac{e^{-8\pi}} {1+\cdots} } } } \frac{1}{\Bigl(\sqrt{\phi \sqrt{5}}-\phi\Bigr) e^{\frac25 \pi}} \equiv 1+\frac{e^{-2\pi}} {1+\frac{e^{-4\pi}} {1+\frac{e^{-6\pi}} {1+\frac{e^{-8\pi}} {1+\cdots} } } }
$$ $$
## 总和记号 ### 总和记号
$$ $$
\left( \sum_{k=1}^n a_k b_k \right)^2 \leq \left( \sum_{k=1}^n a_k^2 \right) \left( \sum_{k=1}^n b_k^2 \right) \left( \sum_{k=1}^n a_k b_k \right)^2 \leq \left( \sum_{k=1}^n a_k^2 \right) \left( \sum_{k=1}^n b_k^2 \right)
$$ $$
## 几何级数之和 ### 几何级数之和
我把接下来的两个例子分成了几行,这样它在手机上表现得更好。这就是为什么它们包含 `\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 \displaystyle\sum_{i=1}^{k+1}i
@@ -76,31 +77,36 @@ $$
\displaystyle= \frac{(k+1)((k+1)+1)}{2} \displaystyle= \frac{(k+1)((k+1)+1)}{2}
$$ $$
## 乘记号 ### 乘记号
$$ $$
\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.
$$ $$
## 随文数式 ### 随文数式
这是一些线性数学: $$ k_{n+1} = n^2 + k_n^2 - k_{n-1} $$ 然后是更多的文本。 这是一些线性数学: $$ k_{n+1} = n^2 + k_n^2 - k_{n-1} $$ 然后是更多的文本。
## 希腊字母 ### 希腊字母
$$ $$
\Gamma\ \Delta\ \Theta\ \Lambda\ \Xi\ \Pi\ \Sigma\ \Upsilon\ \Phi\ \Psi\ \Omega \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 \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}
$$ $$
## 箭头 ### 箭头
$$ $$
\gets\ \to\ \leftarrow\ \rightarrow\ \uparrow\ \Uparrow\ \downarrow\ \Downarrow\ \updownarrow\ \Updownarrow \gets\ \to\ \leftarrow\ \rightarrow\ \uparrow\ \Uparrow\ \downarrow\ \Downarrow\ \updownarrow\ \Updownarrow
$$ $$
$$ $$
\Leftarrow\ \Rightarrow\ \leftrightarrow\ \Leftrightarrow\ \mapsto\ \hookleftarrow \displaylines{\Leftarrow\ \Rightarrow\ \leftrightarrow\ \Leftrightarrow\ \mapsto\ \hookleftarrow
\leftharpoonup\ \leftharpoondown\ \rightleftharpoons\ \longleftarrow\ \Longleftarrow\ \longrightarrow \leftharpoonup\ \leftharpoondown\ \\\\\ \rightleftharpoons\ \longleftarrow\ \Longleftarrow\ \longrightarrow}
$$ $$
$$ $$
@@ -122,7 +128,7 @@ $$
$$ $$
## 微积分学 ### 微积分学
$$ $$
\int u \frac{dv}{dx}\,dx=uv-\int \frac{du}{dx}v\,dx \int u \frac{dv}{dx}\,dx=uv-\int \frac{du}{dx}v\,dx
$$ $$
@@ -136,13 +142,13 @@ $$
$$ $$
## 洛伦茨方程 ### 洛伦茨方程
$$ $$
\begin{aligned} \dot{x} & = \sigma(y-x) \\\\ \dot{y} & = \rho x - y - xz \\\\ \dot{z} & = -\beta z + xy \end{aligned} \begin{aligned} \dot{x} & = \sigma(y-x) \\\\ \dot{y} & = \rho x - y - xz \\\\ \dot{z} & = -\beta z + xy \end{aligned}
$$ $$
## 交叉乘积 ### 交叉乘积
这在KaTeX中是可行的但在这种环境中馏分的分离不是很好。 这在KaTeX中是可行的但在这种环境中馏分的分离不是很好。
$$ $$
@@ -162,25 +168,25 @@ $$
$$ $$
## 有弹性的括号 ### 有弹性的括号
$$ $$
\left(\frac{x^2}{y^3}\right) \left(\frac{x^2}{y^3}\right)
$$ $$
## 评估范围 ### 评估范围
$$ $$
\left.\frac{x^3}{3}\right|_0^1 \left.\frac{x^3}{3}\right|_0^1
$$ $$
## 诊断标准 ### 诊断标准
$$ $$
f(n) = \begin{cases} \frac{n}{2}, & \text{if } n\text{ is even} \\\\ 3n+1, & \text{if } n\text{ is odd} \end{cases} f(n) = \begin{cases} \frac{n}{2}, & \text{if } n\text{ is even} \\\\ 3n+1, & \text{if } n\text{ is odd} \end{cases}
$$ $$
## 麦克斯韦方程组 ### 麦克斯韦方程组
$$ $$
\begin{aligned} \nabla \times \vec{\mathbf{B}} -\, \frac1c\, \frac{\partial\vec{\mathbf{E}}}{\partial t} & = \frac{4\pi}{c}\vec{\mathbf{j}} \\\\ \nabla \cdot \vec{\mathbf{E}} & = 4 \pi \rho \\\\ \nabla \times \vec{\mathbf{E}}\, +\, \frac1c\, \frac{\partial\vec{\mathbf{B}}}{\partial t} & = \vec{\mathbf{0}} \\\\ \nabla \cdot \vec{\mathbf{B}} & = 0 \end{aligned} \begin{aligned} \nabla \times \vec{\mathbf{B}} -\, \frac1c\, \frac{\partial\vec{\mathbf{E}}}{\partial t} & = \frac{4\pi}{c}\vec{\mathbf{j}} \\\\ \nabla \cdot \vec{\mathbf{E}} & = 4 \pi \rho \\\\ \nabla \times \vec{\mathbf{E}}\, +\, \frac1c\, \frac{\partial\vec{\mathbf{B}}}{\partial t} & = \vec{\mathbf{0}} \\\\ \nabla \cdot \vec{\mathbf{B}} & = 0 \end{aligned}
$$ $$
@@ -194,19 +200,19 @@ $$
{n \choose k} {n \choose k}
$$ $$
## 分数在分数 ### 分数在分数
$$ $$
\frac{\frac{1}{x}+\frac{1}{y}}{y-z} \frac{\frac{1}{x}+\frac{1}{y}}{y-z}
$$ $$
## n次方根 ### n次方根
$$ $$
\sqrt[n]{1+x+x^2+x^3+\ldots} \sqrt[n]{1+x+x^2+x^3+\ldots}
$$ $$
## 矩阵 ### 矩阵
$$ $$
\begin{pmatrix} a_{11} & a_{12} & a_{13}\\\\ a_{21} & a_{22} & a_{23}\\\\ a_{31} & a_{32} & a_{33} \end{pmatrix} \begin{pmatrix} a_{11} & a_{12} & a_{13}\\\\ a_{21} & a_{22} & a_{23}\\\\ a_{31} & a_{32} & a_{33} \end{pmatrix}
\begin{bmatrix} 0 & \cdots & 0 \\\\ \vdots & \ddots & \vdots \\\\ 0 & \cdots & 0 \end{bmatrix} \begin{bmatrix} 0 & \cdots & 0 \\\\ \vdots & \ddots & \vdots \\\\ 0 & \cdots & 0 \end{bmatrix}

View File

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

View File

@@ -0,0 +1,43 @@
---
title: "没有H1-6标题头和评论的文章"
description: "用于测试在没有H1-6标题头时文章的目录导航是否会直接关闭并关闭评论功能。"
keywords: "toc,header"
date: 2022-10-06T09:02:26+08:00
lastmod: 2022-10-30T21:03:16+08:00
categories:
- 示例文章
tags:
- toc
- 标题
comment:
enable: false
url: "post/no-header-title.html"
---
刘慈欣2018克拉克奖获奖感言部分内容节选
> 用于测试在没有H1-6标题头时文章的目录导航是否会直接关闭并关闭评论功能。
<!--more-->
先生们、女士们,晚上好,
很荣幸获得Clarke Award for Imagination in Service to Society Award。
这个奖项是对想象力的奖励,而想象力是人类所拥有的一种似乎只应属于神的能力,它存在的意义也远超出我们的想象。有历史学家说过,人类之所以能够超越地球上的其它物种建立文明,主要是因为他们能够在自己的大脑中创造出现实中不存在的东西。在未来,当人工智能拥有超过人类的智力时,想象力也许是我们对于它们所拥有的惟一优势。
科幻小说是基于想象力的文学而最早给我留下深刻印象的是Arthur . Clarke的作品。除了Jules Verne和George Wells外Clarke的作品是最早进入中国的西方现代科幻小说。在上世纪八十年代初中国出版了他的《2001:A Space Odyssey》和《Rendezvous With Rama》。当时文革刚刚结束旧的生活和信仰已经崩塌新的还没有建立起来我和其他年轻人一样心中一片迷茫。这两本书第一次激活了我想象力思想豁然开阔许多有小溪流进大海的感觉。读完《2001:A Space Odyssey》的那天深夜我走出家门仰望星空那时的中国的天空还没有太多的污染能够看到银河在我的眼中星空与过去完全不一样了我第一次对宇宙的宏大与神秘产生了敬畏感这是一种宗教般的感觉。而后来读到的《Rendezvous With Rama》也让我惊叹如何可以用想象力构造一个栩栩如生的想象世界。正是Clarke带给我的这些感受让我后来成为一名科幻作家。
现在,三十多年过去了,我渐渐发现,我们这一代在上世纪六十年代出生于中国的人,很可能是人类历史上最幸运的人,因为之前没有任何一代人,像我们这样目睹周围的世界发生了如此巨大的变化,我们现在生活的世界,与我们童年的世界已经完全是两个不同的世界,而这种变化还在加速发生着。中国是一个充满着未来感的国度,中国的未来可能充满着挑战和危机,但从来没有像现在这样具有吸引力,这就给科幻小说提供了肥沃的土壤,使其在中国受到了空前的关注,作为一个在六十年代出生在中国的科幻小说家,则是幸运中的幸运。
我期待有那么一天,像那些曾经描写过信息时代的科幻小说一样,描写太空航行的科幻小说也变的平淡无奇了,那时的火星和小行星带都是乏味的地方,有无数的人在那里谋生;木星和它众多的卫星已成为旅游胜地,阻止人们去那里的唯一障碍就是昂贵的价格。
但即使在这个时候,宇宙仍是一个大的无法想象的存在,距我们最近的恒星仍然遥不可及。浩瀚的星空永远能够承载我们无穷的想象力。
谢谢大家。
> [点击阅读全文](https://weread.qq.com/web/reader/ce032b305a9bc1ce0b0dd2akecc32f3013eccbc87e4b62e)

View File

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

View File

@@ -7,7 +7,8 @@ date: 2022-06-07T19:09:52+08:00
lastmod: 2022-06-07T19:09:52+08:00 lastmod: 2022-06-07T19:09:52+08:00
categories: categories:
- 示例 - 示例文章
- 语法
tags: tags:
- 语法 - 语法
- 高亮 - 高亮
@@ -66,7 +67,7 @@ print "Hello, world!"
### Git 对比 ### Git 对比
``` diff {hl_lines=[4,"6-7"] linenos=true} ```diff {hl_lines=[4,"6-7"], linenos=true}
*** /path/to/original ''timestamp'' *** /path/to/original ''timestamp''
--- /path/to/new ''timestamp'' --- /path/to/new ''timestamp''
*************** ***************

View File

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

View File

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

View File

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

@@ -0,0 +1 @@
<img src="/imgs/img-lazy-loading.gif" data-src="{{ .Destination | safeURL }}" alt="{{ .Text }}" {{ with .Title}} title="{{ . }}"{{ end }} />

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 }}> <a href="{{ .Destination | safeURL }}" title="{{ .Text }}" {{ if $extURL }}rel="noopener external nofollow noreferrer" target="_blank" class=" exturl"{{ end }}>
{{ .Text | safeHTML }} {{ .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> <i class="fa fa-external-link-alt"></i>
{{- end }} {{ end }}
</a> </a>

View File

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

View File

@@ -1,12 +1,13 @@
[ [
{{- range $index, $entry := where .Site.RegularPages "Kind" "page" }} {{ range $index, $entry := where .Site.RegularPages "Kind" "page" }}
{{- if $index }}, {{ end }} {{ if $index }}, {{ end }}
{ {
"objectID": "{{ .Date.Unix }}",
"permalink": "{{ .Permalink | relURL }}", "permalink": "{{ .Permalink | relURL }}",
"title": {{ .Title | jsonify }}, "title": {{ .Title | jsonify }},
"content": {{ .Plain | jsonify }}, "content": {{ .Plain | jsonify | safeJS }},
"date": {{ .Date.Format $.Site.Params.timeFormat | jsonify }}, "date": {{ .Date.Format $.Site.Params.timeFormat | jsonify }},
"updated": {{ .Lastmod.Format $.Site.Params.timeFormat | jsonify }} "updated": {{ .Lastmod.Format $.Site.Params.timeFormat | jsonify }}
} }
{{- end }} {{ end }}
] ]

View File

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

View File

@@ -1,15 +1,15 @@
{{- define "title" }} {{ define "title" }}
{{- .Params.Title | default (T .Section) | default .Section }} - {{ .Site.Title -}} {{ .Params.Title | default (T .Section) | default .Section }} - {{ .Site.Title }}
{{- end -}} {{ end }}
{{ 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" "==" .Section) }} {{ $paginator := .Paginate (where .Site.RegularPages "Section" "==" .Section) }}
{{- range $paginator.Pages }} {{ range $paginator.Pages }}
{{ partial "post.html" (dict "ctx" . "IsHome" true) }} {{ 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) }} {{ partial "post.html" (dict "ctx" . "IsHome" false) }}
{{- end }} {{ end }}

View File

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

View File

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

View File

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

View File

@@ -0,0 +1,11 @@
{{/* Get third party js plugins resource */}}
{{ $pluginPath := printf "%s/%s/%s" "js/third-party" .class .plugin }}
{{ $targetPath := printf "js/%s" .plugin }}
{{ $plugin := resources.Get $pluginPath | resources.ExecuteAsTemplate $targetPath .ctx }}
{{ if hugo.IsProduction }}
{{ $plugin = $plugin | minify | fingerprint }}
{{ end }}
<script type="text/javascript" src="{{ $plugin.RelPermalink }}" defer></script>

View File

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

View File

@@ -4,8 +4,12 @@
script.charset = "UTF-8"; script.charset = "UTF-8";
script.src = "{{ .Site.Data.resources.analytics.busuanzi }}"; script.src = "{{ .Site.Data.resources.analytics.busuanzi }}";
script.async = "true" script.async = false
script.defer = true
document.head.appendChild(script); document.head.appendChild(script);
script.onload = function() {
NexT.utils.fmtBusuanzi();
}
}); });
</script> </script>

View File

@@ -1,28 +0,0 @@
<!-- Load math render scripts -->
{{ $math := .Params.math | default .Site.Params.math }}
{{- partial "scripts/plugins.html" (dict "vendor" (.Scratch.Get "vendor") "router" (.Scratch.Get "router") "res" .Site.Data.resources.plugins "index" $math) }}
{{ if eq $math "katex" }}
<script type="text/javascript">
document.addEventListener("DOMContentLoaded", function() {
renderMathInElement(document.body, {
delimiters: [
{left: '$$', right: '$$', display: true},
{left: '$', right: '$', display: false},
{left: '\\(', right: '\\)', display: false},
{left: '\\[', right: '\\]', display: true}
],
throwOnError : false
});
});
</script>
{{ end }}
{{ if eq $math "mathjax" }}
<script type="text/javascript">
window.MathJax = {
tex: {
inlineMath: [["$", "$"]],
}
};
</script>
{{ end }}

View File

@@ -1,15 +0,0 @@
{{- partial "scripts/plugins.html" (dict "vendor" (.Scratch.Get "vendor") "router" (.Scratch.Get "router") "res" .Site.Data.resources.plugins "index" "mermaid") }}
<script type="text/javascript">
document.addEventListener('DOMContentLoaded', () => {
mermaid.initialize({
sequence: {
showSequenceNumbers: true,
actorMargin: 50,
diagramMarginX:10,
diagramMarginY:10
}
});
});
</script>

View File

@@ -8,7 +8,21 @@
</span> </span>
</div> </div>
<div class="search-result-container"> <div class="search-result-container">
<div class="algolia-stats"><hr></div>
<div class="algolia-hits"></div> <div class="algolia-hits"></div>
<div class="algolia-pagination"></div> </div>
<div class="search-footer">
<div class="algolia-pagination"></div>
<div class="search-meta-info">
<div class="search-hit-stats algolia-stats"></div>
<div class="search-vendor">
<span>Search By</span>
{{ $domain := .Site.Data.config.domain }}
{{ if and .Site.BaseURL (ne .Site.BaseURL '/') }}
{{ $domain = .Site.BaseURL }}
{{ end }}
<a title="Algolia" target="_blank" href="https://www.algolia.com/?utm_source=instantsearch.js&utm_medium=website&utm_content={{ (urls.Parse $domain).Host }}&utm_campaign=poweredby">
<img src="/imgs/algolia-logo.svg"/>
</a>
</div>
</div>
</div> </div>

View File

@@ -4,7 +4,7 @@
</span> </span>
<div class="search-input-container"> <div class="search-input-container">
<input autocomplete="off" autocapitalize="off" maxlength="80" <input autocomplete="off" autocapitalize="off" maxlength="80"
placeholder="{{ T "SearchPh" }}" spellcheck="false" placeholder="{{ T "Search.placeholder" }}" spellcheck="false"
type="search" class="search-input"> type="search" class="search-input">
</div> </div>
<span class="popup-btn-close" role="button"> <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> <div class="addthis_inline_share_toolbox" style="text-align: center;"></div>
{{- end }} {{ end }}

View File

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

View File

@@ -1,6 +1,6 @@
{{- $ft := .Site.Params.footer }} {{ $ft := .Site.Params.footer }}
{{ if $ft.translate }} {{ if $ft.translate }}
<div class="google-translate"> <div id="gtranslate" class="google-translate">
<i class="fa fa-language"></i> <i class="fa fa-language"></i>
<div id="google_translate_element"></div> <div id="google_translate_element"></div>
</div> </div>
@@ -8,81 +8,55 @@
<div class="copyright"> <div class="copyright">
&copy; &copy;
<span itemprop="copyrightYear"> <span itemprop="copyrightYear">
{{- $year := now.Year }} {{ $year := now.Year }}
{{- if isset $ft "since" }} {{ if isset $ft "since" }}
{{- if gt $year $ft.since }} {{ if gt $year $ft.since }}
{{ $ft.since }} - {{ $year }} {{ $ft.since }} - {{ $year }}
{{- else }} {{ else }}
{{ $year }} {{ $year }}
{{- end }} {{ end }}
{{- else }} {{ else }}
{{ $year }} {{ $year }}
{{- end }} {{ end }}
</span> </span>
<span class="with-love"> <span class="with-love">
<i class="{{ $ft.icon.name }}"></i> <i class="{{ $ft.icon.name }}"></i>
</span> </span>
<span class="author" itemprop="copyrightHolder">{{ $ft.copyright | default .Site.Params.author }}</span> <span class="author" itemprop="copyrightHolder">{{ $ft.copyright | default .Site.Params.author }}</span>
</div> </div>
{{- with .Site.Params.busuanzi }} {{ if $ft.powered }}
{{- if .enable }}
<div class="busuanzi-count">
{{- if .visitors }}
<span class="post-meta-item" id="busuanzi_container_site_uv" title="{{ T "VisitorsLabel" }}">
<span class="post-meta-item-icon">
<i class="{{ .visitorsIcon }}"></i>
</span>
<span class="site-uv" >
<span id="busuanzi_value_site_uv"></span>
</span>
</span>
{{- end }}
{{- if .views }}
<span class="post-meta-item" id="busuanzi_container_site_pv" title="{{ T "PageViewsLabel" }}">
<span class="post-meta-item-icon">
<i class="{{ .viewsIcon }}"></i>
</span>
<span class="site-pv">
<span id="busuanzi_value_site_pv"></span>
</span>
</span>
{{- end }}
</div>
{{- end }}
{{- end }}
{{- if $ft.powered }}
<div class="powered-by"> <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 }} {{ $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> </div>
{{- end }} {{ end }}
{{- with $ft.beian }} {{ with $ft.beian }}
{{- if .enable }} {{ if .enable }}
<div class="beian"> <div class="beian">
<a href="https://beian.miit.gov.cn" target="_blank">{{ .icp }}</a> <a href="https://beian.miit.gov.cn" target="_blank">{{ .icp }}</a>
<img src="/imgs/gongan.png" alt="{{ .provinceAbbr }}公网安备"> <img src="/imgs/gongan.png" alt="{{ .provinceAbbr }}公网安备">
<a href="http://www.beian.gov.cn/portal/registerSystemInfo?recordcode={{ .gonganNum }}" target="_blank">{{ .provinceAbbr }}公网安备 {{ .gonganNum }} 号</a> <a href="http://www.beian.gov.cn/portal/registerSystemInfo?recordcode={{ .gonganNum }}" target="_blank">{{ .provinceAbbr }}公网安备 {{ .gonganNum }} 号</a>
</div> </div>
{{- end }} {{ end }}
{{- end }} {{ end }}
{{- with $ft.vendors }} {{ with $ft.vendors }}
{{ if .enable }} {{ if .enable }}
<div class="vendors-list"> <div class="vendors-list">
{{- range .list }} {{ range .list }}
<a target="_blank" href="{{ .link }}" title="{{ .name }}"> <a target="_blank" href="{{ .link }}" title="{{ .name }}">
{{- if .image }} {{ if .image }}
<img src="{{ .image.url }}" alt="{{ .name }}" /> <img src="/imgs/img-lazy-loading.gif" data-src="{{ .image.url }}" alt="{{ .name }}" />
{{- else }} {{ else }}
{{ .name }} {{ .name }}
{{- end }} {{ end }}
</a> </a>
{{- end }} {{ end }}
<span>{{ .title }}</span> <span>{{ .title }}</span>
</div> </div>
{{- end }} {{ end }}
{{- end }} {{ end }}
{{- $custom := .Scratch.Get "footer" }} {{ $custom := .Scratch.Get "footer" }}
{{- if $custom }} {{ if $custom }}
{{ partialCached $custom . }} {{ partialCached $custom . }}
{{- end }} {{ end }}

View File

@@ -1,10 +1,65 @@
{{- partial "head/meta.html" . }} {{ partial "head/meta.html" . }}
{{- partial "head/opengraph.html" . }} {{ partial "head/opengraph.html" . }}
{{- partial "head/twitter.html" . }} {{ partial "head/twitter.html" . }}
{{- partial "head/googleplus.html" . }} {{ partial "head/googleplus.html" . }}
{{- partial "head/facebook.html" . }} {{ partial "head/facebook.html" . }}
{{- partialCached "head/verify.html" . }} {{ partial "head/verify.html" . }}
{{- partialCached "head/style.html" . }} {{ partialCached "head/style.html" . }}
{{- partial "head/config.html" . }} <script type="text/javascript">
{{- partialCached "head/analytics.html" . }} (function(){
localDB = {
set: function (key, value, ttl) {
if (ttl === 0) return;
const now = new Date();
const expiryDay = ttl * 86400000;
const item = {
value: value,
expiry: now.getTime() + expiryDay
};
localStorage.setItem(key, JSON.stringify(item));
},
get: function (key) {
const itemStr = localStorage.getItem(key);
if (!itemStr) {
return undefined;
}
const item = JSON.parse(itemStr);
const now = new Date();
if (now.getTime() > item.expiry) {
localStorage.removeItem(key);
return undefined;
}
return item.value;
}
};
theme = {
active: function() {
const localState = localDB.get('theme');
if (localState == undefined) return;
theme.toggle(localState);
window.matchMedia("(prefers-color-scheme: dark)").addListener(function (evt) {
theme.toggle(evt.matches ? 'dark' : 'light');
});
},
toggle: function (theme) {
document.documentElement.setAttribute('data-theme', theme);
localDB.set('theme', theme, 2);
const iframe = document.querySelector('iframe.giscus-frame');
if (iframe) {
const config = { setConfig: { theme: theme } };
iframe.contentWindow.postMessage({ giscus: config }, 'https://giscus.app');
}
}
};
theme.active();
})(window);
</script>
{{ 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" . }} {{ partial "_thirdparty/analytics/51la.html" . }}
{{- end }} {{ end }}
{{- if isset .Site.Params.analytics "baidu" }} {{ if isset .Site.Params.analytics "baidu" }}
{{ partial "_thirdparty/analytics/baidu.html" . }} {{ partial "_thirdparty/analytics/baidu.html" . }}
{{- end }} {{ end }}
{{- if isset .Site.Params.analytics "google" }} {{ if isset .Site.Params.analytics "google" }}
{{ partial "_thirdparty/analytics/google.html" . }} {{ partial "_thirdparty/analytics/google.html" . }}
{{- end }} {{ end }}
{{- if isset .Site.Params.analytics "busuanzi" }} {{ if or (isset .Site.Params.analytics "busuanzi") (eq .Site.Params.postMeta.views.plugin "busuanzi") }}
{{ partial "_thirdparty/analytics/busuanzi.html" . }} {{ partial "_thirdparty/analytics/busuanzi.html" . }}
{{- end }} {{ end }}

View File

@@ -1,10 +1,40 @@
<script class="next-config" data-name="page" type="application/json"> {{ $pageCfg := dict
{{- dict
"isHome" .IsHome "isHome" .IsHome
"isPage" .IsPage "isPage" .IsPage
"comments" (.Params.comments | default .Site.Params.comments.enable) "comments" (.Scratch.Get "isComment")
"permalink" (.Page.Permalink | absURL) "permalink" (.Page.Permalink | absURL)
"path" (.Page.Permalink | path.Base) "path" (.Page.Permalink | path.Base)
"title" .Page.Title "title" .Page.Title
-}} }}
</script>
{{/* Append waline pageview & comment plugin */}}
{{ 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
}}
{{ $pageCfg = merge $pageCfg (dict "waline" $counter) }}
{{ end }}
{{/* Append mermaid plugin */}}
{{ if .Params.mermaid }}
{{ $mermaid := dict
"js" .Site.Data.resources.plugins.mermaid.js
}}
{{ $pageCfg = merge $pageCfg (dict "mermaid" $mermaid) }}
{{ end }}
{{/* Append math render plugin */}}
{{ with or .Params.math .Site.Params.math }}
{{ $math := dict
"render" .
"js" (index $.Site.Data.resources.plugins .).js
}}
{{ if eq . "katex" }}
{{ $math = merge $math ( dict "css" $.Site.Data.resources.plugins.katex.css ) }}
{{ end }}
{{ $pageCfg = merge $pageCfg (dict "math" $math) }}
{{ end }}
<script class="next-config" data-name="page" type="application/json">{{ $pageCfg }}</script>

View File

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

View File

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

View File

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

View File

@@ -1,10 +1,10 @@
<meta charset="UTF-8"> <meta charset="UTF-8">
<meta name="viewport" content="width=device-width"> <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)" /> <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)" /> <meta name="theme-color" content="{{ .Site.Params.themeColor.light }}" media="(prefers-color-scheme: light)" />
{{- end }} {{ end }}
{{ hugo.Generator }} {{ hugo.Generator }}
<link rel="shortcut icon" type="image/x-icon" href="{{ .Site.Params.favicon.icon }}"> <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 }}"> <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 }}"> <link rel="apple-touch-icon" sizes="180x180" href="{{ .Site.Params.favicon.appleTouchIcon }}">
<meta itemprop="name" content="{{ .Title }}" /> <meta itemprop="name" content="{{ .Title }}" />
<meta itemprop="description" content="{{ .Description | default .Site.Params.description }}" /> <meta itemprop="description" content="{{ .Description | default .Site.Params.description }}" />
{{- if .IsPage }} {{ if .IsPage }}
{{- with .Date }} {{ with .Date }}
<meta itemprop="datePublished" {{ . }} /> <meta itemprop="datePublished" {{ . }} />
{{- end }} {{ end }}
{{- with .Lastmod }} {{ with .Lastmod }}
<meta itemprop="dateModified" {{ . }} /> <meta itemprop="dateModified" {{ . }} />
{{- end }} {{ end }}
{{- end }} {{ end }}
{{- $img := .Site.Params.customLogo | default .Site.Params.avatar.url }} {{ $img := .Site.Params.customLogo | default .Site.Params.avatar.url }}
{{- if and .IsPage (isset .Params "images") }} {{ if and .IsPage (isset .Params "images") }}
{{- $img := index .Params.images 0 }} {{ $img := index .Params.images 0 }}
{{- end }} {{ end }}
{{- .Scratch.Set "metaImg" $img }} {{ .Scratch.Set "metaImg" $img }}
<meta itemprop="image" content="{{ $img | absURL }}" /> <meta itemprop="image" content="{{ $img | absURL }}" />
<meta itemprop="keywords" content="{{ if and .IsPage (isset .Params "tags")}}{{ delimit .Params.tags "," }}{{ else }}{{ .Site.Params.keywords }}{{ end }}" /> <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 -}} {{ $Site := .Site }}
{{- $Params := .Site.Params -}} {{ $Params := .Site.Params }}
{{- $Page := .Page -}} {{ $Page := .Page }}
{{- $langCode := .Scratch.Get "langCode" -}} {{ $langCode := .Scratch.Get "langCode" }}
{{- with .Site.Params.openGraph -}} {{ with .Site.Params.openGraph }}
{{- if .enable -}} {{ if .enable }}
<meta property="og:type" content="website"> <meta property="og:type" content="website">
<meta property="og:title" content="{{ $Page.Title }}"> <meta property="og:title" content="{{ $Page.Title }}">
<meta property="og:description" content="{{ default $Params.description $Page.Description }}"> <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:site_name" content="{{ $Site.Title }}">
<meta property="og:locale" content="{{ $langCode }}"> <meta property="og:locale" content="{{ $langCode }}">
<meta property="article:author" content="{{ default $Params.author $Page.Params.Author }}"> <meta property="article:author" content="{{ default $Params.author $Page.Params.Author }}">
{{- with .twitter -}} {{ with .twitter }}
{{- range $attr, $val := . }} {{ range $attr, $val := . }}
<meta name="twitter:{{ $attr }}" content="{{ $val }}"> <meta name="twitter:{{ $attr }}" content="{{ $val }}">
{{- end -}} {{ end }}
{{- end -}} {{ end }}
{{- with .googlePlus }} {{ with .googlePlus }}
<link rel="publisher" href=" {{ . }}"> <link rel="publisher" href=" {{ . }}">
{{- end -}} {{ end }}
{{- with .facebook -}} {{ with .facebook }}
{{- range $attr, $val := . }} {{ range $attr, $val := . }}
<meta property="fb:{{ $attr }}" content="{{ $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:type" content="{{ if .IsPage }}article{{ else }}website{{ end }}" />
<meta property="og:title" content="{{ .Title | default .Site.Title }}" /> <meta property="og:title" content="{{ .Title | default .Site.Title }}" />
<meta property="og:description" content="{{ .Description | default .Site.Params.Description }}" /> <meta property="og:description" content="{{ .Description | default .Site.Params.Description }}" />
@@ -9,9 +9,9 @@
<meta property="og:url" content="{{ .Permalink }}"/> <meta property="og:url" content="{{ .Permalink }}"/>
<meta property="og:site_name" content="{{ .Site.Title }}" /> <meta property="og:site_name" content="{{ .Site.Title }}" />
<meta property="og:locale" content="{{ .Site.LanguageCode }}"/> <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:author" content="{{ .Params.Author | default .Site.Params.Author }}" />
<meta property="article:published_time" content="{{ .Date }}" /> <meta property="article:published_time" content="{{ .Date }}" />
<meta property="article:modified_time" content="{{ .Lastmod }}" /> <meta property="article:modified_time" content="{{ .Lastmod }}" />
{{- end }} {{ end }}
{{- end }} {{ end }}

View File

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

View File

@@ -1,5 +1,5 @@
{{- with .Site.Params.openGraph.twitter }} {{ with .Site.Params.openGraph.twitter }}
{{- $img := $.Params.openGraph.twitter.image | default ($.Scratch.Get "metaImg") }} {{ $img := $.Params.openGraph.twitter.image | default ($.Scratch.Get "metaImg") }}
<meta name="twitter:card" content="summary_large_image"/> <meta name="twitter:card" content="summary_large_image"/>
<meta name="twitter:creator" content="{{ .creator }}"/> <meta name="twitter:creator" content="{{ .creator }}"/>
<meta name="twitter:description" content="{{ with $.Page.Description }}{{ . }}{{ else }}{{if $.Page.IsPage}}{{ .Summary }}{{ else }}{{ $.Params.description }}{{ end }}{{ end }}"/> <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 }} {{ if .IsHome }}
{{- with .Site.Params.googleSiteVerification }} {{ with .Site.Params.googleSiteVerification }}
<meta name="google-site-verification" content="{{ . }}"> <meta name="google-site-verification" content="{{ . }}">
{{- end }} {{ end }}
{{- with .Site.Params.bingSiteVerification }} {{ with .Site.Params.bingSiteVerification }}
<meta name="msvalidate.01" content="{{ . }}"> <meta name="msvalidate.01" content="{{ . }}">
{{- end }} {{ end }}
{{- with .Site.Params.yandexSiteVerification }} {{ with .Site.Params.yandexSiteVerification }}
<meta name="yandex-verification" content="{{ . }}"> <meta name="yandex-verification" content="{{ . }}">
{{- end }} {{ end }}
{{- with .Site.Params.baiduSiteVerification }} {{ with .Site.Params.baiduSiteVerification }}
<meta name="baidu-site-verification" content="{{ . }}"> <meta name="baidu-site-verification" content="{{ . }}">
{{- end }} {{ end }}
{{ end }} {{ end }}

View File

@@ -1,3 +1,3 @@
{{ partial "header/brand.html" . }} {{ partialCached "header/brand.html" . }}
{{ partial "header/menus.html" . }} {{ partial "header/menus.html" . }}
{{ partial "header/search.html" . }} {{ partialCached "header/search.html" . }}

View File

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

View File

@@ -1,25 +1,25 @@
{{- $ms := .Site.Params.menuSets }} {{ $ms := .Site.Params.menuSets }}
{{- $curP := .Page }} {{ $curP := .Page }}
<nav class="site-nav"> <nav class="site-nav">
<ul class="main-menu menu"> <ul class="main-menu menu">
{{- range .Site.Menus.main }} {{ range .Site.Menus.main }}
{{- $active := $curP.IsMenuCurrent "main" . }} {{ $active := $curP.IsMenuCurrent "main" . }}
<li class="menu-item menu-item-{{ .Identifier }}"> <li class="menu-item menu-item-{{ .Identifier }}">
<a href="{{ .URL | relLangURL }}" class="hvr-icon-pulse {{if $active }} menu-item-active{{ end }}" rel="section"> <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 $ms.icons }}<i class="fa fa-{{ .Pre }} hvr-icon"></i>{{ end }}{{ .Name }}
{{- if and $ms.badges (eq .Identifier "archives") }} {{ if and $ms.badges (eq .Identifier "archives") }}
<span class="badge">{{ $.Scratch.Get "postsCount" }}</span> <span class="badge">{{ $.Scratch.Get "postsCount" }}</span>
{{- end }} {{ end }}
</a> </a>
</li> </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"> <li class="menu-item menu-item-search">
<a role="button" class="popup-trigger hvr-icon-pulse"> <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> </a>
</li> </li>
{{- end }} {{ end }}
</ul> </ul>
</nav> </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="search-pop-overlay">
<div class="popup search-popup"> <div class="popup search-popup">
{{- if .Site.Params.algoliaSearch.enable }} {{ if .Site.Params.algoliaSearch.enable }}
{{ partial "_thirdparty/search/algolia.html" . }} {{ partial "_thirdparty/search/algolia.html" . }}
{{- else if .Site.Params.localSearch.enable }} {{ else if .Site.Params.localSearch.enable }}
{{ partial "_thirdparty/search/local.html" . }} {{ partial "_thirdparty/search/local.html" . }}
{{- end }} {{ end }}
</div> </div>
</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 := 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 "catsCount" (len .Site.Taxonomies.categories) }}
{{ $globalVars.Set "tagsCount" (len .Site.Taxonomies.tags) }} {{ $globalVars.Set "tagsCount" (len .Site.Taxonomies.tags) }}
@@ -37,10 +39,10 @@
"lazyload" .Site.Params.lazyload "lazyload" .Site.Params.lazyload
"motion" .Site.Params.motion "motion" .Site.Params.motion
"i18n" (dict "i18n" (dict
"placeholder" (T "SearchPh") "placeholder" (T "Search.placeholder")
"empty" (T "SearchEmpty") "empty" (T "Search.empty")
"hits_time" (T "SearchHitsTime") "hits_time" (T "Search.time")
"hits" (T "SearchHits") "hits" (T "Search.hits")
"ds_years" (T "DateSuffix.years") "ds_years" (T "DateSuffix.years")
"ds_days" (T "DateSuffix.days") "ds_days" (T "DateSuffix.days")
"ds_hours" (T "DateSuffix.hours") "ds_hours" (T "DateSuffix.hours")
@@ -58,6 +60,16 @@
{{ $config = merge $config $localSearch }} {{ $config = merge $config $localSearch }}
{{ end }} {{ end }}
{{ with .Site.Params.postMeta }}
{{ $postmeta := dict
"views" .views
"comments" .comments
}}
{{ $config = merge $config (dict "postmeta" $postmeta) }}
{{ else }}
{{ end }}
{{ if .Site.Params.algoliaSearch.enable }} {{ if .Site.Params.algoliaSearch.enable }}
{{ $algoliaSearch := dict {{ $algoliaSearch := dict
"js" .Site.Data.resources.algolia "js" .Site.Data.resources.algolia
@@ -114,6 +126,19 @@
{{ $config = merge $config (dict "addthis" $addthis) }} {{ $config = merge $config (dict "addthis" $addthis) }}
{{ end }} {{ end }}
{{ with .Site.Params.siteState.statistic }}
{{ $statis := dict "statis" . }}
{{ $config = merge $config $statis }}
{{ end }}
{{ with .Site.Params.analytics.laId }}
{{ $lawidget := dict
"js" $.Site.Data.resources.analytics.laWidget
"id" .
}}
{{ $config = merge $config (dict "lawidget" $lawidget) }}
{{ end }}
{{ $globalVars.Set "config" $config }} {{ $globalVars.Set "config" $config }}
{{ with .Site.Params.customFilePath }} {{ with .Site.Params.customFilePath }}
@@ -122,4 +147,10 @@
{{ end }} {{ end }}
{{ end }} {{ end }}
{{ $theme := "light" }}
{{ if .Site.Params.darkmode }}
{{ $theme = "dark" }}
{{ end }}
{{ $globalVars.Set "theme" $theme }}
{{ return $globalVars.Values }} {{ return $globalVars.Values }}

View File

@@ -12,16 +12,16 @@
</time> </time>
</div> </div>
<div class="post-title"> <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=""> <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> <i class="fa fa-external-link-alt"></i>
</a> </a>
{{- else }} {{ else }}
<a class="post-title-link" href="{{ .RelPermalink | relLangURL }}" itemprop="url"> <a class="post-title-link" href="{{ .RelPermalink | relLangURL }}" itemprop="url">
<span itemprop="name">{{ .Title }}</span> <span itemprop="name">{{ .Title }}</span>
</a> </a>
{{- end }} {{ end }}
</div> </div>
</header> </header>
</article> </article>

View File

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

View File

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

View File

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

Some files were not shown because too many files have changed in this diff Show More