Compare commits
292 Commits
Author | SHA1 | Date | |
---|---|---|---|
1755d5d5b2 | |||
73b06f3cd4 | |||
![]() |
6bc9a57c00 | ||
![]() |
3e604cbdeb | ||
![]() |
bbf2d4f813 | ||
![]() |
3eda3ac083 | ||
![]() |
a6991680b8 | ||
![]() |
7a307a72a0 | ||
![]() |
13d9ad7f32 | ||
![]() |
8b2c9e1482 | ||
![]() |
86e8ee7e7d | ||
![]() |
495ac97dbd | ||
![]() |
af3de3609d | ||
![]() |
3bffe42e3e | ||
![]() |
d738b144b3 | ||
![]() |
f7983d906a | ||
![]() |
5190eb1920 | ||
![]() |
ee7ce903ff | ||
![]() |
abec39b9ec | ||
![]() |
6d65d92943 | ||
![]() |
f215616230 | ||
![]() |
60b14e65e9 | ||
![]() |
0b8bdc0e00 | ||
![]() |
4ec1f8e732 | ||
![]() |
65a7a9c536 | ||
![]() |
23e220b5f3 | ||
![]() |
e9297ac28b | ||
![]() |
ba5ae7c295 | ||
![]() |
9cd3e0bf68 | ||
![]() |
b2e0be5a6a | ||
![]() |
088da43913 | ||
![]() |
351d6728d0 | ||
![]() |
27d3a33222 | ||
![]() |
2ab1e3ae47 | ||
![]() |
8051ec1f09 | ||
![]() |
b559782447 | ||
![]() |
9aaaf388f8 | ||
![]() |
edb57eea34 | ||
![]() |
f955bcfa85 | ||
![]() |
45f7a84631 | ||
![]() |
f7f5311e6f | ||
![]() |
c4649b8284 | ||
![]() |
56526c8dac | ||
![]() |
df8f88f9c7 | ||
![]() |
bb7d753e4b | ||
![]() |
a736e8d11c | ||
![]() |
ae09494361 | ||
![]() |
ee4a22d88a | ||
![]() |
976af2c92d | ||
![]() |
fdfcadadcc | ||
![]() |
4e2229a73a | ||
![]() |
1c07248765 | ||
![]() |
ebd38a18ae | ||
![]() |
f92118257a | ||
![]() |
e6ee562996 | ||
![]() |
85c3eb9d3b | ||
![]() |
77da27a94b | ||
![]() |
27ca39f39e | ||
![]() |
1076ba9282 | ||
![]() |
b8ac0c8f95 | ||
![]() |
569b733e2a | ||
![]() |
67b5ae3a3a | ||
![]() |
d155afe2ae | ||
![]() |
e6abae4d5c | ||
![]() |
119b715655 | ||
![]() |
1b98206cad | ||
![]() |
9e42b3fad1 | ||
![]() |
d560e45ca2 | ||
![]() |
046bb90685 | ||
![]() |
e86002e941 | ||
![]() |
f8ac686c1c | ||
![]() |
082fb48650 | ||
![]() |
c07ff1df05 | ||
![]() |
c5c1f03557 | ||
![]() |
4e05bfb399 | ||
![]() |
30212827f0 | ||
![]() |
5aaeae2885 | ||
![]() |
526a4b7005 | ||
![]() |
b4fd858b94 | ||
![]() |
ad03e3011e | ||
![]() |
5686c96de2 | ||
![]() |
15933757ca | ||
![]() |
5610d561bb | ||
![]() |
385f0f023b | ||
![]() |
40c36a70f0 | ||
![]() |
25f978e06e | ||
![]() |
a0ce0996e0 | ||
![]() |
15c06f3445 | ||
![]() |
25aff95260 | ||
![]() |
93ec7e56e6 | ||
![]() |
cf47decf89 | ||
![]() |
b27a449dc5 | ||
![]() |
a7c7854617 | ||
![]() |
89a8289f68 | ||
![]() |
11685b9b7b | ||
![]() |
607d67051f | ||
![]() |
8e3409c4af | ||
![]() |
6ebb7d928a | ||
![]() |
509ca385d7 | ||
![]() |
a1117d3403 | ||
![]() |
d5a25fb0cc | ||
![]() |
3b4f87bdbf | ||
![]() |
43d403a019 | ||
![]() |
2ba53504e1 | ||
![]() |
2fe68caed9 | ||
![]() |
f59fca14f8 | ||
![]() |
39e17d6f68 | ||
![]() |
e08456419c | ||
![]() |
8405b789e9 | ||
![]() |
db7095c0bb | ||
![]() |
24229f1802 | ||
![]() |
b7ec24fd1b | ||
![]() |
574be4e134 | ||
![]() |
9453520e2a | ||
![]() |
35fff3e0cc | ||
![]() |
dfcdaf9245 | ||
![]() |
b4c5e79c1b | ||
![]() |
7be11c4b7f | ||
![]() |
03b83da513 | ||
![]() |
ccd85b2436 | ||
![]() |
53ad048763 | ||
![]() |
85871aadfc | ||
![]() |
61079367ef | ||
![]() |
07e199ba11 | ||
![]() |
92a55d49e5 | ||
![]() |
ee86b0d152 | ||
![]() |
53f3a902c1 | ||
![]() |
05dba844d7 | ||
![]() |
d44d4c2a79 | ||
![]() |
a4f496b796 | ||
![]() |
03ebd658ea | ||
![]() |
77a33df023 | ||
![]() |
588740f27b | ||
![]() |
726349a2e0 | ||
![]() |
fbac63d70e | ||
![]() |
c7e4f52499 | ||
![]() |
fdaabac210 | ||
![]() |
76bb84d195 | ||
![]() |
88e6bc5993 | ||
![]() |
3feea66b49 | ||
![]() |
6b589a8206 | ||
![]() |
835e98d85d | ||
![]() |
a2019876a2 | ||
![]() |
dca196c315 | ||
![]() |
85b7dc11ca | ||
![]() |
03fd9dc829 | ||
![]() |
a2f37c8470 | ||
![]() |
d0a6d943e0 | ||
![]() |
fa0f7856bf | ||
![]() |
dac9b379dc | ||
![]() |
a59b6a6f32 | ||
![]() |
40674ad12b | ||
![]() |
b0ad23d764 | ||
![]() |
6db5f5c3f9 | ||
![]() |
7b7b50fe1a | ||
![]() |
73b15c7271 | ||
![]() |
24b135ca4b | ||
![]() |
86b9b5aa50 | ||
![]() |
8918bff71f | ||
![]() |
dd3766bce3 | ||
![]() |
8310dd347d | ||
![]() |
d6de03a2d0 | ||
![]() |
21395a0263 | ||
![]() |
54ada081c7 | ||
![]() |
51221f0f91 | ||
![]() |
f84d590023 | ||
![]() |
7c9b834729 | ||
![]() |
e1c088c355 | ||
![]() |
d609eecb23 | ||
![]() |
08156f22b8 | ||
![]() |
fa414e827a | ||
![]() |
146bf52038 | ||
![]() |
ac712b9277 | ||
![]() |
0d1b00f7b0 | ||
![]() |
9160a33053 | ||
![]() |
525c8a7cf5 | ||
![]() |
90df1e1247 | ||
![]() |
b9511728f3 | ||
![]() |
cc91cd0e07 | ||
![]() |
aaa3a1449f | ||
![]() |
dacf4cd2c7 | ||
![]() |
913ae1821a | ||
![]() |
1ae0ca2488 | ||
![]() |
72972e3a10 | ||
![]() |
50f17ff502 | ||
![]() |
6865ec72c7 | ||
![]() |
0d4e0b9b84 | ||
![]() |
c0ba7eda06 | ||
![]() |
e0cfe0c50c | ||
![]() |
e4cb4f0188 | ||
![]() |
989e2c43dc | ||
![]() |
2d736b8f35 | ||
![]() |
b04c1b9aa0 | ||
![]() |
6a42188853 | ||
![]() |
0536ac37fc | ||
![]() |
0abad2539a | ||
![]() |
48df6401d8 | ||
![]() |
9632707ece | ||
![]() |
ea8a4f1dca | ||
![]() |
bebd279735 | ||
![]() |
9f2b1f37f8 | ||
![]() |
01f2c10ec8 | ||
![]() |
0711770e9f | ||
![]() |
4381eee782 | ||
![]() |
3f8ab12e47 | ||
![]() |
d6fbf924b8 | ||
![]() |
a7b9d5338e | ||
![]() |
1208213476 | ||
![]() |
dd8ffbb179 | ||
![]() |
04bf52abb8 | ||
![]() |
1cb9973dbb | ||
![]() |
4be573b5d3 | ||
![]() |
7592b211c1 | ||
![]() |
28a3d36f88 | ||
![]() |
70cba4cc6a | ||
![]() |
dc1c68d5c9 | ||
![]() |
d4730f89d2 | ||
![]() |
4037ea0d68 | ||
![]() |
523c12f0ec | ||
![]() |
d994042131 | ||
![]() |
56166c7e76 | ||
![]() |
f1fafdc587 | ||
![]() |
9bde077b0b | ||
![]() |
e0c4a0ecd4 | ||
![]() |
f41c3c0a73 | ||
![]() |
f3fc99ac03 | ||
![]() |
20aadcf9ac | ||
![]() |
2cc8f302d3 | ||
![]() |
5634c20a02 | ||
![]() |
e79234935b | ||
![]() |
39058e897d | ||
![]() |
568ef4ecc6 | ||
![]() |
6542375766 | ||
![]() |
6f03209e93 | ||
![]() |
2a7fd9f8fb | ||
![]() |
c38a439171 | ||
![]() |
dc66bc1a05 | ||
![]() |
fb007e57e5 | ||
![]() |
df09cbe4c0 | ||
![]() |
2276aae127 | ||
![]() |
71844813bb | ||
![]() |
784869832e | ||
![]() |
423d4c0ef9 | ||
![]() |
086ce454ff | ||
![]() |
02ba198cfa | ||
![]() |
0db1dac57f | ||
![]() |
c9d4a00120 | ||
![]() |
9c102f9695 | ||
![]() |
5fb6618bd3 | ||
![]() |
3de3e1de4d | ||
![]() |
51eea3acc0 | ||
![]() |
be3bf4e1f2 | ||
![]() |
cbc39591d2 | ||
![]() |
3965c0c108 | ||
![]() |
fc44e79ddd | ||
![]() |
d3eb723e24 | ||
![]() |
b739434f8d | ||
![]() |
36b428f1d9 | ||
![]() |
678b92c0a7 | ||
![]() |
aa8a60d852 | ||
![]() |
30d161b1e2 | ||
![]() |
96ba605026 | ||
![]() |
1677648167 | ||
![]() |
6cf961d392 | ||
![]() |
97799aaaa8 | ||
![]() |
1f668be6fa | ||
![]() |
bb70f5b6a5 | ||
![]() |
fdd49ab3cb | ||
![]() |
1917055634 | ||
![]() |
7ed095d42c | ||
![]() |
ac844e4e8c | ||
![]() |
34faa6f6f3 | ||
![]() |
c1e7e59646 | ||
![]() |
9a4883832f | ||
![]() |
6cbffe48b7 | ||
![]() |
403a2e6f54 | ||
![]() |
832953372a | ||
![]() |
1171bcbfb3 | ||
![]() |
6ffddb602f | ||
![]() |
f430f0730b | ||
![]() |
87301d1d83 | ||
![]() |
e83dbabc3f | ||
![]() |
af59e93d25 | ||
![]() |
d42375820d | ||
![]() |
31f6e21671 | ||
![]() |
a9ff14d312 | ||
![]() |
12fbc945bc | ||
![]() |
ad271c1c20 | ||
![]() |
81cff8a5c2 | ||
![]() |
bf55ada93c | ||
![]() |
1339ffe29b | ||
![]() |
c12cdf7b48 |
2
.github/ISSUE_TEMPLATE/bug-report.md
vendored
2
.github/ISSUE_TEMPLATE/bug-report.md
vendored
@ -12,7 +12,7 @@ labels: bug
|
||||
|
||||
> 请确认如下情况已检查,并将 [ ] 换成 [x] 来选择 (Change [ ] to [x] to selected which your could make sure)
|
||||
|
||||
- [ ] 已使用 Hugo Extended 0.86.0 或更高的版本 (I'm using Hugo Extended version 0.86.0 or later)
|
||||
- [ ] 已使用 Hugo Extended 0.134.0 或更高的版本 (I'm using Hugo Extended version 0.134.0 or later)
|
||||
- [ ] 已使用 Hugo NexT 4.0 或更高的版本 (I'm using Hugo NexT version 4.0 or later)
|
||||
- [ ] 已阅读 [Hugo 故障排除](https://gohugo.io/troubleshooting/)并尝试修复无果 (I had already read the [Troubleshooting page of Hugo](https://gohugo.io/troubleshooting/))
|
||||
- [ ] 已搜索过当前所有[已知问题](https://github.com/hugo-next/hugo-theme-next/issues)和[讨论区](https://github.com/hugo-next/hugo-theme-next/discussions/categories/q-a) ,但没有找到帮助 (I had already searched for current [Issues](https://github.com/hugo-next/hugo-theme-next/issues) and [Q & A](https://github.com/hugo-next/hugo-theme-next/discussions/categories/q-a), which does not help me.)
|
||||
|
16
.gitignore
vendored
16
.gitignore
vendored
@ -1,6 +1,14 @@
|
||||
# Ignore files in Hugo NexT theme
|
||||
|
||||
exampleSite/
|
||||
!exampleSite/content
|
||||
!exampleSite/start.sh
|
||||
!exampleSite/config.yaml
|
||||
# Special files in content folder
|
||||
exampleSite/public/
|
||||
exampleSite/resources/
|
||||
exampleSite/.hugo_build.lock
|
||||
exampleSite/config.dev.yaml
|
||||
exampleSite/config.release.yaml
|
||||
exampleSite/dev-startup.sh
|
||||
|
||||
|
||||
|
||||
# vscode
|
||||
.vscode/
|
||||
|
149
README.md
149
README.md
@ -1,7 +1,7 @@
|
||||
[中文](README.zh.md) | [English](#)
|
||||
[中文](https://github.com/hugo-next/hugo-theme-next/blob/main/README.zh.md) | [English](#)
|
||||
|
||||
<a title="Hugo NexT Website" href="https://preview.hugo-next.eu.org">
|
||||
<img align="right" alt="NexT logo" width="266" src="https://lisenhui.gitee.io/imgs/hugo-next/logo/hugo-next-primary.png">
|
||||
<img align="right" alt="NexT logo" width="266" src="images/hugo-next-primary.png">
|
||||
</a>
|
||||
|
||||
## Hugo NexT
|
||||
@ -10,49 +10,101 @@
|
||||
|
||||
> All page designs & configuration compatibility with Hexo NexT, it's very easy migrate your site from Hexo to Hugo and enjoy yourself.
|
||||
|
||||
[](https://gitter.im/hugo-next/community) [](https://github.com/gohugoio/hugo/releases/latest) [](https://github.com/hugo-next/hugo-theme-next) [](https://github.com/hugo-next/hugo-theme-next/find/main) [](https://github.com/hugo-next/hugo-theme-next/blob/main/LICENSE)
|
||||
[](https://app.gitter.im/#/room/#hugo-next_community:gitter.im) [](https://github.com/gohugoio/hugo/releases/latest) [](https://github.com/hugo-next/hugo-theme-next) [](https://github.com/hugo-next/hugo-theme-next/graphs/contributors) [](https://github.com/hugo-next/hugo-theme-next/releases) [](https://github.com/hugo-next/hugo-theme-next/find/main) [](https://github.com/hugo-next/hugo-theme-next/blob/main/LICENSE)
|
||||
|
||||
## 4 Scheme
|
||||

|
||||
|
||||
## 🎨 4 Scheme
|
||||
|
||||
* :heart_decoration: Muse
|
||||
* :six_pointed_star: Mist
|
||||
* :pisces: Pisces
|
||||
* :gemini: Gemini (**default**)
|
||||
|
||||
## Live Preview
|
||||
## 👀 Live Preview
|
||||
|
||||
| Environment | :gemini: (**Default**) | :heart_decoration: | :six_pointed_star: | :pisces: | Status |
|
||||
| :---: | :---: | :---: | :---: | :---: | :---: |
|
||||
| Environment | :gemini: (**Default**) | :heart_decoration: | :six_pointed_star: | :pisces: | Status |
|
||||
| :---------: | :-----------------------------------------: | :--------------------------------------------: | :--------------------------------------------: | :------------------------------------------------: | :-------------------------------------------------------------------------------------------------: |
|
||||
| Preliminary | [Gemini](https://preview.hugo-next.eu.org/) | [Muse](https://preview.hugo-next.eu.org/muse/) | [Mist](https://preview.hugo-next.eu.org/mist/) | [Pisces](https://preview.hugo-next.eu.org/pisces/) |  |
|
||||
| Production | [Gemini](https://hugo-next.eu.org/) | [Muse](https://hugo-next.eu.org/muse/) | [Mist](https://hugo-next.eu.org/mist/) | [Pisces](https://hugo-next.eu.org/pisces/) |  |
|
||||
| Production | [Gemini](https://hugo-next.eu.org/) | [Muse](https://hugo-next.eu.org/muse/) | [Mist](https://hugo-next.eu.org/mist/) | [Pisces](https://hugo-next.eu.org/pisces/) |  |
|
||||
|
||||
> - Preliminary: all new feature developments will be previewed as soon as possible.
|
||||
> - Production: Only the features that are tested stably and meet the requirements will be officially released.
|
||||
|
||||
## Quick Start
|
||||
## 👣 Quick Start
|
||||
|
||||
Before use `Hugo NexT` theme, please make sure installed `Git` & `Hugo Extened` software in your PC, then use `submodule` to lead into the theme, see below commands:
|
||||
Before use `Hugo NexT` theme, please make sure installed `Git` & `Hugo Extened` software in your PC.
|
||||
|
||||
### 📦 Install Hugo
|
||||
|
||||
If you want to quickly preview the actual effect of the theme, you can directly clone the repository code of the current theme and run the example site:
|
||||
|
||||
```shell
|
||||
$ hugo new site hugo-next-exmaple
|
||||
$ cd hugo-next-exmaple
|
||||
$ git init
|
||||
$ git clone --single-branch -b main https://github.com/hugo-next/hugo-theme-next.git hugo-theme-next
|
||||
$ cd hugo-theme-next/exampleSite/
|
||||
$ sh startup.sh
|
||||
```
|
||||
|
||||
Open a computer browser and enter `http://127.0.0.1:1414/`, then you can access and view it.
|
||||
|
||||
### 📰 Use Template
|
||||
|
||||
If there your first time build blog site, Recommended use template of `Github` which can easily create your site code. Click & visit this repository: [hugo-theme-next-starter](https://github.com/hugo-next/hugo-theme-next-starter), then click the green button which name call `Use this template` upper right corner on the page. Just like below image:
|
||||
|
||||

|
||||
|
||||
After do that click the green button which name call `Create repository from template`, then will create your site code automatic, and clone it on your PC environment.
|
||||
|
||||
### 📐 Direct Reference
|
||||
|
||||
If you had a blog site, then use `submodule` to lead into the theme, see below commands:
|
||||
|
||||
```shell
|
||||
$ cd hugo-next-example
|
||||
$ git submodule add https://github.com/hugo-next/hugo-theme-next.git themes/hugo-theme-next
|
||||
$ cp -r themes/hugo-theme-next/exampleSite/* .
|
||||
$ rm -rf config.toml
|
||||
$ cp themes/hugo-theme-next/exampleSite/hugo.yaml .
|
||||
$ mv hugo.toml hugo.toml.backup
|
||||
```
|
||||
|
||||
Or use `Hugo module` to lead into the theme, see below commands:
|
||||
|
||||
```shell
|
||||
$ cd hugo-next-example
|
||||
$ hugo mod init hugo-next-example
|
||||
$ wget -O hugo.yaml https://github.com/hugo-next/hugo-theme-next/raw/main/exampleSite/hugo.yaml
|
||||
$ sed -i 's/hugo-theme-next/github.com\/hugo-next\/hugo-theme-next\/v4/' hugo.yaml
|
||||
$ mv hugo.toml hugo.toml.backup
|
||||
```
|
||||
|
||||
### 💻 Preview on Local
|
||||
|
||||
```shell
|
||||
$ cd hugo-next-example
|
||||
$ hugo server
|
||||
```
|
||||
|
||||
Done that input adrress http://127.0.0.1:1313/ on browser will see the effect & good luck for you! :tada::tada::tada:
|
||||
|
||||
> **Note**
|
||||
> Don't use `hugo server` command deploy your site and enable internet visit, it just used to preview when you develop on local environment. Recommended use `hugo` command build static files all site, then deploy them into Web server such as `Nginx`.
|
||||
|
||||
### 🔄 Upgrade Theme
|
||||
|
||||
Execute command as below in your site directory when the theme upgrade.
|
||||
|
||||
```shell
|
||||
$ cd hugo-next-exmaple
|
||||
$ cd hugo-next-example
|
||||
$ git submodule update --remote
|
||||
```
|
||||
|
||||
## New Post
|
||||
Execute command as below if you are using `Hugo module`:
|
||||
|
||||
```shell
|
||||
$ cd hugo-next-example
|
||||
$ hugo mod get -u
|
||||
```
|
||||
|
||||
## 📝 New Post
|
||||
|
||||
There had ready a new post template for you, It is recommended to use the following Hugo command to quickly create a new post:
|
||||
|
||||
@ -60,8 +112,10 @@ There had ready a new post template for you, It is recommended to use the follo
|
||||
$ hugo new posts/hello-world.md
|
||||
```
|
||||
|
||||
All front matter parameters's description in post as below:
|
||||
> **Note**
|
||||
> By defalut `hugo new` command will create new post under `content` root directory, so in here `posts` were you custom subfolder in `content` directory.
|
||||
|
||||
All front matter parameters's description in post as below:
|
||||
|
||||
```yml
|
||||
---
|
||||
@ -88,41 +142,78 @@ tags:
|
||||
#expand: true
|
||||
# It's means that will redirecting to external links
|
||||
#extlink:
|
||||
# Switch to enabled or disabled comment plugins in this post
|
||||
# Disabled comment plugins in this post
|
||||
#comment:
|
||||
# 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
|
||||
# Absolute link for visit
|
||||
#url: "{{ lower .Name }}.html"
|
||||
# Sticky post set-top in home page and the smaller nubmer will more forward.
|
||||
#weight: 1
|
||||
# Support Math Formulas render, options: mathjax, katex
|
||||
#math: mathjax
|
||||
# Enable chart render, such as: flow, sequence, classes etc
|
||||
#mermaid: true
|
||||
---
|
||||
```
|
||||
|
||||
## Feedback
|
||||
## 🎉 User's Cases
|
||||
|
||||
- [Hugo Docs & Demo](https://hugo-next.eu.org/)
|
||||
- [凡梦星尘空间站](https://lisenhui.cn/)
|
||||
- [阿哈吉](https://a.happy2008.top/)
|
||||
- [研究僧](https://yuanlucas.com/)
|
||||
- [Zero's Record](https://izeroo.cn/)
|
||||
- [More Cases](https://hugo-next.eu.org/flinks.html)
|
||||
|
||||
Hope could submmit your site information in this file [flinks.yaml](https://github.com/hugo-next/hugo-next-docs/blob/develop/data/flinks.yaml) end line such as below code sytle when you use `Hugo NexT` theme, thanks.
|
||||
|
||||
```yaml
|
||||
- name: NexT 主题
|
||||
desc: 保持简单的易用性和强大的功能
|
||||
avatar: https://hugo-next.eu.org/imgs/hugo_next_avatar.png
|
||||
link: https://hugo-next.eu.org
|
||||
```
|
||||
|
||||
## 🙋 Feedback
|
||||
|
||||
- Join us [GitHub Discussions](https://github.com/hugo-next/hugo-theme-next/discussions) or [Gitter](https://gitter.im/hugo-next/community) to chat :beers:
|
||||
- [GitHub Issues](https://github.com/hugo-next/hugo-theme-next/issues/new?labels=Bug&template=bug-report.md) submit a new bug :bug:
|
||||
- [GitHub Feature](https://github.com/hugo-next/hugo-theme-next/issues/new?labels=Feature+Request&template=feature-request.md) tell me your ideas :sparkles:
|
||||
|
||||
## Join us
|
||||
## 👨👩👧👦 Join us
|
||||
|
||||
All features development progress and new request in [Hugo NexT V4 Roadmap](https://github.com/hugo-next/hugo-theme-next/issues/9), welcome to join us and compelete it together.
|
||||
|
||||
## License
|
||||
[](https://github.com/hugo-next/hugo-theme-next/graphs/contributors)
|
||||
|
||||
[](https://github.com/hugo-next/hugo-theme-next/stargazers)
|
||||
|
||||
## 📜 License
|
||||
|
||||
[MIT License](LICENSE)
|
||||
|
||||
Copyright (c) 2022, hugo-next teams.
|
||||
|
||||
## Thanks
|
||||
## 💖 Thanks
|
||||
|
||||
That's my hobby to develop `Hugo NexT` theme, thanks all people who gived the donate, and let we follow it growth up.
|
||||
|
||||
List of Donors(Order by Date):
|
||||
List of Donors(Order desc by Date):
|
||||
|
||||
| Donation time | Donors | Donation mode | Donation content | Message |
|
||||
| :-----------: | ------ | ------------- | ---------------- | -------------------------------------------------------------------------- |
|
||||
| 2024.05.11 | *祥 | alipay | RMB 66.66 | Thank you for creating such a great theme. |
|
||||
| 2023.07.25 | *五 | alipay | RMB 50.00 | I really like the 'Next' theme, thank you, let me buy you a cup of coffee. |
|
||||
| 2023.06.01 | **霖 | alipay | RMB 10.00 | / |
|
||||
| 2022.11.15 | f888 | xianyu | RMB 6.20 | Good luck. |
|
||||
| 2022.09.30 | *軒 | wechat pay | RMB 66.66 | Hope it could help more people. |
|
||||
| 2022.09.30 | N*l | wechat pay | RMB 20.00 | / |
|
||||
| 2022.07.09 | *风 | wechat pay | RMB 10.00 | / |
|
||||
| 2022.05.08 | *泉 | wechat pay | RMB 6.60 | Good luck with next develop. |
|
||||
| 2022.02.28 | *娇 | wechat pay | RMB 5.00 | / |
|
||||
| 2021.12.21 | z*y | wechat pay | RMB 18.88 | / |
|
||||
|
||||
| Donation time | Donors | Donation mode | Donation content | Message |
|
||||
| ------- | ------ | ------ | ---- | ---- |
|
||||
| 2021.12.21 | z*y | wechat pay | RMB 18.88 | / |
|
||||
| 2022.05.08 | *泉 | wechat pay | RMB 6.60 | Good luck with next develop. |
|
150
README.zh.md
150
README.zh.md
@ -1,7 +1,7 @@
|
||||
[中文](#) | [English](README.md)
|
||||
[中文](#) | [English](https://github.com/hugo-next/hugo-theme-next/blob/main/README.md)
|
||||
|
||||
<a title="Hugo NexT 站点" href="https://preview.hugo-next.eu.org">
|
||||
<img align="right" alt="NexT logo" width="266" src="https://lisenhui.gitee.io/imgs/hugo-next/logo/hugo-next-primary.png">
|
||||
<img align="right" alt="NexT logo" width="266" src="images/hugo-next-primary.png">
|
||||
</a>
|
||||
|
||||
## Hugo NexT
|
||||
@ -10,50 +10,104 @@
|
||||
|
||||
> 本主题的所有页面设计和配置项都与原来 `Hexo` 引擎的 `NexT` 主题保持了良好的兼容性,可以非常平滑的从 `Hexo` 迁移至 `Hugo` 引擎,欢迎大家使用并反馈。
|
||||
|
||||
[](https://gitter.im/hugo-next/community) [](https://github.com/gohugoio/hugo/releases/latest) [](https://github.com/hugo-next/hugo-theme-next) [](https://github.com/hugo-next/hugo-theme-next/find/main) [](https://github.com/hugo-next/hugo-theme-next/blob/main/LICENSE)
|
||||
[](https://app.gitter.im/#/room/#hugo-next_community:gitter.im) [](https://github.com/gohugoio/hugo/releases/latest) [](https://github.com/hugo-next/hugo-theme-next) [](https://github.com/hugo-next/hugo-theme-next/graphs/contributors) [](https://github.com/hugo-next/hugo-theme-next/releases) [](https://github.com/hugo-next/hugo-theme-next/find/main) [](https://github.com/hugo-next/hugo-theme-next/blob/main/LICENSE)
|
||||
|
||||
## 4 种页面模式
|
||||

|
||||
|
||||
## 🎨 4 种页面模式
|
||||
|
||||
* :heart_decoration: 冥想 (Muse)
|
||||
* :six_pointed_star: 迷雾 (Mist)
|
||||
* :pisces: 双鱼座 (Pisces)
|
||||
* :gemini: 双子座 (Gemini) (**默认**)
|
||||
|
||||
## 在线预览
|
||||
## 👀 在线预览
|
||||
|
||||
| 环境 | :gemini: (**Default**) | :heart_decoration: | :six_pointed_star: | :pisces: | 状态 |
|
||||
| :---: | :---: | :---: | :---: | :---: | :---: |
|
||||
| 环境 | :gemini: (**Default**) | :heart_decoration: | :six_pointed_star: | :pisces: | 状态 |
|
||||
| :------: | :-----------------------------------------: | :--------------------------------------------: | :--------------------------------------------: | :------------------------------------------------: | :-----------------------------------------------------------------------------------------: |
|
||||
| 开发版本 | [双子座](https://preview.hugo-next.eu.org/) | [冥想](https://preview.hugo-next.eu.org/muse/) | [迷雾](https://preview.hugo-next.eu.org/mist/) | [双鱼座](https://preview.hugo-next.eu.org/pisces/) |  |
|
||||
| 正式版本 | [双子座](https://hugo-next.eu.org/) | [冥想](https://hugo-next.eu.org/muse/) | [迷雾](https://hugo-next.eu.org/mist/) | [双鱼座](https://hugo-next.eu.org/pisces/) |  |
|
||||
| 正式版本 | [双子座](https://hugo-next.eu.org/) | [冥想](https://hugo-next.eu.org/muse/) | [迷雾](https://hugo-next.eu.org/mist/) | [双鱼座](https://hugo-next.eu.org/pisces/) |  |
|
||||
|
||||
> - 开发版本: 所有的新功能开发都会在此第一时间发布预览
|
||||
> - 正式版本: 只有测试稳定且符合要求的功能才会正式发布
|
||||
|
||||
## 快速开始
|
||||
## 👣 快速开始
|
||||
|
||||
在使用 `Hugo NexT` 主题之前,请确认你的电脑上已经安装 `Git` 和 `Hugo Extened` 两款软件,然后通过 `submodule` 模式引用本主题,参考如下命令:
|
||||
在使用 `Hugo NexT` 主题之前,请确认你的电脑上已经安装 `Git` 和 `Hugo Extened` 两款软件。
|
||||
|
||||
### 📦 快速预览
|
||||
|
||||
如想快速预览主题实际效果,可直接克隆当前主题的仓库代码,然后运行示例站点:
|
||||
|
||||
```shell
|
||||
$ hugo new site hugo-next-exmaple
|
||||
$ cd hugo-next-exmaple
|
||||
$ git init
|
||||
$ git clone --single-branch -b main https://github.com/hugo-next/hugo-theme-next.git hugo-theme-next
|
||||
$ cd hugo-theme-next/exampleSite/
|
||||
$ sh startup.sh
|
||||
```
|
||||
|
||||
打开电脑浏览器输入`http://127.0.0.1:1414/`即可访问查看。
|
||||
|
||||
### 📰 使用模板
|
||||
|
||||
如果你是初次建站的话,可以使用 `Github` 的模板功能,一键生成你的站点仓库代码。访问 [hugo-theme-next-starter](https://github.com/hugo-next/hugo-theme-next-starter) 点击右上角的 `Use this template` 绿色按钮然后填写代码仓库的相关信息,参考如下:
|
||||
|
||||

|
||||
|
||||
最后点击 `Create repository from template` 绿色按钮,会直接在你的空间中生成站点代码,再把它克隆到本地进行创作。
|
||||
|
||||
### 📐 直接引用
|
||||
|
||||
如果你已经有站点,可通过 `submodule` 模式引用本主题,参考如下命令:
|
||||
|
||||
```shell
|
||||
$ cd hugo-next-example
|
||||
$ git submodule add https://github.com/hugo-next/hugo-theme-next.git themes/hugo-theme-next
|
||||
$ cp -r themes/hugo-theme-next/exampleSite/* .
|
||||
$ rm -rf config.toml
|
||||
$ cp themes/hugo-theme-next/exampleSite/hugo.yaml .
|
||||
$ mv hugo.toml hugo.toml.backup
|
||||
```
|
||||
|
||||
或通过 `Hugo module` 模式引用本主题,参考如下命令:
|
||||
|
||||
```shell
|
||||
$ cd hugo-next-example
|
||||
$ hugo mod init hugo-next-example
|
||||
$ wget -O hugo.yaml https://github.com/hugo-next/hugo-theme-next/raw/main/exampleSite/hugo.yaml
|
||||
$ sed -i 's/hugo-theme-next/github.com\/hugo-next\/hugo-theme-next\/v4/' hugo.yaml
|
||||
$ mv hugo.toml hugo.toml.backup
|
||||
```
|
||||
|
||||
### 💻 本地预览
|
||||
|
||||
```shell
|
||||
$ cd hugo-next-example
|
||||
$ hugo server
|
||||
```
|
||||
|
||||
打开浏览器,在地址栏输入 http://127.0.0.1:1313/ 查看主题效果,祝你好运!:tada::tada::tada:
|
||||
|
||||
> **Note**
|
||||
> 要注意下 `hugo server` 命令只是用于本地开发或写文章时预览,并非是将其直接对外网开放访问。在正式发布时,可通过 `hugo` 命令生成全站静态文件,然后部署到类似 `Nginx` 的 Web 服务器即可。
|
||||
|
||||
### 🔄 主题更新
|
||||
|
||||
后续更新主题只需要在你的站点目录中,执行如下命令:
|
||||
|
||||
```shell
|
||||
$ cd hugo-next-exmaple
|
||||
$ cd hugo-next-example
|
||||
$ git submodule update --remote
|
||||
```
|
||||
|
||||
如使用 `Hugo module`,执行如下命令:
|
||||
|
||||
```shell
|
||||
$ cd hugo-next-example
|
||||
$ hugo mod get -u
|
||||
```
|
||||
|
||||
> **Note**
|
||||
> 本主题的代码同时也同步到 `Gitee` 仓库,在国内环境可切换用 [https://gitee.com/hugo-next/hugo-theme-next.git](https://gitee.com/hugo-next/hugo-theme-next.git) 镜像速度更快,也更稳定。
|
||||
|
||||
## 发表新文章
|
||||
## 📝 发表新文章
|
||||
|
||||
主题已经配置了默认的文章模板,建议使用如下 Hugo 命令快速创建新的文章:
|
||||
|
||||
@ -61,8 +115,10 @@ $ git submodule update --remote
|
||||
$ hugo new posts/hello-world.md
|
||||
```
|
||||
|
||||
关于文章头部那些参数作用的说明参考如下:
|
||||
> **Note**
|
||||
> 其中 `posts` 路径是 `content` 根目录下的子文件夹,可依据自己的文件管理形态调整。
|
||||
|
||||
关于文章头部那些参数作用的说明参考如下:
|
||||
|
||||
```yml
|
||||
---
|
||||
@ -94,19 +150,42 @@ tags:
|
||||
#expand: true
|
||||
# 外部链接地址,访问时直接跳转
|
||||
#extlink:
|
||||
# 在当前页面开启或关闭评论功能
|
||||
# 在当前页面关闭评论功能
|
||||
#comment:
|
||||
# enable: false
|
||||
# 开启文章目录功能
|
||||
# 关闭当前页面目录功能
|
||||
# 注意:正常情况下文章中有H2-H4标题会自动生成目录,无需额外配置
|
||||
#toc: false
|
||||
# 绝对访问路径
|
||||
#url: "{{ lower .Name }}.html"
|
||||
# 开启文章置顶,数字越小越靠前
|
||||
#weight: 1
|
||||
# 开启数学公式渲染,可选值: mathjax, katex
|
||||
#math: mathjax
|
||||
# 开启各种图渲染,如流程图、时序图、类图等
|
||||
#mermaid: true
|
||||
---
|
||||
```
|
||||
|
||||
## 使用反馈
|
||||
## 🎉 用户案例
|
||||
|
||||
- [Hugo Docs & Demo](https://hugo-next.eu.org/)
|
||||
- [凡梦星尘空间站](https://lisenhui.cn/)
|
||||
- [阿哈吉](https://a.happy2008.top/)
|
||||
- [研究僧](https://yuanlucas.com/)
|
||||
- [Zero's Record](https://izeroo.cn/)
|
||||
- [更多案例上线](https://hugo-next.eu.org/flinks.html)
|
||||
|
||||
如你也正在使用 `Hugo NexT` 主题,欢迎在 [flinks.yaml](https://github.com/hugo-next/hugo-next-docs/blob/develop/data/flinks.yaml) 文件底部提交贵站的名称、描述、头像、链接等信息,具体格式内容参考如下:
|
||||
|
||||
```yaml
|
||||
- name: NexT 主题
|
||||
desc: 保持简单的易用性和强大的功能
|
||||
avatar: https://hugo-next.eu.org/imgs/hugo_next_avatar.png
|
||||
link: https://hugo-next.eu.org
|
||||
```
|
||||
|
||||
## 🙋 使用反馈
|
||||
|
||||
- 加入 [GitHub Discussions](https://github.com/hugo-next/hugo-theme-next/discussions) 或 [Gitter](https://gitter.im/hugo-next/community) 在线讨论 :beers:
|
||||
- [GitHub Issues](https://github.com/hugo-next/hugo-theme-next/issues/new?labels=Bug&template=bug-report.md) 提交错误报告 :bug:
|
||||
@ -114,23 +193,36 @@ tags:
|
||||
|
||||
> 国内用户也可加入 QQ 群交流: 604710815
|
||||
|
||||
## 欢迎加入
|
||||
## 👨👩👧👦 欢迎加入
|
||||
|
||||
关于本主题的开发进度和后续的发展路线图,可访问 [Hugo NexT V4 Roadmap](https://github.com/hugo-next/hugo-theme-next/issues/9) 查看详情,也欢迎大家参与一起来完善。
|
||||
|
||||
## 许可证
|
||||
[](https://github.com/hugo-next/hugo-theme-next/graphs/contributors)
|
||||
|
||||
[](https://github.com/hugo-next/hugo-theme-next/stargazers)
|
||||
|
||||
## 📜 许可证
|
||||
|
||||
[MIT License](LICENSE)
|
||||
|
||||
Copyright (c) 2022, hugo-next 团队
|
||||
|
||||
## 致谢
|
||||
## 💖 致谢
|
||||
|
||||
开发 `Hugo NexT` 主题原本是个人的业余爱好,但没想到网友们这么的热情,感谢有你们的支持,让我们一起来见证它的成长。
|
||||
|
||||
以下是捐助名单列表(按时间顺序):
|
||||
以下是打赏名单列表(按时间倒序):
|
||||
|
||||
| 打赏时间 | 打赏者 | 打赏方式 | 打赏内容 | 留言 |
|
||||
| :--------: | ------ | -------- | -------- | -------------------------------- |
|
||||
| 2024.05.11 | *祥 | 支付宝 | ¥66.66 | 感谢创作这么好的主题 |
|
||||
| 2023.07.25 | *五 | 微信支付 | ¥50.00 | 很喜欢next主题,感谢,请你喝咖啡 |
|
||||
| 2023.06.01 | **霖 | 支付宝 | ¥10.00 | / |
|
||||
| 2022.11.15 | f888 | 咸鱼 | ¥6.20 | 聊表心意 |
|
||||
| 2022.09.30 | *軒 | 微信支付 | ¥66.66 | 愿项目造福更多人! |
|
||||
| 2022.09.30 | N*l | 微信支付 | ¥20.00 | / |
|
||||
| 2022.07.09 | *风 | 微信支付 | ¥10.00 | / |
|
||||
| 2022.05.08 | *泉 | 微信支付 | ¥6.60 | 祝开发next顺利 |
|
||||
| 2022.02.28 | *娇 | 微信支付 | ¥5.00 | / |
|
||||
| 2021.12.21 | z*y | 微信支付 | ¥18.88 | / |
|
||||
|
||||
| 捐助时间 | 捐助者 | 捐助方式 | 捐助内容 | 留言 |
|
||||
| :-------: | ------ | ------ | ---- | ---- |
|
||||
| 2021.12.21 | z*y | 微信支付 | ¥18.88 | / |
|
||||
| 2022.05.08 | *泉 | 微信支付 | ¥6.60 | 祝开发next顺利 |顺利 |
|
@ -27,12 +27,12 @@ tags:
|
||||
# 外部链接地址,访问时直接跳转
|
||||
# It's means that will redirecting to external links
|
||||
#extlink:
|
||||
# 在当前页面开启或关闭评论功能
|
||||
# Switch to enabled or disabled comment plugins in this post
|
||||
# 在当前页面关闭评论功能
|
||||
# Disabled comment plugins in this post
|
||||
#comment:
|
||||
# enable: false
|
||||
# 开启文章目录功能
|
||||
# Enable table of content
|
||||
# 关闭文章目录功能
|
||||
# Disable table of content
|
||||
#toc: false
|
||||
# 绝对访问路径
|
||||
# Absolute link for visit
|
||||
@ -40,6 +40,12 @@ tags:
|
||||
# 开启文章置顶,数字越小越靠前
|
||||
# Sticky post set-top in home page and the smaller nubmer will more forward.
|
||||
#weight: 1
|
||||
# 开启数学公式渲染,可选值: mathjax, katex
|
||||
# Support Math Formulas render, options: mathjax, katex
|
||||
#math: mathjax
|
||||
# 开启各种图渲染,如流程图、时序图、类图等
|
||||
# Enable chart render, such as: flow, sequence, classes etc
|
||||
#mermaid: true
|
||||
---
|
||||
|
||||
{{ .Name }}
|
||||
|
@ -4,6 +4,8 @@
|
||||
--content-bg-color: #{$content-bg-color};
|
||||
--card-bg-color: #{$card-bg-color};
|
||||
--text-color: #{$text-color};
|
||||
--selection-bg: #{$grey-lighter};
|
||||
--selection-color: #{$black-deep};
|
||||
--blockquote-color: #{$blockquote-color};
|
||||
--link-color: #{$link-color};
|
||||
--link-hover-color: #{$link-hover-color};
|
||||
@ -14,6 +16,8 @@
|
||||
--menu-item-bg-color: #{$menu-item-bg-color};
|
||||
--theme-color: #{$theme-color};
|
||||
|
||||
--border-color: #{$border-color};
|
||||
|
||||
--btn-default-bg: #{$btn-default-bg};
|
||||
--btn-default-color: #{$btn-default-color};
|
||||
--btn-default-border-color: #{$btn-default-border-color};
|
||||
@ -26,51 +30,56 @@
|
||||
--highlight-gutter-background: #{$highlight-gutter-background};
|
||||
--highlight-gutter-foreground: #{$highlight-gutter-foreground};
|
||||
|
||||
--highlight-img-fill: brightness(1) invert(0);
|
||||
|
||||
color-scheme: light;
|
||||
}
|
||||
|
||||
@if $darkmode {
|
||||
@media (prefers-color-scheme: dark) {
|
||||
:root {
|
||||
--body-bg-color: #{$body-bg-color-dark};
|
||||
--content-bg-color: #{$content-bg-color-dark};
|
||||
--card-bg-color: #{$card-bg-color-dark};
|
||||
--text-color: #{$text-color-dark};
|
||||
--blockquote-color: #{$blockquote-color-dark};
|
||||
--link-color: #{$link-color-dark};
|
||||
--link-hover-color: #{$link-hover-color-dark};
|
||||
--brand-color: #{$brand-color-dark};
|
||||
--brand-hover-color: #{$brand-hover-color-dark};
|
||||
--table-row-odd-bg-color: #{$table-row-odd-bg-color-dark};
|
||||
--table-row-hover-bg-color: #{$table-row-hover-bg-color-dark};
|
||||
--menu-item-bg-color: #{$menu-item-bg-color-dark};
|
||||
--theme-color: #{$theme-color-dark};
|
||||
:root[data-theme="dark"] {
|
||||
--body-bg-color: #{$body-bg-color-dark};
|
||||
--content-bg-color: #{$content-bg-color-dark};
|
||||
--card-bg-color: #{$card-bg-color-dark};
|
||||
--text-color: #{$text-color-dark};
|
||||
--selection-bg: #{$gainsboro};
|
||||
--selection-color: #{$black-dim};
|
||||
--blockquote-color: #{$blockquote-color-dark};
|
||||
--link-color: #{$link-color-dark};
|
||||
--link-hover-color: #{$link-hover-color-dark};
|
||||
--brand-color: #{$brand-color-dark};
|
||||
--brand-hover-color: #{$brand-hover-color-dark};
|
||||
--table-row-odd-bg-color: #{$table-row-odd-bg-color-dark};
|
||||
--table-row-hover-bg-color: #{$table-row-hover-bg-color-dark};
|
||||
--menu-item-bg-color: #{$menu-item-bg-color-dark};
|
||||
--theme-color: #{$theme-color-dark};
|
||||
|
||||
--btn-default-bg: #{$btn-default-bg-dark};
|
||||
--btn-default-color: #{$btn-default-color-dark};
|
||||
--btn-default-border-color: #{$btn-default-border-color-dark};
|
||||
--btn-default-hover-bg: #{$btn-default-hover-bg-dark};
|
||||
--btn-default-hover-color: #{$btn-default-hover-color-dark};
|
||||
--btn-default-hover-border-color: #{$btn-default-hover-border-color-dark};
|
||||
--border-color: #{$border-color-dark};
|
||||
|
||||
--highlight-background: #{$highlight-background-dark};
|
||||
--highlight-foreground: #{$highlight-foreground-dark};
|
||||
--highlight-gutter-background: #{$highlight-gutter-background-dark};
|
||||
--highlight-gutter-foreground: #{$highlight-gutter-foreground-dark};
|
||||
--btn-default-bg: #{$btn-default-bg-dark};
|
||||
--btn-default-color: #{$btn-default-color-dark};
|
||||
--btn-default-border-color: #{$btn-default-border-color-dark};
|
||||
--btn-default-hover-bg: #{$btn-default-hover-bg-dark};
|
||||
--btn-default-hover-color: #{$btn-default-hover-color-dark};
|
||||
--btn-default-hover-border-color: #{$btn-default-hover-border-color-dark};
|
||||
|
||||
color-scheme: dark;
|
||||
}
|
||||
--highlight-background: #{$highlight-background-dark};
|
||||
--highlight-foreground: #{$highlight-foreground-dark};
|
||||
--highlight-gutter-background: #{$highlight-gutter-background-dark};
|
||||
--highlight-gutter-foreground: #{$highlight-gutter-foreground-dark};
|
||||
|
||||
img {
|
||||
opacity: .75;
|
||||
--highlight-img-fill: brightness(0) invert(1);
|
||||
|
||||
&:hover {
|
||||
opacity: .9;
|
||||
}
|
||||
}
|
||||
color-scheme: dark;
|
||||
}
|
||||
|
||||
iframe {
|
||||
color-scheme: light;
|
||||
}
|
||||
img[data-theme="dark"] {
|
||||
opacity: .75;
|
||||
filter: brightness(1) invert(0);
|
||||
|
||||
&:hover {
|
||||
opacity: .9;
|
||||
}
|
||||
}
|
||||
|
||||
iframe[data-theme="dark"] {
|
||||
color-scheme: light;
|
||||
}
|
||||
|
@ -3,7 +3,6 @@
|
||||
@import 'utterances';
|
||||
@import 'search';
|
||||
@import 'related-posts';
|
||||
@import 'math';
|
||||
@import 'gitter';
|
||||
@import 'livere';
|
||||
@import 'waline';
|
@ -13,7 +13,7 @@
|
||||
transition: visibility .4s, background .4s;
|
||||
visibility: hidden;
|
||||
width: 100%;
|
||||
z-index: $zindex-4;
|
||||
z-index: $zindex-4;
|
||||
|
||||
.search-active & {
|
||||
background: rgba(0, 0, 0, .3);
|
||||
@ -24,7 +24,7 @@
|
||||
.search-popup {
|
||||
background: var(--card-bg-color);
|
||||
border-radius: 5px;
|
||||
height: 80%;
|
||||
height: 65%;
|
||||
margin: auto;
|
||||
transform: scale(0);
|
||||
transition: transform .4s;
|
||||
@ -55,12 +55,7 @@
|
||||
}
|
||||
|
||||
.search-header {
|
||||
background: $gainsboro;
|
||||
@if $darkmode {
|
||||
@media (prefers-color-scheme: dark) {
|
||||
background: $grey-dim;
|
||||
}
|
||||
}
|
||||
background: var(--content-bg-color);
|
||||
border-top-left-radius: 5px;
|
||||
border-top-right-radius: 5px;
|
||||
display: flex;
|
||||
@ -72,6 +67,7 @@
|
||||
border: 0;
|
||||
outline: 0;
|
||||
width: 100%;
|
||||
color: var(--text-color);
|
||||
|
||||
&::-webkit-search-cancel-button {
|
||||
display: none;
|
||||
@ -81,15 +77,46 @@
|
||||
.search-result-container {
|
||||
height: calc(100% - 55px);
|
||||
overflow: auto;
|
||||
padding: 5px 25px;
|
||||
padding: 0px 25px;
|
||||
}
|
||||
|
||||
hr {
|
||||
margin: 5px 0 10px;
|
||||
.search-footer {
|
||||
background: var(--content-bg-color);
|
||||
border-bottom-left-radius: 5px;
|
||||
border-bottom-right-radius: 5px;
|
||||
padding: 0 5px;
|
||||
color: var(--text-color);
|
||||
|
||||
&:first-child {
|
||||
display: none;
|
||||
.search-meta-info {
|
||||
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 {
|
||||
@ -106,6 +133,13 @@
|
||||
padding: 5px 0;
|
||||
}
|
||||
}
|
||||
|
||||
mark.search-keyword {
|
||||
background: transparent;
|
||||
border-bottom: 1px dashed $red;
|
||||
color: $red;
|
||||
font-weight: bold;
|
||||
}
|
||||
}
|
||||
|
||||
@if $algolia_search_enable {
|
||||
@ -130,9 +164,16 @@
|
||||
|
||||
.algolia-pagination {
|
||||
// Override default style of ul
|
||||
margin: 40px 0;
|
||||
//margin: 40px 0;
|
||||
opacity: 1;
|
||||
padding: 0;
|
||||
font-size: $font-size-smallest;
|
||||
margin-bottom: -16px;
|
||||
|
||||
.pagination {
|
||||
visibility: visible;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.pagination-item {
|
||||
display: inline-block;
|
||||
@ -169,11 +210,4 @@
|
||||
margin: auto;
|
||||
}
|
||||
}
|
||||
|
||||
mark.search-keyword {
|
||||
background: transparent;
|
||||
border-bottom: 1px dashed $red;
|
||||
color: $red;
|
||||
font-weight: bold;
|
||||
}
|
||||
}
|
||||
}
|
18
assets/css/_common/components/3rd/waline.scss
Normal file
18
assets/css/_common/components/3rd/waline.scss
Normal file
@ -0,0 +1,18 @@
|
||||
@if $waline_enable {
|
||||
.wl-actions>button:nth-child(3) {
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
@ -1,45 +0,0 @@
|
||||
@if $back2top_enable {
|
||||
.back-to-top {
|
||||
font-size: $b2t-font-size;
|
||||
|
||||
@if not $back2top_scrollpercent {
|
||||
span {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
|
||||
@if $back2top_sidebar {
|
||||
margin: 20px - $sidebar-offset -10px -20px;
|
||||
opacity: 0;
|
||||
transition: opacity $transition-ease;
|
||||
|
||||
&.back-to-top-on {
|
||||
cursor: pointer;
|
||||
opacity: $b2t-opacity;
|
||||
|
||||
&:hover {
|
||||
opacity: $b2t-opacity-hover;
|
||||
}
|
||||
}
|
||||
} @else {
|
||||
bottom: $b2t-position-bottom;
|
||||
box-sizing: border-box;
|
||||
color: $b2t-color;
|
||||
padding: 0 6px;
|
||||
transition: bottom $transition-ease;
|
||||
@include sidebar-toggle();
|
||||
|
||||
@if not $back2top_scrollpercent {
|
||||
width: 24px;
|
||||
}
|
||||
|
||||
&:hover {
|
||||
color: $sidebar-highlight;
|
||||
}
|
||||
|
||||
&.back-to-top-on {
|
||||
bottom: $b2t-position-bottom-on;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -12,9 +12,17 @@
|
||||
z-index: $zindex-5;
|
||||
}
|
||||
|
||||
@import 'back-to-top';
|
||||
.hidden {
|
||||
display: none !important;
|
||||
}
|
||||
|
||||
.show {
|
||||
display: block !important;
|
||||
}
|
||||
|
||||
@import 'tool-buttons';
|
||||
@import 'reading-progress';
|
||||
|
||||
@import 'post';
|
||||
@import 'pages';
|
||||
@import 'third-party';
|
||||
@import '3rd';
|
||||
|
@ -15,14 +15,23 @@
|
||||
list-style: none;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.category-list-item {
|
||||
margin: 5px 10px;
|
||||
.category-list-item:before {
|
||||
font-family: var(--fa-style-family,"Font Awesome 6 Free");
|
||||
font-weight: var(--fa-style,900);
|
||||
content: "\f07c";
|
||||
margin-right: 5px;
|
||||
}
|
||||
|
||||
.category-list-item {
|
||||
margin: 5px 10px;
|
||||
font-weight: bold;
|
||||
}
|
||||
}
|
||||
|
||||
.category-list-count {
|
||||
color: $grey;
|
||||
padding: 0 2px;
|
||||
|
||||
&::before {
|
||||
content: ' (';
|
||||
@ -33,7 +42,19 @@
|
||||
}
|
||||
}
|
||||
|
||||
.category-list-child {
|
||||
padding-left: 10px;
|
||||
.category-children-list {
|
||||
padding-left: 38px;
|
||||
list-style: none;
|
||||
|
||||
.category-children-list-item:before {
|
||||
font-family: var(--fa-style-family,"Font Awesome 6 Free");
|
||||
font-weight: var(--fa-style,900);
|
||||
content: "\f0ae";
|
||||
margin-right: 5px;
|
||||
}
|
||||
|
||||
.category-children-list-item {
|
||||
font-size: 0.925em;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
141
assets/css/_common/components/pages/flinks.scss
Normal file
141
assets/css/_common/components/pages/flinks.scss
Normal file
@ -0,0 +1,141 @@
|
||||
.flinks-block {
|
||||
|
||||
.flinks-header {
|
||||
text-align: center;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.flinks-list-title {
|
||||
font-size: 1.25em;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.flinks-lists > div:not(:first-child) {
|
||||
margin-top: 40px;
|
||||
}
|
||||
|
||||
.flinks-list-desc {
|
||||
font-style: italic;
|
||||
}
|
||||
|
||||
.flinks-list-items {
|
||||
overflow: auto;
|
||||
padding: 10px 10px 0;
|
||||
text-align: center;
|
||||
|
||||
|
||||
|
||||
.flinks-list-item {
|
||||
@include mobile() {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
position: relative;
|
||||
float: left;
|
||||
overflow: hidden;
|
||||
margin: 15px 7px;
|
||||
width: calc(100% / 3 - 18px);
|
||||
height: 90px;
|
||||
border-radius: 8px;
|
||||
line-height: 17px;
|
||||
-webkit-transform: translateZ(0);
|
||||
border: groove 1px var(--highlight-foreground);
|
||||
box-shadow: .6rem .5rem 0.3rem var(--body-bg-color);
|
||||
|
||||
&:hover:before,
|
||||
&:focus:before,
|
||||
&:active:before {
|
||||
-webkit-transform:scale(1);
|
||||
-moz-transform:scale(1);
|
||||
-o-transform:scale(1);
|
||||
-ms-transform:scale(1);
|
||||
transform: scale(1);
|
||||
}
|
||||
|
||||
|
||||
&:hover .flinks-item-icon {
|
||||
margin-left:-10px;
|
||||
width:0;
|
||||
}
|
||||
|
||||
&:before {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
z-index: -1;
|
||||
background: var(--body-bg-color);
|
||||
content: ' ';
|
||||
transition: transform .3s ease-out;
|
||||
transform: scale(0);
|
||||
}
|
||||
|
||||
a {
|
||||
//color: var(--font-color);
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.flinks-item-icon {
|
||||
float: left;
|
||||
overflow: hidden;
|
||||
margin: 15px 10px;
|
||||
width: 60px;
|
||||
height: 60px;
|
||||
border-radius: 35px;
|
||||
border: solid 1px var(--body-bg-color);
|
||||
-webkit-transition: width .3s ease-out;
|
||||
-moz-transition: width .3s ease-out;
|
||||
-o-transition: width .3s ease-out;
|
||||
-ms-transition: width .3s ease-out;
|
||||
transition: width .3s ease-out;
|
||||
|
||||
img {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
-webkit-transition: filter 375ms ease-in .2s,-webkit-transform .3s;
|
||||
-moz-transition: filter 375ms ease-in .2s,-moz-transform .3s;
|
||||
-o-transition: filter 375ms ease-in .2s,-o-transform .3s;
|
||||
-ms-transition: filter 375ms ease-in .2s,-ms-transform .3s;
|
||||
transition: filter 375ms ease-in .2s,transform .3s;
|
||||
object-fit: cover;
|
||||
}
|
||||
}
|
||||
|
||||
.flinks-item-name, .flinks-item-desc {
|
||||
overflow:hidden;
|
||||
-o-text-overflow:ellipsis;
|
||||
text-overflow:ellipsis;
|
||||
white-space:nowrap
|
||||
}
|
||||
|
||||
.flinks-item-name {
|
||||
padding: 20px 0 0 0;
|
||||
height: 20px;
|
||||
font-weight: 700;
|
||||
font-size: 1em;
|
||||
font-weight: bold;
|
||||
|
||||
@include mobile() {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
|
||||
.flinks-item-desc {
|
||||
padding: 10px 0;
|
||||
font-size: .92em;
|
||||
|
||||
@include mobile() {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
.flinks-page-desc {
|
||||
margin-top: 20px;
|
||||
}
|
||||
}
|
@ -3,3 +3,4 @@
|
||||
@import 'schedule';
|
||||
@import 'breadcrumb';
|
||||
@import 'tag-cloud';
|
||||
@import 'flinks';
|
@ -18,19 +18,19 @@
|
||||
|
||||
.use-motion {
|
||||
@if $motion_trans_post_block {
|
||||
.post-block, .pagination, .comments, .post-comments {
|
||||
.post-block, .flinks-block, .pagination, .comments, .post-comments {
|
||||
visibility: hidden;
|
||||
}
|
||||
}
|
||||
|
||||
@if $motion_trans_post_header {
|
||||
.post-header {
|
||||
.post-header, .flinks-header {
|
||||
visibility: hidden;
|
||||
}
|
||||
}
|
||||
|
||||
@if $motion_trans_post_body {
|
||||
.post-body {
|
||||
.post-body, .flinks-body {
|
||||
visibility: hidden;
|
||||
}
|
||||
}
|
||||
@ -42,6 +42,34 @@
|
||||
}
|
||||
}
|
||||
|
||||
@if $toc_number {
|
||||
.autonumber {
|
||||
h2 {
|
||||
counter-reset: h3;
|
||||
&:before{
|
||||
counter-increment: h2;
|
||||
content: counter(h2) ". ";
|
||||
}
|
||||
}
|
||||
|
||||
h3 {
|
||||
counter-reset: h4;
|
||||
&:before{
|
||||
counter-increment: h3;
|
||||
content: counter(h2) ". " counter(h3) ". ";
|
||||
}
|
||||
}
|
||||
|
||||
h4 {
|
||||
counter-reset: h5;
|
||||
&:before{
|
||||
counter-increment: h4;
|
||||
content: counter(h2) "." counter(h3) "." counter(h4) ". ";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@import 'post-collapse';
|
||||
@import 'post-body';
|
||||
@import 'post-gallery';
|
||||
@ -50,4 +78,4 @@
|
||||
@import 'post-footer';
|
||||
@import 'post-widgets';
|
||||
@import 'post-reward';
|
||||
@import 'post-followme';
|
||||
@import 'post-followme';
|
36
assets/css/_common/components/post/post-alert.scss
Normal file
36
assets/css/_common/components/post/post-alert.scss
Normal file
@ -0,0 +1,36 @@
|
||||
|
||||
@mixin alert-styles($type, $color) {
|
||||
.post-alert-#{$type} {
|
||||
padding: 0 0 0 10px;
|
||||
border-left: 6px solid $color;
|
||||
font-size: 0.825em;
|
||||
color: $color;
|
||||
}
|
||||
}
|
||||
|
||||
@each $key, $color in $post_alert_colors {
|
||||
@include alert-styles(#{$key}, $color);
|
||||
}
|
||||
|
||||
.post-alert-title, .post-expired-title {
|
||||
|
||||
display: flex;
|
||||
align-items: center;
|
||||
line-height: 1.5;
|
||||
margin: 0;
|
||||
|
||||
i {
|
||||
font-size: 1.25em;
|
||||
text-align: center;
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
span {
|
||||
margin: 0 0 0 8px;
|
||||
letter-spacing: 0.08em;
|
||||
}
|
||||
}
|
||||
|
||||
.post-alert-content, .post-expired-content {
|
||||
color: var(--text-color);
|
||||
}
|
@ -76,4 +76,70 @@
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
svg {
|
||||
max-width: 98%;
|
||||
}
|
||||
|
||||
// For read more post content anchor
|
||||
#more {
|
||||
visibility: hidden;
|
||||
}
|
||||
|
||||
/** Defined speical border properties for top card of post **/
|
||||
$speical-border-width: 5px;
|
||||
$speical-border-radius: 8px;
|
||||
.post-expired-tip {
|
||||
|
||||
$expired-color: #4A90E2;
|
||||
|
||||
font-size: var(--font-size-small);
|
||||
border: 1px solid #4A90E2;
|
||||
border-radius: $speical-border-radius;
|
||||
border-left: $speical-border-width solid #4A90E2;
|
||||
border-top: $speical-border-width solid #4A90E2;
|
||||
box-shadow: .6rem .5rem 0.3rem var(--body-bg-color);
|
||||
margin: 0 0 0.85em 0;
|
||||
padding: 0.65em 0.15em 0.65em 0.95em;
|
||||
display: none;
|
||||
|
||||
.post-expired-title {
|
||||
color: #4A90E2;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.post-expired-times {
|
||||
font-weight: bold;
|
||||
font-size: 1.15em;
|
||||
color: #e5534b;
|
||||
margin: 0 3px;
|
||||
}
|
||||
}
|
||||
|
||||
.post-summary-wrapper {
|
||||
$summary-color: #ea6733;
|
||||
|
||||
margin: 0 0 .85em 0;
|
||||
border-radius: $speical-border-radius;
|
||||
border: 1px solid $summary-color;
|
||||
border-right: $speical-border-width solid $summary-color;
|
||||
border-bottom: $speical-border-width solid $summary-color;
|
||||
box-shadow: .6rem .5rem 0.3rem var(--body-bg-color);
|
||||
|
||||
.summary-title {
|
||||
margin: .65em .93em 0 .93em;
|
||||
color: $summary-color;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.summary-content {
|
||||
background-color: var(--card-bg-color);
|
||||
border-radius: $speical-border-radius;
|
||||
box-shadow: .08rem .06rem 0.03rem var(--body-bg-color);
|
||||
margin: .85em;
|
||||
padding: .85em .95em;
|
||||
}
|
||||
}
|
||||
|
||||
@import 'post-alert';
|
||||
}
|
||||
|
@ -3,7 +3,7 @@
|
||||
// Fix issue #16
|
||||
// To do: use `gap` instead of `margin`
|
||||
// See https://caniuse.com/flexbox-gap
|
||||
.post-footer {
|
||||
.post-footer, .flinks-list-footer {
|
||||
@include flex-column();
|
||||
|
||||
hr{
|
||||
@ -59,6 +59,10 @@
|
||||
@include post-card();
|
||||
border: none;
|
||||
background: none;
|
||||
|
||||
li {
|
||||
word-break: break-all;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -87,3 +91,21 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@if $post_share_enable {
|
||||
.post-share-tools {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
|
||||
a {
|
||||
border: 0px;
|
||||
}
|
||||
}
|
||||
|
||||
@if $post_sharethis_set {
|
||||
.st-cmp-settings {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -114,8 +114,7 @@
|
||||
height: 0;
|
||||
}
|
||||
|
||||
@if $busuanzi_post_views {
|
||||
#busuanzi_container_page_pv {
|
||||
display: inline-block;
|
||||
}
|
||||
#comments-count {
|
||||
cursor: pointer;
|
||||
border-bottom: 1px solid $link-decoration-color;
|
||||
}
|
||||
|
@ -1,9 +0,0 @@
|
||||
@if $math_mathjax_enable {
|
||||
mjx-container[jax='CHTML'][display='true'], .has-jax {
|
||||
overflow: auto hidden;
|
||||
}
|
||||
|
||||
mjx-container[display='true'] + br {
|
||||
display: none;
|
||||
}
|
||||
}
|
@ -1,5 +0,0 @@
|
||||
@if $waline_enable {
|
||||
.wl-actions>button:nth-child(3) {
|
||||
display: none
|
||||
}
|
||||
}
|
91
assets/css/_common/components/tool-buttons.scss
Normal file
91
assets/css/_common/components/tool-buttons.scss
Normal file
@ -0,0 +1,91 @@
|
||||
.tool-buttons {
|
||||
|
||||
@include sidebar-toggle();
|
||||
background: none;
|
||||
bottom: 58px;
|
||||
filter: alpha(opacity=0);
|
||||
font-size: $font-size-smaller;
|
||||
@include mobile() {
|
||||
font-size: $font-size-smallest;
|
||||
}
|
||||
|
||||
.button {
|
||||
display: block;
|
||||
margin-bottom: 5px;
|
||||
width: 36px;
|
||||
height: 36px;
|
||||
border-radius: 5px;
|
||||
background-color: $tool-btn-bg;
|
||||
color: $tool-btn-color;
|
||||
text-align: center;
|
||||
line-height: 35px;
|
||||
padding: 0;
|
||||
outline: 0;
|
||||
border: none;
|
||||
text-transform: none;
|
||||
cursor: pointer;
|
||||
opacity: $tool-btn-opacity;
|
||||
touch-action: manipulation;
|
||||
|
||||
@include mobile() {
|
||||
width: 24px;
|
||||
height: 24px;
|
||||
line-height: 24px;
|
||||
border-radius: 3px;
|
||||
}
|
||||
|
||||
&:hover {
|
||||
color: $tool-btn-hover-fore-color;
|
||||
opacity: $tool-btn-opacity-hover;
|
||||
}
|
||||
}
|
||||
|
||||
.goto-comments {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
|
||||
@if $back2top_enable {
|
||||
.back-to-top {
|
||||
|
||||
@if not $back2top_scrollpercent {
|
||||
span {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
|
||||
@if $back2top_sidebar {
|
||||
margin: 20px -$sidebar-offset -10px -20px;
|
||||
opacity: 0;
|
||||
transition: opacity $transition-ease;
|
||||
|
||||
&.back-to-top-on {
|
||||
cursor: pointer;
|
||||
opacity: $b2t-opacity;
|
||||
|
||||
&:hover {
|
||||
opacity: $b2t-opacity-hover;
|
||||
}
|
||||
}
|
||||
} @else {
|
||||
bottom: $b2t-position-bottom;
|
||||
box-sizing: border-box;
|
||||
color: $b2t-color;
|
||||
padding: 0 6px;
|
||||
transition: bottom $transition-ease;
|
||||
@include sidebar-toggle();
|
||||
|
||||
@if not $back2top_scrollpercent {
|
||||
width: 24px;
|
||||
}
|
||||
|
||||
&:hover {
|
||||
color: $sidebar-highlight;
|
||||
}
|
||||
|
||||
&.back-to-top-on {
|
||||
bottom: $b2t-position-bottom-on;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -29,6 +29,152 @@
|
||||
font-size: $font-size-smallest;
|
||||
}
|
||||
|
||||
.i18n-translate {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
|
||||
.fa {
|
||||
font-size: $font-size-largest;
|
||||
margin: auto 0;
|
||||
line-height: normal;
|
||||
}
|
||||
|
||||
.lang-select, .lang-options {
|
||||
|
||||
.flag-icon {
|
||||
background-size: cover;
|
||||
width: 30px;
|
||||
height: 20px;
|
||||
display: none;
|
||||
}
|
||||
|
||||
.flag-icon-zh-cn {
|
||||
background-image: url("/imgs/flags/zh-cn.svg");
|
||||
}
|
||||
|
||||
.flag-icon-en-us {
|
||||
background-image: url("/imgs/flags/en-us.svg");
|
||||
}
|
||||
|
||||
.flag-icon-fr-fr {
|
||||
background-image: url("/imgs/flags/fr-fr.svg");
|
||||
}
|
||||
}
|
||||
|
||||
.lang-select {
|
||||
|
||||
.flag-icon {
|
||||
display: block;
|
||||
}
|
||||
}
|
||||
|
||||
.lang-select {
|
||||
margin-left: 16px;
|
||||
position: relative;
|
||||
display: inline-block;
|
||||
line-height: 1.25;
|
||||
|
||||
.fa {
|
||||
font-size: $font-size-large;
|
||||
}
|
||||
|
||||
.selected-option {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
cursor: pointer;
|
||||
padding: 5px;
|
||||
border: 1px solid #ccc;
|
||||
border-radius: 4px;
|
||||
justify-content: center;
|
||||
width: 140px;
|
||||
|
||||
/* &:hover {
|
||||
+ .lang-options {
|
||||
display: block;
|
||||
opacity: 1;
|
||||
transform: translateY(0);
|
||||
}
|
||||
} */
|
||||
|
||||
.selected-language {
|
||||
margin: 0 10px;
|
||||
}
|
||||
}
|
||||
|
||||
.lang-options {
|
||||
display: none;
|
||||
position: absolute;
|
||||
top: 100%;
|
||||
left: 0;
|
||||
right: 0;
|
||||
border: 1px solid var(--border-color);
|
||||
border-top: none;
|
||||
border-radius: 0 0 4px 4px;
|
||||
background-color: #ffffff;
|
||||
opacity: 0;
|
||||
transform: translateY(-10px);
|
||||
transition: opacity 0.3s ease, transform 0.3s ease;
|
||||
z-index: 1;
|
||||
|
||||
&:hover {
|
||||
display: block;
|
||||
opacity: 1;
|
||||
transform: translateY(0);
|
||||
}
|
||||
|
||||
.lang-option {
|
||||
padding: 5px;
|
||||
cursor: pointer;
|
||||
display: flex;
|
||||
justify-content: left;
|
||||
padding-left: 14px;
|
||||
|
||||
&:hover {
|
||||
background-color: var(--selection-bg);
|
||||
}
|
||||
|
||||
.lang-name {
|
||||
margin: 0 16px 0 8px;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* select {
|
||||
margin-left: 10px;
|
||||
|
||||
option {
|
||||
font-size: $font-size-small;
|
||||
background-repeat: no-repeat;
|
||||
background-position: right center;
|
||||
padding-right: 30px;
|
||||
background-size: cover;
|
||||
}
|
||||
}
|
||||
|
||||
.flag-icon-zh-cn {
|
||||
background-image: url("../imgs/flags/zh-CN.png");
|
||||
}
|
||||
|
||||
.flag-icon-en-us {
|
||||
background-image: url("../imgs/flags/en-US.png");
|
||||
}
|
||||
|
||||
.flag-icon-fr-fr {
|
||||
background-image: url("../imgs/flags/fr-FR.png");
|
||||
}
|
||||
} */
|
||||
/* .google-translate {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
.fa {
|
||||
font-size: $font-size-larger;
|
||||
margin: auto 0;
|
||||
line-height: normal;
|
||||
}
|
||||
} */
|
||||
|
||||
@if $footer_vendors_enable {
|
||||
.vendors-list {
|
||||
a {
|
||||
@ -37,6 +183,18 @@
|
||||
|
||||
img {
|
||||
display: inline-block;
|
||||
max-width: 48px;
|
||||
min-width: 14px;
|
||||
max-height: 16px;
|
||||
|
||||
@include mobile() {
|
||||
max-width: 40px;
|
||||
}
|
||||
|
||||
// Only work for svg image
|
||||
&[src$=".svg"] {
|
||||
filter: var(--highlight-img-fill);
|
||||
}
|
||||
}
|
||||
|
||||
$footer_vendors_imgs_len: length($footer_vendors_imgs_width);
|
||||
@ -97,16 +255,3 @@
|
||||
vertical-align: middle;
|
||||
}
|
||||
}
|
||||
|
||||
.busuanzi-count {
|
||||
@if $busuanzi_visitors {
|
||||
#busuanzi_container_site_uv {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
@if $busuanzi_views {
|
||||
#busuanzi_container_site_pv {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,12 +1,26 @@
|
||||
// Menu
|
||||
// --------------------------------------------------
|
||||
.menu {
|
||||
.menu, .menu-children {
|
||||
margin: 0;
|
||||
padding: 1em 0;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.menu-item {
|
||||
.menu-children {
|
||||
max-height: 0;
|
||||
padding: 0;
|
||||
overflow: hidden;
|
||||
transition: max-height 1.5s ease-out;
|
||||
}
|
||||
|
||||
.menu-children {
|
||||
&.expand {
|
||||
max-height: 400px;
|
||||
transition: max-height 1.5s ease-in;
|
||||
}
|
||||
}
|
||||
|
||||
.menu-item, .menu-child-item {
|
||||
display: inline-block;
|
||||
list-style: none;
|
||||
margin: 0 10px;
|
||||
@ -33,6 +47,8 @@
|
||||
|
||||
.fa, .fab, .far, .fas {
|
||||
margin-right: 8px;
|
||||
width: 16px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.badge {
|
||||
@ -49,6 +65,15 @@
|
||||
margin-left: 0;
|
||||
}
|
||||
}
|
||||
|
||||
.menu-item-shrink-icon {
|
||||
float: right;
|
||||
}
|
||||
}
|
||||
|
||||
.menu-child-item {
|
||||
display: block;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.use-motion .menu-item {
|
||||
|
@ -20,7 +20,10 @@
|
||||
}
|
||||
|
||||
.post-block {
|
||||
margin-top: initial !important;
|
||||
//margin-top: initial !important;
|
||||
// https://github.com/hugo-next/hugo-theme-next/issues/154
|
||||
// make the post block more clear in small screen
|
||||
margin-top: 5px !important;
|
||||
// Inside posts blocks content padding (default 40px).
|
||||
padding: $content-mobile-padding 18px $content-mobile-padding !important;
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
.sidebar-inner {
|
||||
.sidebar-inner, .sidebar-card-widget {
|
||||
color: $grey-dark;
|
||||
// Init Sidebar & TOC inner dimensions on all pages and for all schemes.
|
||||
$offset : if(($scheme == 'Pisces') or ($scheme == 'Gemini'), $sidebar-offset, $sidebar-padding);
|
||||
@ -27,6 +27,8 @@
|
||||
|
||||
img {
|
||||
display: inline-block;
|
||||
max-width: 120px;
|
||||
max-height: 42px;
|
||||
}
|
||||
}
|
||||
|
||||
@ -39,3 +41,4 @@
|
||||
@import 'sidebar-toggle';
|
||||
@import 'sidebar-toc';
|
||||
@import 'site-state';
|
||||
@import 'sidebar-card-widget';
|
||||
|
@ -1,6 +1,7 @@
|
||||
.site-author-image {
|
||||
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;
|
||||
|
||||
@if $avatar_rounded {
|
||||
|
60
assets/css/_common/outline/sidebar/sidebar-card-widget.scss
Normal file
60
assets/css/_common/outline/sidebar/sidebar-card-widget.scss
Normal file
@ -0,0 +1,60 @@
|
||||
.sidebar-card-widget {
|
||||
background: var(--content-bg-color);
|
||||
@if ($scheme == 'Pisces') or ($scheme == 'Gemini'){
|
||||
border-radius: $border-radius;
|
||||
box-shadow: $box-shadow;
|
||||
}
|
||||
box-sizing: border-box;
|
||||
color: var(--text-color);
|
||||
margin-top: $sidebar-offset;
|
||||
|
||||
.item-headline {
|
||||
text-align: left;
|
||||
font-size: $font-size-small;
|
||||
font-weight: bold;
|
||||
|
||||
span {
|
||||
margin-left: 8px;
|
||||
}
|
||||
}
|
||||
|
||||
.siteinfo {
|
||||
font-size: $font-size-small;
|
||||
text-align: left;
|
||||
|
||||
.siteinfo-item {
|
||||
display: flex;
|
||||
-webkit-box-align: center;
|
||||
align-items: center;
|
||||
padding: 2px 10px 0;
|
||||
|
||||
i {
|
||||
width: 16px;
|
||||
height: 16px;
|
||||
text-align: center;
|
||||
margin-right: 4px;
|
||||
}
|
||||
|
||||
|
||||
div:first-child {
|
||||
-webkit-box-flex: 1;
|
||||
-moz-box-flex: 1;
|
||||
-o-box-flex: 1;
|
||||
box-flex: 1;
|
||||
-webkit-flex: 1;
|
||||
-ms-flex: 1;
|
||||
flex: 1;
|
||||
padding-right: 20px;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.back-to-top-card {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
|
||||
div:first-child {
|
||||
margin: 0;
|
||||
}
|
||||
}
|
@ -22,6 +22,7 @@
|
||||
|
||||
&:hover {
|
||||
color: $sidebar-nav-hover-color;
|
||||
border-bottom-color: $sidebar-highlight;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -29,6 +30,7 @@
|
||||
.sidebar-toc-active .sidebar-nav-toc, .sidebar-overview-active .sidebar-nav-overview {
|
||||
border-bottom-color: $sidebar-highlight;
|
||||
color: $sidebar-highlight;
|
||||
font-weight: bold;
|
||||
|
||||
&:hover {
|
||||
color: $sidebar-highlight;
|
||||
|
@ -1,62 +1,103 @@
|
||||
@if $toc_enable {
|
||||
.post-toc {
|
||||
font-size: $font-size-small;
|
||||
padding: 0 8px;
|
||||
.post-toc {
|
||||
font-size: $font-size-small;
|
||||
padding: 0 8px;
|
||||
|
||||
ul {
|
||||
list-style: none;
|
||||
margin: 0;
|
||||
padding: 0 2px 5px 10px;
|
||||
text-align: left;
|
||||
.active-current {
|
||||
color: $orange;
|
||||
}
|
||||
|
||||
> li {
|
||||
padding-left: 0;
|
||||
}
|
||||
ul {
|
||||
|
||||
a {
|
||||
transition: all $transition-ease;
|
||||
}
|
||||
}
|
||||
list-style: none;
|
||||
margin: 0;
|
||||
padding: 0 2px 5px 10px;
|
||||
text-align: left;
|
||||
counter-reset: item;
|
||||
|
||||
.nav-item {
|
||||
line-height: 1.8;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
>li {
|
||||
|
||||
@if not $toc_wrap {
|
||||
white-space: nowrap;
|
||||
}
|
||||
}
|
||||
|
||||
.nav {
|
||||
.nav-child {
|
||||
display: if($toc_expand_all, block, none);
|
||||
}
|
||||
> ul {
|
||||
border-left: 1px solid;
|
||||
margin-left: 4px;
|
||||
|
||||
.active > .nav-child {
|
||||
display: block;
|
||||
}
|
||||
|
||||
.active-current > .nav-child {
|
||||
display: block;
|
||||
|
||||
> .nav-item {
|
||||
display: block;
|
||||
li {
|
||||
position: relative;
|
||||
padding-left: 0;
|
||||
|
||||
&:before {
|
||||
position: absolute;
|
||||
content: ' ';
|
||||
top: 0.14em;
|
||||
left: -0.75em;
|
||||
width: 0.65em;
|
||||
height: 0.815em;
|
||||
border-style: none none dashed none;
|
||||
border-width: 0.05em;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.active > a {
|
||||
border-bottom-color: $sidebar-highlight;
|
||||
color: $sidebar-highlight;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
a {
|
||||
transition: all $transition-ease;
|
||||
border: none;
|
||||
@if $toc_number {
|
||||
&:before {
|
||||
content: counters(item, ".") ". ";
|
||||
counter-increment: item;
|
||||
}
|
||||
}
|
||||
|
||||
.active-current > a {
|
||||
color: $sidebar-highlight;
|
||||
|
||||
&:hover {
|
||||
color: $sidebar-highlight;
|
||||
}
|
||||
&:hover {
|
||||
text-decoration: underline;
|
||||
color: $orange;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.nav-item {
|
||||
line-height: 1.8;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
|
||||
@if not $toc_wrap {
|
||||
white-space: nowrap;
|
||||
}
|
||||
}
|
||||
|
||||
.nav {
|
||||
.nav-child {
|
||||
display: if($toc_expand_all, block, none);
|
||||
}
|
||||
|
||||
.active>.nav-child {
|
||||
display: block;
|
||||
}
|
||||
|
||||
.active-current>.nav-child {
|
||||
display: block;
|
||||
|
||||
>.nav-item {
|
||||
display: block;
|
||||
}
|
||||
}
|
||||
|
||||
.active>a {
|
||||
border-bottom-color: $sidebar-highlight;
|
||||
color: $sidebar-highlight;
|
||||
}
|
||||
|
||||
.active-current>a {
|
||||
color: $sidebar-highlight;
|
||||
|
||||
&:hover {
|
||||
color: $sidebar-highlight;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -1,6 +1,7 @@
|
||||
::selection {
|
||||
background: $selection-bg;
|
||||
color: $selection-color;
|
||||
background: var(--selection-bg);
|
||||
color: var(--selection-color);
|
||||
|
||||
}
|
||||
|
||||
html, body {
|
||||
|
@ -2,71 +2,183 @@
|
||||
.highlight {
|
||||
|
||||
background: var(--highlight-background);
|
||||
margin-bottom: 26px;
|
||||
line-height: 1.25;
|
||||
|
||||
.table-container, pre {
|
||||
position: relative;
|
||||
}
|
||||
> .code-header {
|
||||
color:#f8f8f2;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
padding: .25rem 0;
|
||||
width: 100%;
|
||||
|
||||
.table-container table tbody tr {
|
||||
background: none;
|
||||
}
|
||||
}
|
||||
&:hover {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
@if $codeblock_copy_btn_enable {
|
||||
.code-lang {
|
||||
width: 100%;
|
||||
text-align: center;
|
||||
font-weight: bold;
|
||||
|
||||
.highlight:hover .copy-btn, pre:hover .copy-btn {
|
||||
opacity: 1;
|
||||
}
|
||||
&::after {
|
||||
content: "Code";
|
||||
}
|
||||
}
|
||||
|
||||
.copy-btn {
|
||||
color: $black-dim;
|
||||
cursor: pointer;
|
||||
line-height: 1.6;
|
||||
opacity: 0;
|
||||
padding: 2px 6px;
|
||||
position: absolute;
|
||||
right: 8px;
|
||||
top: 4px;
|
||||
transition: opacity $transition-ease;
|
||||
background: var(--highlight-background);
|
||||
|
||||
@if $codeblock_style == 'flat' {
|
||||
background: white;
|
||||
border: 0;
|
||||
font-size: $font-size-smaller;
|
||||
|
||||
} @else if $codeblock_style == 'mac' {
|
||||
color: var(--highlight-foreground);
|
||||
font-size: 14px;
|
||||
border-radius: 3px;
|
||||
} @else {
|
||||
background-color: $gainsboro;
|
||||
background-image: linear-gradient(#fcfcfc, $gainsboro);
|
||||
border: 1px solid #d5d5d5;
|
||||
border-radius: 3px;
|
||||
font-size: $font-size-smaller;
|
||||
.collapse-btn {
|
||||
font-family: "Font Awesome 6 Free";
|
||||
font-weight: 900;
|
||||
text-align: center;
|
||||
width: 1.25em;
|
||||
display: inline-block;
|
||||
font-style: normal;
|
||||
font-variant: normal;
|
||||
line-height: 1;
|
||||
text-rendering: auto;
|
||||
padding-right: .25rem;
|
||||
transition: content 1s ease-in-out;
|
||||
|
||||
&::before {
|
||||
content: "\f102";
|
||||
}
|
||||
|
||||
&.collapse::before {
|
||||
content: "\f103";
|
||||
}
|
||||
}
|
||||
|
||||
@each $type, $text in $code-type-list {
|
||||
&.#{$type} .code-lang::after {
|
||||
content: $text;
|
||||
}
|
||||
}
|
||||
|
||||
.ellipses-btn {
|
||||
padding-right: .45rem;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@if $codeblock_style == 'mac' {
|
||||
.highlight {
|
||||
> .chroma {
|
||||
position: relative;
|
||||
max-height: 500px;
|
||||
opacity: 1;
|
||||
visibility: visible;
|
||||
transition: max-height 0.8s ease-in-out, opacity 0.7s ease-in-out;
|
||||
|
||||
&.hidden-code {
|
||||
max-height: 0;
|
||||
opacity: 0;
|
||||
visibility: hidden;
|
||||
|
||||
animation-name: slideInUp;
|
||||
animation-duration: 1s;
|
||||
}
|
||||
|
||||
pre {
|
||||
padding: .45rem 0;
|
||||
}
|
||||
|
||||
.lntd:first-child {
|
||||
min-width: 1.6rem;
|
||||
text-align: right;
|
||||
background-color: #272822;
|
||||
|
||||
a {
|
||||
border-bottom: none;
|
||||
}
|
||||
}
|
||||
|
||||
.lntd:last-child {
|
||||
width: 100%;
|
||||
|
||||
pre {
|
||||
overflow-wrap: break-word;
|
||||
white-space: pre-wrap;
|
||||
line-break: anywhere;
|
||||
word-break: break-all;
|
||||
overflow-x: auto;
|
||||
}
|
||||
}
|
||||
|
||||
> code > span {
|
||||
overflow-wrap: break-word;
|
||||
white-space: pre-wrap;
|
||||
line-break: anywhere;
|
||||
word-break: break-all;
|
||||
}
|
||||
|
||||
@if $codeblock_copy_btn_enable {
|
||||
|
||||
&:hover .copy-btn {
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
.copy-btn {
|
||||
color: $black-dim;
|
||||
cursor: pointer;
|
||||
line-height: 1.6;
|
||||
opacity: 0;
|
||||
padding: 2px 6px;
|
||||
position: absolute;
|
||||
right: 8px;
|
||||
top: 4px;
|
||||
border-radius: 3px;
|
||||
font-size: $font-size-medium;
|
||||
transition: opacity $transition-ease;
|
||||
background: var(--highlight-background);
|
||||
|
||||
font-family: "Font Awesome 6 Free";
|
||||
font-weight: 900;
|
||||
text-align: center;
|
||||
width: 1.25em;
|
||||
display: inline-block;
|
||||
font-style: normal;
|
||||
font-variant: normal;
|
||||
text-rendering: auto;
|
||||
|
||||
&::before {
|
||||
content: "\f0c5";
|
||||
}
|
||||
|
||||
&.copied::before {
|
||||
content: "\f058";
|
||||
}
|
||||
|
||||
&.uncopied::before {
|
||||
content: "\f057";
|
||||
}
|
||||
|
||||
@if $codeblock_style == 'flat' {
|
||||
background: white;
|
||||
border: 0;
|
||||
} @else if $codeblock_style == 'mac' {
|
||||
color: var(--highlight-foreground);
|
||||
} @else {
|
||||
background-color: $gainsboro;
|
||||
background-image: linear-gradient(#fcfcfc, $gainsboro);
|
||||
border: 1px solid #d5d5d5;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@if $codeblock_style == 'mac' {
|
||||
|
||||
border-radius: 5px;
|
||||
box-shadow: 0 10px 30px 0 rgba(0, 0, 0, .4);
|
||||
padding-top: 30px;
|
||||
|
||||
.table-container {
|
||||
border-radius: 0 0 5px 5px;
|
||||
}
|
||||
|
||||
&::before {
|
||||
background: #fc625d;
|
||||
box-shadow: 20px 0 #fdbc40, 40px 0 #35cd4b;
|
||||
margin-top: -20px;
|
||||
margin-left: 10px;
|
||||
position: absolute;
|
||||
@include round-icon(12px);
|
||||
}
|
||||
.code-header {
|
||||
|
||||
&::before {
|
||||
background: #fc625d;
|
||||
box-shadow: 20px 0 #fdbc40, 40px 0 #35cd4b;
|
||||
margin-left: 10px;
|
||||
@include round-icon(12px);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
@ -1,4 +1,5 @@
|
||||
@import 'copy-code';
|
||||
@import 'monokai';
|
||||
|
||||
%code-inline {
|
||||
background: var(--highlight-background);
|
||||
@ -6,9 +7,9 @@
|
||||
}
|
||||
|
||||
pre {
|
||||
padding: 10px;
|
||||
padding: 18px;
|
||||
margin: 0;
|
||||
}
|
||||
}
|
||||
|
||||
p > code, li > code {
|
||||
@extend %code-inline;
|
||||
|
87
assets/css/_common/scaffolding/highlight/monokai.scss
Normal file
87
assets/css/_common/scaffolding/highlight/monokai.scss
Normal file
@ -0,0 +1,87 @@
|
||||
/** monokai highlight style **/
|
||||
/* Background */ .bg { color:#f8f8f2;background-color:#272822; }
|
||||
/* PreWrapper */ .chroma { color:#f8f8f2;background-color:#272822; }
|
||||
/* Other */ .chroma .x { }
|
||||
/* Error */ .chroma .err { color:#960050;background-color:#1e0010 }
|
||||
/* CodeLine */ .chroma .cl { }
|
||||
/* LineLink */ .chroma .lnlinks { outline:none;text-decoration:none;color:inherit }
|
||||
/* LineTableTD */ .chroma .lntd { vertical-align:top;padding:0;margin:0;border:0; }
|
||||
/* LineTable */ .chroma .lntable { border-spacing:0;padding:0;margin:0;border:0; }
|
||||
/* LineHighlight */ .chroma .hl { background-color:#3c3d38 }
|
||||
/* LineNumbersTable */ .chroma .lnt { white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f }
|
||||
/* LineNumbers */ .chroma .ln { white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f }
|
||||
/* Line */ .chroma .line { display:flex; }
|
||||
/* Keyword */ .chroma .k { color:#66d9ef }
|
||||
/* KeywordConstant */ .chroma .kc { color:#66d9ef }
|
||||
/* KeywordDeclaration */ .chroma .kd { color:#66d9ef }
|
||||
/* KeywordNamespace */ .chroma .kn { color:#f92672 }
|
||||
/* KeywordPseudo */ .chroma .kp { color:#66d9ef }
|
||||
/* KeywordReserved */ .chroma .kr { color:#66d9ef }
|
||||
/* KeywordType */ .chroma .kt { color:#66d9ef }
|
||||
/* Name */ .chroma .n { }
|
||||
/* NameAttribute */ .chroma .na { color:#a6e22e }
|
||||
/* NameBuiltin */ .chroma .nb { }
|
||||
/* NameBuiltinPseudo */ .chroma .bp { }
|
||||
/* NameClass */ .chroma .nc { color:#a6e22e }
|
||||
/* NameConstant */ .chroma .no { color:#66d9ef }
|
||||
/* NameDecorator */ .chroma .nd { color:#a6e22e }
|
||||
/* NameEntity */ .chroma .ni { }
|
||||
/* NameException */ .chroma .ne { color:#a6e22e }
|
||||
/* NameFunction */ .chroma .nf { color:#a6e22e }
|
||||
/* NameFunctionMagic */ .chroma .fm { }
|
||||
/* NameLabel */ .chroma .nl { }
|
||||
/* NameNamespace */ .chroma .nn { }
|
||||
/* NameOther */ .chroma .nx { color:#a6e22e }
|
||||
/* NameProperty */ .chroma .py { }
|
||||
/* NameTag */ .chroma .nt { color:#f92672 }
|
||||
/* NameVariable */ .chroma .nv { }
|
||||
/* NameVariableClass */ .chroma .vc { }
|
||||
/* NameVariableGlobal */ .chroma .vg { }
|
||||
/* NameVariableInstance */ .chroma .vi { }
|
||||
/* NameVariableMagic */ .chroma .vm { }
|
||||
/* Literal */ .chroma .l { color:#ae81ff }
|
||||
/* LiteralDate */ .chroma .ld { color:#e6db74 }
|
||||
/* LiteralString */ .chroma .s { color:#e6db74 }
|
||||
/* LiteralStringAffix */ .chroma .sa { color:#e6db74 }
|
||||
/* LiteralStringBacktick */ .chroma .sb { color:#e6db74 }
|
||||
/* LiteralStringChar */ .chroma .sc { color:#e6db74 }
|
||||
/* LiteralStringDelimiter */ .chroma .dl { color:#e6db74 }
|
||||
/* LiteralStringDoc */ .chroma .sd { color:#e6db74 }
|
||||
/* LiteralStringDouble */ .chroma .s2 { color:#e6db74 }
|
||||
/* LiteralStringEscape */ .chroma .se { color:#ae81ff }
|
||||
/* LiteralStringHeredoc */ .chroma .sh { color:#e6db74 }
|
||||
/* LiteralStringInterpol */ .chroma .si { color:#e6db74 }
|
||||
/* LiteralStringOther */ .chroma .sx { color:#e6db74 }
|
||||
/* LiteralStringRegex */ .chroma .sr { color:#e6db74 }
|
||||
/* LiteralStringSingle */ .chroma .s1 { color:#e6db74 }
|
||||
/* LiteralStringSymbol */ .chroma .ss { color:#e6db74 }
|
||||
/* LiteralNumber */ .chroma .m { color:#ae81ff }
|
||||
/* LiteralNumberBin */ .chroma .mb { color:#ae81ff }
|
||||
/* LiteralNumberFloat */ .chroma .mf { color:#ae81ff }
|
||||
/* LiteralNumberHex */ .chroma .mh { color:#ae81ff }
|
||||
/* LiteralNumberInteger */ .chroma .mi { color:#ae81ff }
|
||||
/* LiteralNumberIntegerLong */ .chroma .il { color:#ae81ff }
|
||||
/* LiteralNumberOct */ .chroma .mo { color:#ae81ff }
|
||||
/* Operator */ .chroma .o { color:#f92672 }
|
||||
/* OperatorWord */ .chroma .ow { color:#f92672 }
|
||||
/* Punctuation */ .chroma .p { }
|
||||
/* Comment */ .chroma .c { color:#75715e }
|
||||
/* CommentHashbang */ .chroma .ch { color:#75715e }
|
||||
/* CommentMultiline */ .chroma .cm { color:#75715e }
|
||||
/* CommentSingle */ .chroma .c1 { color:#75715e }
|
||||
/* CommentSpecial */ .chroma .cs { color:#75715e }
|
||||
/* CommentPreproc */ .chroma .cp { color:#75715e }
|
||||
/* CommentPreprocFile */ .chroma .cpf { color:#75715e }
|
||||
/* Generic */ .chroma .g { }
|
||||
/* GenericDeleted */ .chroma .gd { color:#f92672 }
|
||||
/* GenericEmph */ .chroma .ge { font-style:italic }
|
||||
/* GenericError */ .chroma .gr { }
|
||||
/* GenericHeading */ .chroma .gh { }
|
||||
/* GenericInserted */ .chroma .gi { color:#a6e22e }
|
||||
/* GenericOutput */ .chroma .go { }
|
||||
/* GenericPrompt */ .chroma .gp { }
|
||||
/* GenericStrong */ .chroma .gs { font-weight:bold }
|
||||
/* GenericSubheading */ .chroma .gu { color:#75715e }
|
||||
/* GenericTraceback */ .chroma .gt { }
|
||||
/* GenericUnderline */ .chroma .gl { }
|
||||
/* TextWhitespace */ .chroma .w { }
|
@ -17,6 +17,7 @@ html {
|
||||
*/
|
||||
body {
|
||||
margin: 0;
|
||||
counter-reset: h2;
|
||||
}
|
||||
|
||||
/**
|
||||
|
16
assets/css/_common/scaffolding/tags/bilibili.scss
Normal file
16
assets/css/_common/scaffolding/tags/bilibili.scss
Normal file
@ -0,0 +1,16 @@
|
||||
.bilibili-video {
|
||||
position: relative;
|
||||
width: 100%;
|
||||
height: 0;
|
||||
padding-bottom: 50%;
|
||||
margin: auto;
|
||||
text-align: center;
|
||||
|
||||
iframe {
|
||||
position: absolute;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
left: 0;
|
||||
top: 0;
|
||||
}
|
||||
}
|
@ -2,7 +2,7 @@
|
||||
@import 'group-pictures';
|
||||
@import 'label';
|
||||
@import 'link-grid';
|
||||
@import 'mermaid';
|
||||
@import 'note';
|
||||
@import 'pdf';
|
||||
@import 'tabs';
|
||||
@import 'bilibili'
|
||||
|
@ -1,6 +0,0 @@
|
||||
@if $mermaid_enable {
|
||||
.mermaid {
|
||||
margin-bottom: 20px;
|
||||
text-align: center;
|
||||
}
|
||||
}
|
@ -1,7 +1,7 @@
|
||||
//@use 'sass:map';
|
||||
|
||||
@if $note_style != 'disabled' {
|
||||
.post-body .note {
|
||||
.main .note {
|
||||
$note-icons : $note_icons;
|
||||
$note-style : $note_style;
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
@mixin mobile-smallest() {
|
||||
@media (max-width: 413px) {
|
||||
@content;;
|
||||
@content;
|
||||
}
|
||||
}
|
||||
|
||||
@ -99,7 +99,7 @@
|
||||
@if $icon {
|
||||
content: $icon;
|
||||
}
|
||||
font-family: 'Font Awesome 5 Free';
|
||||
font-family: 'Font Awesome 6 Free';
|
||||
font-weight: 900;
|
||||
}
|
||||
|
||||
|
@ -25,7 +25,7 @@
|
||||
// ==================================================
|
||||
// Post blocks.
|
||||
.main-inner > {
|
||||
.sub-menu, .post-block, .tabs-comment, .comments, .post-comments, .pagination {
|
||||
.sub-menu, .post-block, .flinks-block, .tabs-comment, .comments, .post-comments, .pagination {
|
||||
background: var(--content-bg-color);
|
||||
border-radius: $border-radius-inner;
|
||||
box-shadow: $box-shadow-inner;
|
||||
@ -47,7 +47,7 @@
|
||||
}
|
||||
|
||||
// Post & Comments blocks.
|
||||
.post-block, .comments, .post-comments {
|
||||
.post-block, .flinks-block, .comments, .post-comments {
|
||||
padding: $content-desktop-padding;
|
||||
}
|
||||
|
||||
@ -70,7 +70,7 @@
|
||||
border-bottom: 1px solid $body-bg-color;
|
||||
}
|
||||
|
||||
h3 {
|
||||
h3, h4 {
|
||||
border-bottom: 1px dotted $body-bg-color;
|
||||
}
|
||||
}
|
||||
@ -91,7 +91,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
.post-block {
|
||||
.post-block, .flinks-block {
|
||||
// Inside posts blocks content padding (default 40px).
|
||||
padding: ($content-tablet-padding * 2);
|
||||
}
|
||||
@ -119,7 +119,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
.post-block {
|
||||
.post-block, .flinks-block {
|
||||
// Inside posts blocks content padding (default 40px).
|
||||
padding: $sidebar-offset;
|
||||
}
|
||||
|
@ -34,6 +34,10 @@
|
||||
}
|
||||
}
|
||||
|
||||
// a + ul {
|
||||
// top: calc(30% + 5px);
|
||||
// }
|
||||
|
||||
.badge {
|
||||
background: white;
|
||||
border-radius: 10px;
|
||||
@ -41,5 +45,24 @@
|
||||
padding: 1px 4px;
|
||||
text-shadow: 1px 1px 0 rgba(0, 0, 0, .1);
|
||||
}
|
||||
|
||||
.menu-item-shrink-icon {
|
||||
margin-left: 5px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.menu-children {
|
||||
display: none;
|
||||
transition: transform 1s ease-in-out;
|
||||
transform: translateY(-100%);
|
||||
// position: absolute;
|
||||
// z-index: 999;
|
||||
|
||||
&.expand {
|
||||
display: block;
|
||||
max-height: 400px;
|
||||
transition: transform 1.5s ease-in;
|
||||
transform: translateY(-100%);
|
||||
}
|
||||
}
|
||||
|
@ -43,4 +43,4 @@
|
||||
top: 50%;
|
||||
width: 6px;
|
||||
}
|
||||
}
|
||||
}
|
@ -13,6 +13,7 @@ $grey-lighter : #ddd;
|
||||
$grey-light : #ccc;
|
||||
$grey : #bbb;
|
||||
$grey-dark : #999;
|
||||
$grey-cnt : #5c5c5c;
|
||||
$grey-dim : #666;
|
||||
$black-light : #555;
|
||||
$black-dim : #333;
|
||||
@ -49,7 +50,8 @@ $blockquote-color : $grey-dim;
|
||||
$blockquote-color-dark : $grey;
|
||||
|
||||
// Global border color.
|
||||
$border-color : $grey-light;
|
||||
$border-color : $grey-dark;
|
||||
$border-color-dark : $grey-lighter;
|
||||
|
||||
// Background color for <body>
|
||||
$body-bg-color : white;
|
||||
@ -58,8 +60,10 @@ $content-bg-color : white;
|
||||
$content-bg-color-dark : $black-dim;
|
||||
|
||||
// Selection
|
||||
$selection-bg : $blue-deep;
|
||||
$selection-bg : rgba(53, 166, 247, 0.25) !default;
|
||||
$selection-bg-dark : rgba(50, 112, 194, 0.4) !default;
|
||||
$selection-color : $gainsboro;
|
||||
$selection-color-dark : $grey-dark;
|
||||
|
||||
// Dark mode color
|
||||
$card-bg-color : $whitesmoke;
|
||||
@ -171,6 +175,60 @@ $highlight-foreground-dark : $highlight_dark_foreground;
|
||||
$highlight-gutter-background-dark : mix($highlight-background-dark, $highlight-foreground-dark, 90%);
|
||||
$highlight-gutter-foreground-dark : mix($highlight-background-dark, $highlight-foreground-dark, 10%);
|
||||
|
||||
// Code type list
|
||||
$code-type-list:
|
||||
"language-bash" "Bash",
|
||||
"language-c" "C",
|
||||
"language-cs" "C#",
|
||||
"language-cpp" "C++",
|
||||
"language-clojure" "Clojure",
|
||||
"language-coffeescript" "CoffeeScript",
|
||||
"language-css" "CSS",
|
||||
"language-dart" "Dart",
|
||||
"language-diff" "Diff",
|
||||
"language-erlang" "Erlang",
|
||||
"language-go" "Go",
|
||||
"language-go-html-template" "Go HTML Template",
|
||||
"language-groovy" "Groovy",
|
||||
"language-haskell" "Haskell",
|
||||
"language-html" "HTML",
|
||||
"language-http" "HTTP",
|
||||
"language-xml" "XML",
|
||||
"language-java" "Java",
|
||||
"language-js" "JavaScript",
|
||||
"language-javascript" "JavaScript",
|
||||
"language-json" "JSON",
|
||||
"language-kotlin" "Kotlin",
|
||||
"language-latex" "LaTeX",
|
||||
"language-less" "Less",
|
||||
"language-lisp" "Lisp",
|
||||
"language-lua" "Lua",
|
||||
"language-makefile" "Makefile",
|
||||
"language-markdown" "Markdown",
|
||||
"language-matlab" "Matlab",
|
||||
"language-objectivec" "Objective-C",
|
||||
"language-php" "PHP",
|
||||
"language-perl" "Perl",
|
||||
"language-powershell" "PowerShell",
|
||||
"language-posh" "PowerShell",
|
||||
"language-pwsh" "PowerShell",
|
||||
"language-python" "Python",
|
||||
"language-r" "R",
|
||||
"language-ruby" "Ruby",
|
||||
"language-rust" "Rust",
|
||||
"language-scala" "Scala",
|
||||
"language-scss" "Scss",
|
||||
"language-shell" "Shell",
|
||||
"language-sql" "SQL",
|
||||
"language-swift" "Swift",
|
||||
"language-tex" "TeX",
|
||||
"language-toml" "TOML",
|
||||
"language-ts" "TypeScript",
|
||||
"language-typescript" "TypeScript",
|
||||
"language-vue" "Vue",
|
||||
"language-yml" "YAML",
|
||||
"language-yaml" "YAML",
|
||||
!default;
|
||||
|
||||
// Buttons
|
||||
// --------------------------------------------------
|
||||
@ -283,13 +341,20 @@ $site-state-item-name-color : inherit;
|
||||
|
||||
// Components
|
||||
// --------------------------------------------------
|
||||
// Tool buttons
|
||||
$tool-btn-bg : $black-deep;
|
||||
$tool-btn-color : white;
|
||||
$tool-btn-hover-fore-color : $orange;
|
||||
$tool-btn-opacity : .8;
|
||||
$tool-btn-opacity-hover : 1;
|
||||
|
||||
// Back to top
|
||||
$b2t-opacity : .8;
|
||||
$b2t-opacity-hover : 1;
|
||||
$b2t-position-bottom : -100px;
|
||||
$b2t-position-bottom-on : 19px;
|
||||
$b2t-position-right : 30px;
|
||||
$b2t-position-right-mobile : 20px;
|
||||
$b2t-position-right-mobile : 16px;
|
||||
$b2t-font-size : 12px;
|
||||
$b2t-color : white;
|
||||
$b2t-bg-color : $black-deep;
|
||||
|
@ -1,176 +0,0 @@
|
||||
/** User-defined style. **/
|
||||
{{ $P := .Site.Params -}}
|
||||
|
||||
{{- with $P.sidebar -}}
|
||||
{{- $width := (int (math.Max .width 240)) -}}
|
||||
{{- $offset := (int (math.Max .offset 12)) -}}
|
||||
{{- $padding := (int (math.Max .padding 18)) -}}
|
||||
{{- $positPad := (add $width $offset) }}
|
||||
.main {
|
||||
{{ if eq .position "right" }}
|
||||
flex-direction: row-reverse;
|
||||
{{- end }}
|
||||
}
|
||||
.header-inner {
|
||||
width: {{ $width }}px;
|
||||
}
|
||||
.main-inner {
|
||||
width: calc(100% - {{ $positPad }}px);
|
||||
}
|
||||
.sidebar {
|
||||
width: {{ $width }}px;
|
||||
visibility: inherit;
|
||||
}
|
||||
.sidebar-inner {
|
||||
padding: {{ $padding }}px 10px;
|
||||
}
|
||||
.footer-inner {
|
||||
padding-{{ .position }}: {{ $positPad }}px;
|
||||
}
|
||||
{{- end }}
|
||||
|
||||
.site-author-image {
|
||||
{{- if $P.avatar.rounded }}
|
||||
border-radius:50%;
|
||||
{{- end }}
|
||||
{{- if $P.avatar.rotated }}
|
||||
transition: transform 1s ease-out;
|
||||
{{- end }}
|
||||
}
|
||||
|
||||
.site-author-image:hover {
|
||||
transform: rotateZ(360deg);
|
||||
}
|
||||
|
||||
.site-state-item {
|
||||
border-left: 1px solid #eee;
|
||||
}
|
||||
.site-state-item:first-child {
|
||||
border-left: none;
|
||||
}
|
||||
|
||||
.rss-link {
|
||||
border-top: 1px dotted #ccc;
|
||||
border-bottom: 1px dotted #ccc;
|
||||
text-align: center;
|
||||
margin: 10px 0 0 0;
|
||||
}
|
||||
|
||||
.rss-link a {
|
||||
display: block;
|
||||
color: #fc6423;
|
||||
border-bottom: none;
|
||||
}
|
||||
|
||||
.rss-link a:hover {
|
||||
animation-name: wobble-vertical;
|
||||
animation-duration: 2s;
|
||||
animation-timing-function: ease-in-out;
|
||||
animation-iteration-count: 1;
|
||||
}
|
||||
|
||||
.rss-link a:hover > i {
|
||||
-webkit-transform: scaleY(-1);
|
||||
transform: scaleY(-1);
|
||||
}
|
||||
|
||||
.links-of-social a {
|
||||
font-size: 0.8125em;
|
||||
}
|
||||
.links-of-social .fa,
|
||||
.links-of-social .fab,
|
||||
.links-of-social .far,
|
||||
.links-of-social .fas {
|
||||
margin-right: 2px;
|
||||
}
|
||||
.links-of-social {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
justify-content: center;
|
||||
}
|
||||
.links-of-social-item {
|
||||
margin: 5px 0 0;
|
||||
{{- if and $P.socialIcons.enable (not $P.socialIcons.iconsOnly) }}
|
||||
width: 50%;
|
||||
{{- end }}
|
||||
}
|
||||
.links-of-social-item a {
|
||||
box-sizing: border-box;
|
||||
display: inline-block;
|
||||
max-width: 100%;
|
||||
overflow: hidden;
|
||||
padding: 0 5px;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
.links-of-social-item a {
|
||||
border-bottom: 0;
|
||||
border-radius: 4px;
|
||||
display: block;
|
||||
}
|
||||
.links-of-social-item a:hover {
|
||||
background: var(--body-bg-color);
|
||||
}
|
||||
|
||||
.cc-license {
|
||||
{{ if eq $P.creativeCommons.size "big" }}
|
||||
margin-top: 10px;
|
||||
{{ else }}
|
||||
margin-top: 5px;
|
||||
{{- end }}
|
||||
}
|
||||
|
||||
.back-to-top {
|
||||
bottom: 30px;
|
||||
}
|
||||
|
||||
.posts-expand .post-meta-container {
|
||||
margin: 10px auto;
|
||||
}
|
||||
|
||||
.post-meta-item-icon {
|
||||
margin: 0 0 0 -5px;
|
||||
}
|
||||
|
||||
:not(.post-meta-break) + .post-meta-item::before {
|
||||
content: '|';
|
||||
margin: 0 0.3em;
|
||||
}
|
||||
|
||||
.post-meta-catg:not(:last-child)::after {
|
||||
content: ';';
|
||||
margin: 0px;
|
||||
}
|
||||
|
||||
.posts-expand .post-header {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.posts-expand .post-body {
|
||||
margin: 28px 0;
|
||||
}
|
||||
|
||||
.post-footer-btn {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.beian img {
|
||||
display: inline-block;
|
||||
margin: 0 3px;
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
.with-love {
|
||||
{{- with $P.footer.icon.color }}
|
||||
color: {{ $P.footer.icon.color }};
|
||||
{{- end }}
|
||||
{{- if $P.footer.icon.animated }}
|
||||
animation: icon-animate 1.33s ease-in-out infinite;
|
||||
{{- end }}
|
||||
}
|
||||
|
||||
/* Font Awesome */
|
||||
.fa-spin {
|
||||
-webkit-animation: fa-spin .8s infinite linear;
|
||||
animation: fa-spin .8s infinite linear;
|
||||
}
|
@ -1,13 +1,12 @@
|
||||
// CSS Style Guide : https://codeguide.co/#css
|
||||
// All variables from site's config content.
|
||||
{{- $P := .Site.Params }}
|
||||
{{ $P := .Site.Params }}
|
||||
// Base
|
||||
$scheme : {{ $P.scheme }};
|
||||
$darkmode : {{ $P.darkmode }};
|
||||
|
||||
$body_scrollbar_overlay : {{ $P.bodyScrollbar.overlay }};
|
||||
$body_scrollbar_stable : {{ $P.bodyScrollbar.stable }};
|
||||
$mermaid_enable : {{ $P.mermaid.enable }};
|
||||
$mobile_layout_economy : {{ $P.mobileLayoutEconomy }};
|
||||
$theme_color_dark : {{ $P.themeColor.dark }};
|
||||
$theme_color_light : {{ $P.themeColor.light }};
|
||||
@ -33,11 +32,6 @@ $footer_vendors_enable : {{ isset $P.footer "vendors" }};
|
||||
{{ printf "$footer_vendors_imgs_width:%s;" (delimit (after 1 $width) ", ") }}
|
||||
{{ end }}
|
||||
|
||||
// Counter
|
||||
$busuanzi_visitors : {{ $P.busuanzi.visitors }};
|
||||
$busuanzi_views : {{ $P.busuanzi.views }};
|
||||
$busuanzi_post_views : {{ $P.busuanzi.postViews }};
|
||||
|
||||
// Font
|
||||
$font_enable : {{ $P.font.enable }};
|
||||
$font_global_size : {{ default $P.font.global.size 1 }};
|
||||
@ -70,11 +64,12 @@ $back2top_sidebar : {{ $P.backTop.sidebar }};
|
||||
$avatar_rotated : {{ $P.avatar.rotated }};
|
||||
$avatar_rounded : {{ $P.avatar.rounded }};
|
||||
$avatar_rounded : {{ $P.avatar.rounded }};
|
||||
$site_state : {{ $P.siteState }};
|
||||
$site_state : {{ $P.siteState.basic }};
|
||||
$social_icons_only : {{ $P.socialIcons.iconsOnly }};
|
||||
$social_icons_transition : {{ $P.socialIcons.transition }};
|
||||
$links_settings_layout : {{ $P.linksSets.layout }};
|
||||
$toc_enable : {{ $P.toc.enable }};
|
||||
$toc_number : {{ $P.toc.number }};
|
||||
$toc_expand_all : {{ $P.toc.expandAll }};
|
||||
$toc_wrap : {{ $P.toc.wrap }};
|
||||
|
||||
@ -89,6 +84,9 @@ $post_edit_enable : {{ $P.postEdit.enable }};
|
||||
$post_meta_item_text : {{ $P.postMeta.itemText }};
|
||||
$reward_settings_animation : {{ $P.rewardSets.animation }};
|
||||
$post_end_tag_icon : {{ $P.postFooter.tagIcon }};
|
||||
$post_share_enable : {{ $P.share.enable }};
|
||||
$post_sharethis_set : {{ isset $P.share "sharethis" }};
|
||||
$post_alert_colors : ({{ range $key, $value := $P.postAlerts }} {{ $key }}: {{ $value.color }}, {{ end }});
|
||||
|
||||
// TODO find the paramters
|
||||
$text_align_desktop : {{ $P.textAlign.desktop }};
|
||||
@ -112,7 +110,6 @@ $reading_progress_position : {{ $P.readingProgress.position }};
|
||||
$reading_progress_reversed : {{ $P.readingProgress.reversed }};
|
||||
|
||||
// Thirdparty
|
||||
$math_mathjax_enable : {{ $P.math.mathjax.enable }};
|
||||
// TODO
|
||||
//$related_posts_enable : {{ $P.relatedPosts.enable }};
|
||||
$related_posts_enable : false;
|
||||
@ -131,21 +128,21 @@ $gitter_enable : {{ $P.gitter.enable }};
|
||||
// Comment
|
||||
//$disqusjs_enable : {{ $P.disqusjs.enable }};
|
||||
$disqusjs_enable : false;
|
||||
$livere_enable : {{ isset $P.livere "uid" }};
|
||||
$utterances_enable : {{ isset $P.utterances "utterances" }};
|
||||
$waline_enable : {{ isset $P.waline "serverurl" }};
|
||||
{{- with .Site.Params.comments }}
|
||||
{{- $tce := and (isset . "nav") (and .storage (gt (len .nav) 1)) }}
|
||||
$livere_enable : {{ isset $P "livere" }};
|
||||
$utterances_enable : {{ isset $P "utterances" }};
|
||||
$waline_enable : {{ isset $P "waline" }};
|
||||
{{ with .Site.Params.comments }}
|
||||
{{ $tce := and (isset . "nav") (and .storage (gt (len .nav) 1)) }}
|
||||
$two_comments_enable : {{ $tce }};
|
||||
{{- if $tce }}
|
||||
{{- $sortNav := sort .nav "weight" }}
|
||||
{{ if $tce }}
|
||||
{{ $sortNav := sort .nav "weight" }}
|
||||
$two_comments_actived : {{ .active }};
|
||||
$first_comment_color : {{ (index $sortNav 0).color }};
|
||||
$first_comment_name : {{ lower (index $sortNav 0).name }};
|
||||
$second_comment_color : {{ (index $sortNav 1).color }};
|
||||
$second_comment_name : {{ lower (index $sortNav 1).name }};
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
|
||||
//
|
||||
// Variables Layer
|
||||
@ -180,9 +177,4 @@ $second_comment_name : {{ lower (index $sortNav 1).name }};
|
||||
|
||||
// Schemes Layer
|
||||
// --------------------------------------------------
|
||||
{{ printf "@import '_schemes/%s/';" $P.scheme }}
|
||||
|
||||
// Custom Layer
|
||||
// TODO
|
||||
// --------------------------------------------------
|
||||
// @import 'theme.injects.style';
|
||||
{{ printf "@import '_schemes/%s/';" $P.scheme }}
|
@ -3,10 +3,13 @@ body { margin-top: 2rem; }
|
||||
.use-motion .menu-item,
|
||||
.use-motion .sidebar,
|
||||
.use-motion .post-block,
|
||||
.use-motion .flinks-block,
|
||||
.use-motion .pagination,
|
||||
.use-motion .comments,
|
||||
.use-motion .post-header,
|
||||
.use-motion .flinks-header,
|
||||
.use-motion .post-body,
|
||||
.use-motion .flinks-body,
|
||||
.use-motion .collection-header {
|
||||
visibility: visible;
|
||||
}
|
||||
|
33
assets/js/3rd/comments/artalk.js
Normal file
33
assets/js/3rd/comments/artalk.js
Normal file
@ -0,0 +1,33 @@
|
||||
/* Artalk comment plugin */
|
||||
NexT.plugins.comments.artalk = function() {
|
||||
const element = '.artalk-container';
|
||||
if (!NexT.CONFIG.artalk
|
||||
|| !NexT.utils.checkDOMExist(element)) return;
|
||||
|
||||
const artalk_js = NexT.utils.getCDNResource(NexT.CONFIG.artalk.js);
|
||||
const {
|
||||
site,
|
||||
placeholder,
|
||||
server,
|
||||
} = NexT.CONFIG.artalk.cfg;
|
||||
|
||||
NexT.utils.lazyLoadComponent(element, function() {
|
||||
NexT.utils.getScript(artalk_js, function(){
|
||||
const artalk_css = NexT.utils.getCDNResource(NexT.CONFIG.artalk.css);
|
||||
NexT.utils.getStyle(artalk_css);
|
||||
|
||||
new Artalk({
|
||||
el : element,
|
||||
pageKey : NexT.CONFIG.permalink,
|
||||
pageTitle : NexT.CONFIG.title,
|
||||
server : server,
|
||||
site : site,
|
||||
locale : NexT.CONFIG.lang,
|
||||
placeholder : placeholder,
|
||||
darkMode : 'auto'
|
||||
});
|
||||
});
|
||||
|
||||
NexT.utils.hiddeLodingCmp(element);
|
||||
});
|
||||
}
|
42
assets/js/3rd/comments/giscus.js
Normal file
42
assets/js/3rd/comments/giscus.js
Normal file
@ -0,0 +1,42 @@
|
||||
/* Giscus comment plugin */
|
||||
NexT.plugins.comments.giscus = function() {
|
||||
const element = '.giscus-container';
|
||||
if (!NexT.CONFIG.page.comments
|
||||
|| !NexT.CONFIG.giscus
|
||||
|| !NexT.utils.checkDOMExist(element)) return;
|
||||
|
||||
const {
|
||||
category,
|
||||
categoryid,
|
||||
emit,
|
||||
inputposition,
|
||||
mapping,
|
||||
reactions,
|
||||
repo,
|
||||
repoid,
|
||||
theme } = NexT.CONFIG.giscus.cfg;
|
||||
|
||||
|
||||
NexT.utils.lazyLoadComponent(element, function() {
|
||||
NexT.utils.getScript(NexT.CONFIG.giscus.js, {
|
||||
attributes: {
|
||||
'async' : true,
|
||||
'crossorigin' : 'anonymous',
|
||||
'data-repo' : repo,
|
||||
'data-repo-id' : repoid,
|
||||
'data-category' : category,
|
||||
'data-category-id' : categoryid,
|
||||
'data-mapping' : mapping,
|
||||
'data-reactions-enabled' : reactions ? 1:0,
|
||||
'data-emit-metadata' : emit ? 1:0,
|
||||
'data-input-position' : inputposition,
|
||||
'data-theme' : theme,
|
||||
'data-lang' : NexT.CONFIG.lang,
|
||||
'data-loading' : 'lazy'
|
||||
},
|
||||
parentNode: document.querySelector(element)
|
||||
});
|
||||
|
||||
NexT.utils.hiddeLodingCmp(element);
|
||||
});
|
||||
}
|
17
assets/js/3rd/comments/livere.js
Normal file
17
assets/js/3rd/comments/livere.js
Normal file
@ -0,0 +1,17 @@
|
||||
/* LiveRe comment plugin */
|
||||
NexT.plugins.comments.livere = function() {
|
||||
const element = '#lv-container';
|
||||
if (!NexT.CONFIG.livere
|
||||
|| !NexT.utils.checkDOMExist(element)) return;
|
||||
|
||||
NexT.utils.lazyLoadComponent(element, function() {
|
||||
NexT.utils.getScript(NexT.CONFIG.livere.js, {
|
||||
attributes: {
|
||||
async: true
|
||||
},
|
||||
parentNode: document.querySelector(element)
|
||||
});
|
||||
|
||||
NexT.utils.hiddeLodingCmp(element);
|
||||
});
|
||||
}
|
28
assets/js/3rd/comments/utterances.js
Normal file
28
assets/js/3rd/comments/utterances.js
Normal file
@ -0,0 +1,28 @@
|
||||
/* Utterances comment plugin */
|
||||
NexT.plugins.comments.utterances = function() {
|
||||
const element = '.utterances-container';
|
||||
if (!NexT.CONFIG.utterances
|
||||
|| !NexT.utils.checkDOMExist(element)) return;
|
||||
|
||||
const {
|
||||
repo,
|
||||
issueterm,
|
||||
label,
|
||||
theme } = NexT.CONFIG.utterances.cfg;
|
||||
|
||||
NexT.utils.lazyLoadComponent(element, function() {
|
||||
NexT.utils.getScript(NexT.CONFIG.utterances.js, {
|
||||
attributes: {
|
||||
'async' : true,
|
||||
'crossorigin' : 'anonymous',
|
||||
'repo' : repo,
|
||||
'issue-term' : issueterm,
|
||||
'label' : label,
|
||||
'theme' : theme
|
||||
},
|
||||
parentNode: document.querySelector(element)
|
||||
});
|
||||
|
||||
NexT.utils.hiddeLodingCmp(element);
|
||||
});
|
||||
}
|
53
assets/js/3rd/comments/waline.js
Normal file
53
assets/js/3rd/comments/waline.js
Normal file
@ -0,0 +1,53 @@
|
||||
/* Waline comment plugin */
|
||||
NexT.plugins.comments.waline = function() {
|
||||
const element = '.waline-container';
|
||||
if (!NexT.CONFIG.waline
|
||||
|| !NexT.utils.checkDOMExist(element)) return;
|
||||
|
||||
const {
|
||||
emoji,
|
||||
imguploader,
|
||||
placeholder,
|
||||
sofa,
|
||||
requiredmeta,
|
||||
serverurl,
|
||||
wordlimit,
|
||||
reaction,
|
||||
reactiontext,
|
||||
reactiontitle
|
||||
} = NexT.CONFIG.waline.cfg;
|
||||
|
||||
const waline_js = NexT.utils.getCDNResource(NexT.CONFIG.waline.js);
|
||||
|
||||
let locale = {
|
||||
placeholder : placeholder,
|
||||
sofa : sofa,
|
||||
reactionTitle : reactiontitle
|
||||
};
|
||||
|
||||
reactiontext.forEach(function(value, index){
|
||||
locale['reaction'+index] = value;
|
||||
});
|
||||
|
||||
NexT.utils.lazyLoadComponent(element, function () {
|
||||
NexT.utils.getScript(waline_js, function(){
|
||||
const waline_css = NexT.utils.getCDNResource(NexT.CONFIG.waline.css);
|
||||
NexT.utils.getStyle(waline_css, 'before');
|
||||
|
||||
Waline.init({
|
||||
locale,
|
||||
el : element,
|
||||
emoji : emoji,
|
||||
imageUploader : imguploader,
|
||||
wordLimit : wordlimit,
|
||||
requiredMeta : requiredmeta,
|
||||
reaction : reaction,
|
||||
serverURL : serverurl,
|
||||
lang : NexT.CONFIG.lang,
|
||||
dark : 'html[data-theme="dark"]'
|
||||
});
|
||||
|
||||
NexT.utils.hiddeLodingCmp(element);
|
||||
})
|
||||
});
|
||||
}
|
60
assets/js/3rd/comments/waline3.js
Normal file
60
assets/js/3rd/comments/waline3.js
Normal file
@ -0,0 +1,60 @@
|
||||
/* Waline3 comment plugin */
|
||||
NexT.plugins.comments.waline3 = function () {
|
||||
const element = '.waline3-container';
|
||||
if (!NexT.CONFIG.waline3
|
||||
|| !NexT.utils.checkDOMExist(element)) return;
|
||||
|
||||
const {
|
||||
emoji,
|
||||
search,
|
||||
imguploader,
|
||||
placeholder,
|
||||
sofa,
|
||||
requiredmeta,
|
||||
serverurl,
|
||||
wordlimit,
|
||||
reaction,
|
||||
reactiontext,
|
||||
reactiontitle
|
||||
} = NexT.CONFIG.waline3.cfg;
|
||||
|
||||
const waline_js = NexT.utils.getCDNResource(NexT.CONFIG.waline3.js);
|
||||
|
||||
NexT.utils.lazyLoadComponent(element, () => {
|
||||
|
||||
const waline_css = NexT.utils.getCDNResource(NexT.CONFIG.waline3.css);
|
||||
NexT.utils.getStyle(waline_css, 'before');
|
||||
|
||||
let waline_script = `
|
||||
let locale = {
|
||||
placeholder : '${placeholder}',
|
||||
sofa : '${sofa}',
|
||||
reactionTitle : '${reactiontitle}'
|
||||
};
|
||||
|
||||
let recatt = ${JSON.stringify(reactiontext)}
|
||||
recatt.forEach(function(value, index){
|
||||
locale['reaction'+index] = value;
|
||||
});
|
||||
|
||||
import('${waline_js}').then((Waline) => {
|
||||
Waline.init({
|
||||
locale,
|
||||
el : '${element}',
|
||||
emoji : ${emoji},
|
||||
search : ${search},
|
||||
imageUploader : ${imguploader},
|
||||
wordLimit : ${wordlimit},
|
||||
requiredMeta : ${JSON.stringify(requiredmeta)},
|
||||
reaction : ${reaction},
|
||||
serverURL : '${serverurl}',
|
||||
dark : 'html[data-theme="dark"]'
|
||||
});
|
||||
|
||||
NexT.utils.hiddeLodingCmp('${element}');
|
||||
});
|
||||
`;
|
||||
|
||||
NexT.utils.getScript(null, { module: true, textContent: waline_script });
|
||||
});
|
||||
}
|
57
assets/js/3rd/others/clipboard.js
Normal file
57
assets/js/3rd/others/clipboard.js
Normal file
@ -0,0 +1,57 @@
|
||||
/* clipboard plugin */
|
||||
NexT.plugins.others.clipboard = function () {
|
||||
|
||||
let chromaDiv = document.querySelectorAll('div.highlight div.chroma');
|
||||
if (chromaDiv.length === 0) return;
|
||||
|
||||
chromaDiv.forEach(element => {
|
||||
// Add copy button DOM.
|
||||
let codeblock = element.querySelector('code[class]:not([class=""]');
|
||||
let lang = codeblock.className;
|
||||
let copyBtn = document.createElement('div');
|
||||
copyBtn.classList.add('copy-btn');
|
||||
codeblock.parentNode.appendChild(copyBtn);
|
||||
|
||||
element.addEventListener('mouseleave', () => {
|
||||
setTimeout(() => {
|
||||
copyBtn.classList.remove('copied','uncopied');
|
||||
}, 300);
|
||||
});
|
||||
|
||||
// Add code header show
|
||||
var ch = document.createElement('div');
|
||||
ch.classList.add('code-header');
|
||||
ch.classList.add(lang);
|
||||
ch.insertAdjacentHTML('afterbegin',
|
||||
'<span class="code-lang"></span><span class="collapse-btn"></span>');
|
||||
ch.addEventListener('click', function () {
|
||||
element.classList.toggle('hidden-code');
|
||||
ch.querySelector('.collapse-btn').classList.toggle('collapse');
|
||||
}, false);
|
||||
|
||||
element.parentNode.insertBefore(ch, element);
|
||||
});
|
||||
|
||||
if (!NexT.CONFIG.copybtn || !NexT.CONFIG.page.clipboard) return;
|
||||
|
||||
const clipboard_js = NexT.utils.getCDNResource(NexT.CONFIG.page.clipboard.js);
|
||||
NexT.utils.getScript(clipboard_js, function () {
|
||||
// Register the clipboard event.
|
||||
var clipboard = new ClipboardJS('.copy-btn', {
|
||||
text: function (trigger) {
|
||||
// TODO: Why there clipboard default text content with enter?
|
||||
return trigger.previousElementSibling.textContent.trim();
|
||||
}
|
||||
});
|
||||
|
||||
clipboard.on('success', function (e) {
|
||||
e.clearSelection();
|
||||
e.trigger.classList.add('copied');
|
||||
});
|
||||
|
||||
clipboard.on('error', function (e) {
|
||||
console.error('Copy failed:', e);
|
||||
e.trigger.classList.add('uncopied');
|
||||
});
|
||||
});
|
||||
}
|
66
assets/js/3rd/others/counter.js
Normal file
66
assets/js/3rd/others/counter.js
Normal file
@ -0,0 +1,66 @@
|
||||
/* 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) {
|
||||
let pageview_el = '#pageview-count';
|
||||
|
||||
switch (views.plugin) {
|
||||
case 'waline':
|
||||
pageview_js = NexT.utils.getCDNResource(NexT.CONFIG.page.waline.pagecnt);
|
||||
NexT.utils.getScript(pageview_js, function () {
|
||||
Waline.pageviewCount({
|
||||
selector : pageview_el,
|
||||
serverURL: NexT.CONFIG.waline.cfg.serverurl
|
||||
});
|
||||
});
|
||||
break;
|
||||
case 'waline3':
|
||||
pageview_js = NexT.utils.getCDNResource(NexT.CONFIG.page.waline3.pagecnt);
|
||||
|
||||
let pageview_script = `
|
||||
import('${pageview_js}').then((Waline) => {
|
||||
Waline.pageviewCount({
|
||||
selector : '${pageview_el}',
|
||||
serverURL: '${NexT.CONFIG.waline3.cfg.serverurl}'
|
||||
})
|
||||
});
|
||||
`;
|
||||
NexT.utils.getScript(null, { module: true, textContent: pageview_script });
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
const comments = post_meta.comments;
|
||||
if (comments != undefined && comments.enable) {
|
||||
let comments_el = '#comments-count';
|
||||
switch (comments.plugin) {
|
||||
case 'waline':
|
||||
comment_js = NexT.utils.getCDNResource(NexT.CONFIG.page.waline.commentcnt);
|
||||
NexT.utils.getScript(comment_js, function () {
|
||||
Waline.commentCount({
|
||||
selector : comments_el,
|
||||
serverURL: NexT.CONFIG.waline.cfg.serverurl
|
||||
});
|
||||
});
|
||||
break;
|
||||
case 'waline3':
|
||||
comment_js = NexT.utils.getCDNResource(NexT.CONFIG.page.waline3.commentcnt);
|
||||
let comment_script = `
|
||||
import('${comment_js}').then((Waline) => {
|
||||
Waline.commentCount({
|
||||
selector : '${comments_el}',
|
||||
serverURL: '${NexT.CONFIG.waline3.cfg.serverurl}'
|
||||
})
|
||||
});
|
||||
`;
|
||||
NexT.utils.getScript(null, { module: true, textContent: comment_script });
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
22
assets/js/3rd/others/lawidget.js
Normal file
22
assets/js/3rd/others/lawidget.js
Normal file
@ -0,0 +1,22 @@
|
||||
/* 51La sidebar data widget */
|
||||
NexT.plugins.others.lawidget = function() {
|
||||
|
||||
if (!NexT.CONFIG.lawidget ) {
|
||||
return;
|
||||
}
|
||||
|
||||
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());
|
||||
});
|
||||
}
|
49
assets/js/3rd/others/math.js
Normal file
49
assets/js/3rd/others/math.js
Normal file
@ -0,0 +1,49 @@
|
||||
/* 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);
|
||||
const mathjaxCfg = `
|
||||
window.MathJax = {
|
||||
// 自定义内联数学公式的分隔符号
|
||||
tex: {
|
||||
inlineMath: [['$', '$'], ['\\(', '\\)']]
|
||||
},
|
||||
// SVG 渲染配置为全局共享字体缓存
|
||||
svg: {
|
||||
fontCache: 'global'
|
||||
},
|
||||
// 排除特定的HTML标签,避免过度渲染
|
||||
options: {
|
||||
skipHtmlTags: ["script", "noscript", "style", "textarea", "pre", "footer"],
|
||||
}
|
||||
};
|
||||
`;
|
||||
NexT.utils.getScript(null, { textContent: mathjaxCfg });
|
||||
NexT.utils.getScript(render_js, { attributes: { id: "MathJax-script", "async": true }});
|
||||
}
|
||||
|
||||
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/3rd/others/mermaid.js
Normal file
15
assets/js/3rd/others/mermaid.js
Normal 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
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
142
assets/js/3rd/search/algolia.js
Normal file
142
assets/js/3rd/search/algolia.js
Normal file
@ -0,0 +1,142 @@
|
||||
/* Algolia search engine */
|
||||
NexT.plugins.search.algolia = function() {
|
||||
|
||||
const algoliajs = NexT.utils.getCDNResource(NexT.CONFIG.algolia.js);
|
||||
const instantschjs = NexT.utils.getCDNResource(NexT.CONFIG.algolia.instantjs);
|
||||
|
||||
NexT.utils.getScript(algoliajs);
|
||||
NexT.utils.getScript(instantschjs, function() {
|
||||
|
||||
const { indexname, appid, apikey, hits } = NexT.CONFIG.algolia.cfg;
|
||||
const indexName = indexname;
|
||||
|
||||
const search = instantsearch({
|
||||
indexName,
|
||||
searchClient: algoliasearch(appid, apikey),
|
||||
searchFunction: helper => {
|
||||
if (document.querySelector('.search-input').value) {
|
||||
helper.search();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
const markKeyWords = function(content) {
|
||||
return content.replaceAll("<mark>", '<mark class="search-keyword">');
|
||||
};
|
||||
|
||||
if (typeof pjax === 'object') {
|
||||
search.on('render', () => {
|
||||
pjax.refresh(document.querySelector('.algolia-hits'));
|
||||
});
|
||||
}
|
||||
|
||||
// Registering Widgets
|
||||
search.addWidgets([
|
||||
instantsearch.widgets.configure({
|
||||
hitsPerPage: hits.perpage || 10
|
||||
}),
|
||||
|
||||
instantsearch.widgets.searchBox({
|
||||
container: '.search-input-container',
|
||||
placeholder: NexT.CONFIG.i18n.placeholder,
|
||||
// Hide default icons of algolia search
|
||||
showReset: false,
|
||||
showSubmit: false,
|
||||
showLoadingIndicator: true,
|
||||
cssClasses: {
|
||||
input: 'search-input'
|
||||
}
|
||||
}),
|
||||
|
||||
instantsearch.widgets.stats({
|
||||
container: '.algolia-stats',
|
||||
templates: {
|
||||
text: data => {
|
||||
const stats = NexT.CONFIG.i18n.hits_time
|
||||
.replace('${hits}', data.nbHits)
|
||||
.replace('${time}', data.processingTimeMS);
|
||||
return `${stats}`;
|
||||
}
|
||||
},
|
||||
cssClasses: {
|
||||
text: 'search-stats'
|
||||
}
|
||||
}),
|
||||
|
||||
instantsearch.widgets.hits({
|
||||
container: '.algolia-hits',
|
||||
escapeHTML: true,
|
||||
templates: {
|
||||
item: data => {
|
||||
const { title, content } = data._highlightResult;
|
||||
let result = `<a href="${data.permalink}" class="search-result-title">${markKeyWords(title.value)}</a>`;
|
||||
//const content = excerpt || excerptStrip || content;
|
||||
if (content && content.value) {
|
||||
const div = document.createElement('div');
|
||||
div.innerHTML = markKeyWords(content.value);
|
||||
result += `<a href="${data.permalink}"><p class="search-result">${div.innerHTML.substring(0, 200)}...</p></a>`;
|
||||
}
|
||||
return result;
|
||||
},
|
||||
empty: data => {
|
||||
return `<div class="algolia-hits-empty">
|
||||
${NexT.CONFIG.i18n.empty.replace('${query}', data.query)}
|
||||
</div>`;
|
||||
}
|
||||
},
|
||||
cssClasses: {
|
||||
list: 'search-result-list'
|
||||
}
|
||||
}),
|
||||
|
||||
instantsearch.widgets.pagination({
|
||||
container: '.algolia-pagination',
|
||||
scrollTo: false,
|
||||
showFirst: true,
|
||||
showLast: true,
|
||||
templates: {
|
||||
first: '<i class="fa fa-angle-double-left"></i>',
|
||||
last: '<i class="fa fa-angle-double-right"></i>',
|
||||
previous: '<i class="fa fa-angle-left"></i>',
|
||||
next: '<i class="fa fa-angle-right"></i>'
|
||||
},
|
||||
cssClasses: {
|
||||
list: ['pagination', 'algolia-pagination'],
|
||||
item: 'pagination-item',
|
||||
link: 'page-number',
|
||||
selectedItem: 'current',
|
||||
disabledItem: 'disabled-item'
|
||||
}
|
||||
})
|
||||
]);
|
||||
|
||||
search.start();
|
||||
|
||||
// Handle and trigger popup window
|
||||
document.querySelectorAll('.popup-trigger').forEach(element => {
|
||||
element.addEventListener('click', () => {
|
||||
document.body.classList.add('search-active');
|
||||
setTimeout(() => document.querySelector('.search-input').focus(), 500);
|
||||
});
|
||||
});
|
||||
|
||||
// Monitor main search box
|
||||
const onPopupClose = () => {
|
||||
document.body.classList.remove('search-active');
|
||||
};
|
||||
|
||||
document.querySelector('.search-pop-overlay').addEventListener('click', event => {
|
||||
if (event.target === document.querySelector('.search-pop-overlay')) {
|
||||
onPopupClose();
|
||||
}
|
||||
});
|
||||
document.querySelector('.popup-btn-close').addEventListener('click', onPopupClose);
|
||||
document.addEventListener('pjax:success', onPopupClose);
|
||||
window.addEventListener('keyup', event => {
|
||||
if (event.key === 'Escape') {
|
||||
onPopupClose();
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
}
|
326
assets/js/3rd/search/local.js
Normal file
326
assets/js/3rd/search/local.js
Normal file
@ -0,0 +1,326 @@
|
||||
/* LocalSearch engine */
|
||||
class LocalSearch {
|
||||
constructor({
|
||||
path = '',
|
||||
unescape = false,
|
||||
top_n_per_article = 1
|
||||
}) {
|
||||
this.path = path;
|
||||
this.unescape = unescape;
|
||||
this.top_n_per_article = top_n_per_article;
|
||||
this.isfetched = false;
|
||||
this.datas = null;
|
||||
}
|
||||
|
||||
getIndexByWord(words, text, caseSensitive = false) {
|
||||
const index = [];
|
||||
const included = new Set();
|
||||
|
||||
if (!caseSensitive) {
|
||||
text = text.toLowerCase();
|
||||
}
|
||||
words.forEach(word => {
|
||||
if (this.unescape) {
|
||||
const div = document.createElement('div');
|
||||
div.innerText = word;
|
||||
word = div.innerHTML;
|
||||
}
|
||||
const wordLen = word.length;
|
||||
if (wordLen === 0) return;
|
||||
let startPosition = 0;
|
||||
let position = -1;
|
||||
if (!caseSensitive) {
|
||||
word = word.toLowerCase();
|
||||
}
|
||||
while ((position = text.indexOf(word, startPosition)) > -1) {
|
||||
index.push({ position, word });
|
||||
included.add(word);
|
||||
startPosition = position + wordLen;
|
||||
}
|
||||
});
|
||||
// Sort index by position of keyword
|
||||
index.sort((left, right) => {
|
||||
if (left.position !== right.position) {
|
||||
return left.position - right.position;
|
||||
}
|
||||
return right.word.length - left.word.length;
|
||||
});
|
||||
return [index, included];
|
||||
}
|
||||
|
||||
// Merge hits into slices
|
||||
mergeIntoSlice(start, end, index) {
|
||||
let item = index[0];
|
||||
let { position, word } = item;
|
||||
const hits = [];
|
||||
const count = new Set();
|
||||
while (position + word.length <= end && index.length !== 0) {
|
||||
count.add(word);
|
||||
hits.push({
|
||||
position,
|
||||
length: word.length
|
||||
});
|
||||
const wordEnd = position + word.length;
|
||||
|
||||
// Move to next position of hit
|
||||
index.shift();
|
||||
while (index.length !== 0) {
|
||||
item = index[0];
|
||||
position = item.position;
|
||||
word = item.word;
|
||||
if (wordEnd > position) {
|
||||
index.shift();
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
return {
|
||||
hits,
|
||||
start,
|
||||
end,
|
||||
count: count.size
|
||||
};
|
||||
}
|
||||
|
||||
// Highlight title and content
|
||||
highlightKeyword(val, slice) {
|
||||
let result = '';
|
||||
let index = slice.start;
|
||||
for (const { position, length } of slice.hits) {
|
||||
result += val.substring(index, position);
|
||||
index = position + length;
|
||||
result += `<mark class="search-keyword">${val.substr(position, length)}</mark>`;
|
||||
}
|
||||
result += val.substring(index, slice.end);
|
||||
return result;
|
||||
}
|
||||
|
||||
getResultItems(keywords) {
|
||||
const resultItems = [];
|
||||
this.datas.forEach(({ title, content, url }) => {
|
||||
// The number of different keywords included in the article.
|
||||
const [indexOfTitle, keysOfTitle] = this.getIndexByWord(keywords, title);
|
||||
const [indexOfContent, keysOfContent] = this.getIndexByWord(keywords, content);
|
||||
const includedCount = new Set([...keysOfTitle, ...keysOfContent]).size;
|
||||
|
||||
// Show search results
|
||||
const hitCount = indexOfTitle.length + indexOfContent.length;
|
||||
if (hitCount === 0) return;
|
||||
|
||||
const slicesOfTitle = [];
|
||||
if (indexOfTitle.length !== 0) {
|
||||
slicesOfTitle.push(this.mergeIntoSlice(0, title.length, indexOfTitle));
|
||||
}
|
||||
|
||||
let slicesOfContent = [];
|
||||
while (indexOfContent.length !== 0) {
|
||||
const item = indexOfContent[0];
|
||||
const { position } = item;
|
||||
// Cut out 100 characters. The maxlength of .search-input is 80.
|
||||
const start = Math.max(0, position - 20);
|
||||
const end = Math.min(content.length, position + 80);
|
||||
slicesOfContent.push(this.mergeIntoSlice(start, end, indexOfContent));
|
||||
}
|
||||
|
||||
// Sort slices in content by included keywords' count and hits' count
|
||||
slicesOfContent.sort((left, right) => {
|
||||
if (left.count !== right.count) {
|
||||
return right.count - left.count;
|
||||
} else if (left.hits.length !== right.hits.length) {
|
||||
return right.hits.length - left.hits.length;
|
||||
}
|
||||
return left.start - right.start;
|
||||
});
|
||||
|
||||
// Select top N slices in content
|
||||
const upperBound = parseInt(this.top_n_per_article, 10);
|
||||
if (upperBound >= 0) {
|
||||
slicesOfContent = slicesOfContent.slice(0, upperBound);
|
||||
}
|
||||
|
||||
let resultItem = '';
|
||||
|
||||
url = new URL(url, location.origin);
|
||||
url.searchParams.append('highlight', keywords.join(' '));
|
||||
|
||||
if (slicesOfTitle.length !== 0) {
|
||||
resultItem += `<li><a href="${url.href}" class="search-result-title">${this.highlightKeyword(title, slicesOfTitle[0])}</a>`;
|
||||
} else {
|
||||
resultItem += `<li><a href="${url.href}" class="search-result-title">${title}</a>`;
|
||||
}
|
||||
|
||||
slicesOfContent.forEach(slice => {
|
||||
resultItem += `<a href="${url.href}"><p class="search-result">${this.highlightKeyword(content, slice)}...</p></a>`;
|
||||
});
|
||||
|
||||
resultItem += '</li>';
|
||||
resultItems.push({
|
||||
item: resultItem,
|
||||
id : resultItems.length,
|
||||
hitCount,
|
||||
includedCount
|
||||
});
|
||||
});
|
||||
return resultItems;
|
||||
}
|
||||
|
||||
fetchData() {
|
||||
const isXml = !this.path.endsWith('json');
|
||||
fetch(this.path)
|
||||
.then(response => response.text())
|
||||
.then(res => {
|
||||
// Get the contents from search data
|
||||
this.isfetched = true;
|
||||
this.datas = isXml ? [...new DOMParser().parseFromString(res, 'text/xml').querySelectorAll('entry')].map(element => ({
|
||||
title : element.querySelector('title').textContent,
|
||||
content: element.querySelector('content').textContent,
|
||||
url : element.querySelector('url').textContent
|
||||
})) : JSON.parse(res);
|
||||
// Only match articles with non-empty titles
|
||||
this.datas = this.datas.filter(data => data.title).map(data => {
|
||||
data.title = data.title.trim();
|
||||
data.content = data.content ? data.content.trim().replace(/<[^>]+>/g, '') : '';
|
||||
data.url = decodeURIComponent(data.url).replace(/\/{2,}/g, '/');
|
||||
return data;
|
||||
});
|
||||
// Remove loading animation
|
||||
window.dispatchEvent(new Event('search:loaded'));
|
||||
});
|
||||
}
|
||||
|
||||
// Highlight by wrapping node in mark elements with the given class name
|
||||
highlightText(node, slice, className) {
|
||||
const val = node.nodeValue;
|
||||
let index = slice.start;
|
||||
const children = [];
|
||||
for (const { position, length } of slice.hits) {
|
||||
const text = document.createTextNode(val.substring(index, position));
|
||||
index = position + length;
|
||||
const mark = document.createElement('mark');
|
||||
mark.className = className;
|
||||
mark.appendChild(document.createTextNode(val.substr(position, length)));
|
||||
children.push(text, mark);
|
||||
}
|
||||
node.nodeValue = val.substring(index, slice.end);
|
||||
children.forEach(element => {
|
||||
node.parentNode.insertBefore(element, node);
|
||||
});
|
||||
}
|
||||
|
||||
// Highlight the search words provided in the url in the text
|
||||
highlightSearchWords(body) {
|
||||
const params = new URL(location.href).searchParams.get('highlight');
|
||||
const keywords = params ? params.split(' ') : [];
|
||||
if (!keywords.length || !body) return;
|
||||
const walk = document.createTreeWalker(body, NodeFilter.SHOW_TEXT, null);
|
||||
const allNodes = [];
|
||||
while (walk.nextNode()) {
|
||||
if (!walk.currentNode.parentNode.matches('button, select, textarea')) allNodes.push(walk.currentNode);
|
||||
}
|
||||
allNodes.forEach(node => {
|
||||
const [indexOfNode] = this.getIndexByWord(keywords, node.nodeValue);
|
||||
if (!indexOfNode.length) return;
|
||||
const slice = this.mergeIntoSlice(0, node.nodeValue.length, indexOfNode);
|
||||
this.highlightText(node, slice, 'search-keyword');
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
NexT.plugins.search.localsearch = function() {
|
||||
if (! NexT.CONFIG.localSearch.path) {
|
||||
// Search DB path
|
||||
console.warn('`search indexes file` is not configurate!');
|
||||
return;
|
||||
}
|
||||
const localSearch = new LocalSearch({
|
||||
path : NexT.CONFIG.localSearch.path,
|
||||
top_n_per_article: NexT.CONFIG.localSearch.topnperarticle,
|
||||
unescape : NexT.CONFIG.localSearch.unescape
|
||||
});
|
||||
|
||||
const input = document.querySelector('.search-input');
|
||||
|
||||
const inputEventFunction = () => {
|
||||
if (!localSearch.isfetched) return;
|
||||
const searchText = input.value.trim().toLowerCase();
|
||||
const keywords = searchText.split(/[-\s]+/);
|
||||
const container = document.querySelector('.search-result-container');
|
||||
let resultItems = [];
|
||||
if (searchText.length > 0) {
|
||||
// Perform local searching
|
||||
resultItems = localSearch.getResultItems(keywords);
|
||||
}
|
||||
if (keywords.length === 1 && keywords[0] === '') {
|
||||
container.classList.add('no-result');
|
||||
container.innerHTML = '<div class="search-result-icon"><i class="fa fa-search fa-5x"></i></div>';
|
||||
} else if (resultItems.length === 0) {
|
||||
container.classList.add('no-result');
|
||||
container.innerHTML = '<div class="search-result-icon"><i class="far fa-frown fa-5x"></i></div>';
|
||||
} else {
|
||||
resultItems.sort((left, right) => {
|
||||
if (left.includedCount !== right.includedCount) {
|
||||
return right.includedCount - left.includedCount;
|
||||
} else if (left.hitCount !== right.hitCount) {
|
||||
return right.hitCount - left.hitCount;
|
||||
}
|
||||
return right.id - left.id;
|
||||
});
|
||||
const stats = NexT.CONFIG.i18n.hits.replace('${hits}', resultItems.length);
|
||||
|
||||
container.classList.remove('no-result');
|
||||
container.innerHTML = `<div class="search-stats">${stats}</div>
|
||||
<hr>
|
||||
<ul class="search-result-list">${resultItems.map(result => result.item).join('')}</ul>`;
|
||||
if (typeof pjax === 'object') pjax.refresh(container);
|
||||
}
|
||||
};
|
||||
|
||||
localSearch.highlightSearchWords(document.querySelector('.post-body'));
|
||||
if (NexT.CONFIG.localSearch.preload) {
|
||||
localSearch.fetchData();
|
||||
}
|
||||
|
||||
if (NexT.CONFIG.localSearch.trigger === 'auto') {
|
||||
input.addEventListener('input', inputEventFunction);
|
||||
} else {
|
||||
document.querySelector('.search-icon').addEventListener('click', inputEventFunction);
|
||||
input.addEventListener('keypress', event => {
|
||||
if (event.key === 'Enter') {
|
||||
inputEventFunction();
|
||||
}
|
||||
});
|
||||
}
|
||||
window.addEventListener('search:loaded', inputEventFunction);
|
||||
|
||||
// Handle and trigger popup window
|
||||
document.querySelectorAll('.popup-trigger').forEach(element => {
|
||||
element.addEventListener('click', () => {
|
||||
document.body.classList.add('search-active');
|
||||
// Wait for search-popup animation to complete
|
||||
setTimeout(() => input.focus(), 500);
|
||||
if (!localSearch.isfetched) localSearch.fetchData();
|
||||
});
|
||||
});
|
||||
|
||||
// Monitor main search box
|
||||
const onPopupClose = () => {
|
||||
document.body.classList.remove('search-active');
|
||||
};
|
||||
|
||||
document.querySelector('.search-pop-overlay').addEventListener('click', event => {
|
||||
if (event.target === document.querySelector('.search-pop-overlay')) {
|
||||
onPopupClose();
|
||||
}
|
||||
});
|
||||
document.querySelector('.popup-btn-close').addEventListener('click', onPopupClose);
|
||||
document.addEventListener('pjax:success', () => {
|
||||
localSearch.highlightSearchWords(document.querySelector('.post-body'));
|
||||
onPopupClose();
|
||||
});
|
||||
window.addEventListener('keyup', event => {
|
||||
if (event.key === 'Escape') {
|
||||
onPopupClose();
|
||||
}
|
||||
});
|
||||
}
|
24
assets/js/3rd/share/addtoany.js
Normal file
24
assets/js/3rd/share/addtoany.js
Normal file
@ -0,0 +1,24 @@
|
||||
/* Addtoany share plugin */
|
||||
NexT.plugins.share.addtoany = function() {
|
||||
const element = '.a2a_kit';
|
||||
if (!NexT.CONFIG.share.enable || !NexT.utils.checkDOMExist(element)) return;
|
||||
|
||||
const addtoany = NexT.CONFIG.share.addtoany;
|
||||
|
||||
if (!addtoany) return;
|
||||
|
||||
NexT.utils.lazyLoadComponent(element, function() {
|
||||
let addtoany_cfg = `
|
||||
var a2a_config = a2a_config || {};
|
||||
a2a_config.onclick = 1;
|
||||
a2a_config.locale = "${addtoany.locale}";
|
||||
a2a_config.num_services = ${addtoany.num};
|
||||
`;
|
||||
|
||||
NexT.utils.getScript(null, {
|
||||
textContent: addtoany_cfg
|
||||
});
|
||||
|
||||
NexT.utils.getScript(addtoany.js, () => { NexT.utils.hiddeLodingCmp(element); });
|
||||
});
|
||||
}
|
21
assets/js/3rd/share/sharethis.js
Normal file
21
assets/js/3rd/share/sharethis.js
Normal file
@ -0,0 +1,21 @@
|
||||
/* Sharethis share plugin */
|
||||
NexT.plugins.share.sharethis = function() {
|
||||
const element = '.sharethis-inline-share-buttons';
|
||||
if (!NexT.CONFIG.share.enable || !NexT.utils.checkDOMExist(element)) return;
|
||||
|
||||
const sharethis = NexT.CONFIG.share.sharethis;
|
||||
|
||||
if (!sharethis) return;
|
||||
|
||||
const sharethis_js = sharethis.js.replace(/id/, sharethis.id);
|
||||
|
||||
NexT.utils.lazyLoadComponent(element, function() {
|
||||
NexT.utils.getScript(sharethis_js, {
|
||||
attributes: {
|
||||
async: 'async'
|
||||
}
|
||||
});
|
||||
|
||||
NexT.utils.hiddeLodingCmp(element);
|
||||
});
|
||||
}
|
@ -52,5 +52,5 @@ document.addEventListener('DOMContentLoaded', () => {
|
||||
document.addEventListener('pjax:success', scrollToMark);
|
||||
};
|
||||
|
||||
init(CONFIG.bookmark.save);
|
||||
init(NexT.CONFIG.bookmark.save);
|
||||
});
|
||||
|
@ -7,13 +7,13 @@
|
||||
element.addEventListener('click', () => {
|
||||
commentButton.forEach(active => active.classList.toggle('active', active === element));
|
||||
document.querySelectorAll('.comment-position').forEach(active => active.classList.toggle('active', active.classList.contains(commentClass)));
|
||||
if (CONFIG.comments.storage) {
|
||||
if (NexT.CONFIG.comments.storage) {
|
||||
localStorage.setItem('comments_active', commentClass);
|
||||
}
|
||||
});
|
||||
});
|
||||
let { activeClass } = CONFIG.comments;
|
||||
if (CONFIG.comments.storage) {
|
||||
let { activeClass } = NexT.CONFIG.comments;
|
||||
if (NexT.CONFIG.comments.storage) {
|
||||
activeClass = localStorage.getItem('comments_active') || activeClass;
|
||||
}
|
||||
if (activeClass) {
|
||||
|
@ -1,8 +1,8 @@
|
||||
/* global CONFIG */
|
||||
|
||||
window.addEventListener('tabs:register', () => {
|
||||
let { activeClass } = CONFIG.comments;
|
||||
if (CONFIG.comments.storage) {
|
||||
let { activeClass } = NexT.CONFIG.comments;
|
||||
if (NexT.CONFIG.comments.storage) {
|
||||
activeClass = localStorage.getItem('comments_active') || activeClass;
|
||||
}
|
||||
if (activeClass) {
|
||||
@ -12,7 +12,7 @@ window.addEventListener('tabs:register', () => {
|
||||
}
|
||||
}
|
||||
});
|
||||
if (CONFIG.comments.storage) {
|
||||
if (NexT.CONFIG.comments.storage) {
|
||||
window.addEventListener('tabs:click', event => {
|
||||
if (!event.target.matches('.tabs-comment .tab-content .tab-pane')) return;
|
||||
const commentClass = event.target.classList[1];
|
||||
|
@ -1,51 +1,115 @@
|
||||
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() {
|
||||
const className = 'next-config';
|
||||
|
||||
const siteConfig = {
|
||||
"hostname" : "{{ .Site.BaseURL }}",
|
||||
"root" : "/",
|
||||
"images" : "{{ .Site.Params.images }}",
|
||||
"scheme" : "{{ .Site.Params.scheme }}",
|
||||
"darkmode" : {{ .Site.Params.darkmode }},
|
||||
"version" : "{{ .Site.Data.config.version }}",
|
||||
"sidebar" : {{ .Site.Params.sidebar | jsonify }},
|
||||
"copybtn" : {{ .Site.Params.codeblock.copyBtn }},
|
||||
"bookmark" : {{ .Site.Params.bookmark | jsonify }},
|
||||
"comments" : {{ .Site.Params.comments | jsonify }},
|
||||
"lazyload" : {{ .Site.Params.lazyload }},
|
||||
"pangu" : {{ .Site.Params.pangu }},
|
||||
"stickytabs" : {{ .Site.Params.tabs.sticky }},
|
||||
"motion" : {{ .Site.Params.motion | jsonify }},
|
||||
// TODO Find prismjs
|
||||
//"prism" : "",
|
||||
"i18n" : {
|
||||
"placeholder" : "",
|
||||
"empty" : "${query}",
|
||||
"hits_time" : "'${hits}', '${time}'",
|
||||
"hits" : "${hits}"
|
||||
},
|
||||
{{- if .Site.Params.algoliaSearch.enable }}
|
||||
// TODO
|
||||
"algolia" : {
|
||||
"appID" : "",
|
||||
"apiKey" : "",
|
||||
"indexName" : "",
|
||||
"hits" : ""
|
||||
const staticConfig = {};
|
||||
let variableConfig = {};
|
||||
|
||||
const parse = text => JSON.parse(text || '{}');
|
||||
|
||||
const update = name => {
|
||||
const targetEle = document.querySelector(`.${className}[data-name="${name}"]`);
|
||||
if (!targetEle) return;
|
||||
const parsedConfig = parse(targetEle.text);
|
||||
if (name === 'main') {
|
||||
Object.assign(staticConfig, parsedConfig);
|
||||
} else {
|
||||
variableConfig[name] = parsedConfig;
|
||||
}
|
||||
{{- end }}
|
||||
{{- if .Site.Params.localSearch.enable }}
|
||||
// TODO
|
||||
"path" : "/search.json",
|
||||
"localsearch": {{ .Site.Params.localSearch | jsonify }},
|
||||
{{- end }}
|
||||
"lang" : "{{ .Site.LanguageCode }}",
|
||||
"permalink" : "{{ .Page.Permalink | absURL }}",
|
||||
"title" : "{{ .Page.Title }}",
|
||||
"isHome" : {{ .IsHome }},
|
||||
"isPage" : {{ .IsPage }}
|
||||
};
|
||||
|
||||
window.CONFIG = new Proxy(siteConfig, {});
|
||||
|
||||
update('main');
|
||||
|
||||
window.NexT.CONFIG = new Proxy({}, {
|
||||
get(overrideConfig, name) {
|
||||
let existing;
|
||||
if (name in staticConfig) {
|
||||
existing = staticConfig[name];
|
||||
} else {
|
||||
if (!(name in variableConfig)) update(name);
|
||||
existing = variableConfig[name];
|
||||
}
|
||||
|
||||
// For unset override and mixable existing
|
||||
if (!(name in overrideConfig) && typeof existing === 'object') {
|
||||
// Get ready to mix.
|
||||
overrideConfig[name] = {};
|
||||
}
|
||||
|
||||
if (name in overrideConfig) {
|
||||
const override = overrideConfig[name];
|
||||
|
||||
// When mixable
|
||||
if (typeof override === 'object' && typeof existing === 'object') {
|
||||
// Mix, proxy changes to the override.
|
||||
return new Proxy({ ...existing, ...override }, {
|
||||
set(target, prop, value) {
|
||||
target[prop] = value;
|
||||
override[prop] = value;
|
||||
return true;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
return override;
|
||||
}
|
||||
|
||||
// Only when not mixable and override hasn't been set.
|
||||
return existing;
|
||||
}
|
||||
});
|
||||
|
||||
// TODO
|
||||
// document.addEventListener('pjax:success', () => {
|
||||
// variableConfig = {};
|
||||
// });
|
||||
})();
|
@ -10,12 +10,12 @@ NexT.motion.integrator = {
|
||||
},
|
||||
add: function(fn) {
|
||||
const sequence = fn();
|
||||
if (CONFIG.motion.async) this.queue.push(sequence);
|
||||
if (NexT.CONFIG.motion.async) this.queue.push(sequence);
|
||||
else this.queue = this.queue.concat(sequence);
|
||||
return this;
|
||||
},
|
||||
bootstrap: function() {
|
||||
if (!CONFIG.motion.async) this.queue = [this.queue];
|
||||
if (!NexT.CONFIG.motion.async) this.queue = [this.queue];
|
||||
this.queue.forEach(sequence => {
|
||||
const timeline = window.anime.timeline({
|
||||
duration: 200,
|
||||
@ -52,12 +52,12 @@ NexT.motion.middleWares = {
|
||||
}
|
||||
|
||||
pushToSequence('header.header');
|
||||
CONFIG.scheme === 'Mist' && getMistLineSettings('.logo-line');
|
||||
CONFIG.scheme === 'Muse' && pushToSequence('.custom-logo-image');
|
||||
NexT.CONFIG.scheme === 'Mist' && getMistLineSettings('.logo-line');
|
||||
NexT.CONFIG.scheme === 'Muse' && pushToSequence('.custom-logo-image');
|
||||
pushToSequence('.site-title');
|
||||
pushToSequence('.site-brand-container .toggle', true);
|
||||
pushToSequence('.site-subtitle');
|
||||
(CONFIG.scheme === 'Pisces' || CONFIG.scheme === 'Gemini') && pushToSequence('.custom-logo-image');
|
||||
(NexT.CONFIG.scheme === 'Pisces' || NexT.CONFIG.scheme === 'Gemini') && pushToSequence('.custom-logo-image');
|
||||
|
||||
document.querySelectorAll('.menu-item').forEach(targets => {
|
||||
sequence.push({
|
||||
@ -82,7 +82,7 @@ NexT.motion.middleWares = {
|
||||
|
||||
postList: function() {
|
||||
const sequence = [];
|
||||
const { postblock, postheader, postbody, collheader } = CONFIG.motion.transition;
|
||||
const { postblock, postheader, postbody, collheader } = NexT.CONFIG.motion.transition;
|
||||
|
||||
function animate(animation, selector) {
|
||||
if (!animation) return;
|
||||
@ -95,19 +95,19 @@ NexT.motion.middleWares = {
|
||||
});
|
||||
}
|
||||
|
||||
animate(postblock, '.post-block, .pagination, .post-comments');
|
||||
animate(postblock, '.post-block, .flinks-block, .pagination, .post-comments');
|
||||
animate(collheader, '.collection-header');
|
||||
animate(postheader, '.post-header');
|
||||
animate(postbody, '.post-body');
|
||||
animate(postheader, '.post-header, .flinks-header');
|
||||
animate(postbody, '.post-body, .flinks-body');
|
||||
|
||||
return sequence;
|
||||
},
|
||||
|
||||
sidebar: function() {
|
||||
const sidebar = document.querySelector('.sidebar');
|
||||
const sidebarTransition = CONFIG.motion.transition.sidebar;
|
||||
const sidebarTransition = NexT.CONFIG.motion.transition.sidebar;
|
||||
// Only for Pisces | Gemini.
|
||||
if (sidebarTransition && (CONFIG.scheme === 'Pisces' || CONFIG.scheme === 'Gemini')) {
|
||||
if (sidebarTransition && (NexT.CONFIG.scheme === 'Pisces' || NexT.CONFIG.scheme === 'Gemini')) {
|
||||
return [{
|
||||
targets : sidebar,
|
||||
complete: () => sidebar.classList.add('animated', sidebarTransition)
|
||||
|
@ -1,11 +1,37 @@
|
||||
/* global NexT, CONFIG */
|
||||
/* boot starup */
|
||||
|
||||
NexT.boot = {};
|
||||
(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.boot.registerEvents = function() {
|
||||
|
||||
NexT.utils.registerMenuClick();
|
||||
NexT.utils.registerImageLoadEvent();
|
||||
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.
|
||||
document.querySelector('.site-nav-toggle .toggle').addEventListener('click', event => {
|
||||
@ -33,33 +59,51 @@ NexT.boot.registerEvents = function() {
|
||||
|
||||
NexT.boot.refresh = function() {
|
||||
|
||||
/**
|
||||
NexT.utils.fmtSiteInfo();
|
||||
|
||||
if (NexT.CONFIG.isMultiLang) {
|
||||
NexT.utils.registerLangSelect();
|
||||
}
|
||||
|
||||
if (!NexT.CONFIG.page.isPage) return;
|
||||
|
||||
if (NexT.CONFIG.page.toc) NexT.utils.registerSidebarTOC();
|
||||
if (NexT.CONFIG.page.expired) NexT.utils.calPostExpiredDate();
|
||||
if (NexT.CONFIG.page.music) NexT.utils.registerAPlayer();
|
||||
|
||||
NexT.utils.registerImageViewer();
|
||||
NexT.utils.registerPostReward();
|
||||
|
||||
if(NexT.CONFIG.page.comments) {
|
||||
NexT.utils.initCommontesDispaly();
|
||||
NexT.utils.registerCommonSwitch();
|
||||
NexT.utils.domAddClass('#goto-comments', 'show');
|
||||
} else {
|
||||
NexT.utils.domAddClass('#goto-comments', 'hidden');
|
||||
}
|
||||
|
||||
//TODO
|
||||
/**
|
||||
* Register JS handlers by condition option.
|
||||
* Need to add config option in Front-End at 'scripts/helpers/next-config.js' file.
|
||||
*/
|
||||
//CONFIG.prism && window.Prism.highlightAll();
|
||||
/*CONFIG.mediumzoom && window.mediumZoom('.post-body :not(a) > img, .post-body > img', {
|
||||
//NexT.CONFIG.prism && window.Prism.highlightAll();
|
||||
/*NexT.CONFIG.mediumzoom && window.mediumZoom('.post-body :not(a) > img, .post-body > img', {
|
||||
background: 'var(--content-bg-color)'
|
||||
});*/
|
||||
CONFIG.lazyload && window.lozad('.post-body img').observe();
|
||||
CONFIG.pangu && window.pangu.spacingPage();
|
||||
|
||||
CONFIG.isPage && NexT.utils.replacePostCRLink();
|
||||
CONFIG.isPage && CONFIG.copybtn && NexT.utils.registerCopyCode();
|
||||
NexT.utils.registerTabsTag();
|
||||
/*NexT.utils.registerActiveMenuItem();
|
||||
// NexT.CONFIG.lazyload && window.lozad('.post-body img').observe();
|
||||
// NexT.CONFIG.pangu && window.pangu.spacingPage();
|
||||
/*NexT.utils.registerTabsTag();
|
||||
NexT.utils.registerActiveMenuItem();
|
||||
NexT.utils.registerLangSelect();*/
|
||||
CONFIG.isPage && NexT.utils.registerSidebarTOC();
|
||||
CONFIG.isPage && NexT.utils.registerPostReward();
|
||||
CONFIG.isPage && NexT.utils.initCommontesDispaly();
|
||||
CONFIG.isPage && NexT.utils.registerCommonSwitch();
|
||||
NexT.utils.wrapTableWithBox();
|
||||
NexT.utils.registerVideoIframe();
|
||||
/*NexT.utils.wrapTableWithBox();
|
||||
NexT.utils.registerVideoIframe();*/
|
||||
|
||||
};
|
||||
|
||||
NexT.boot.motion = function() {
|
||||
// Define Motion Sequence & Bootstrap Motion.
|
||||
if (CONFIG.motion.enable) {
|
||||
if (NexT.CONFIG.motion.enable) {
|
||||
NexT.motion.integrator
|
||||
.add(NexT.motion.middleWares.header)
|
||||
.add(NexT.motion.middleWares.postList)
|
||||
@ -72,6 +116,6 @@ NexT.boot.motion = function() {
|
||||
|
||||
document.addEventListener('DOMContentLoaded', () => {
|
||||
NexT.boot.registerEvents();
|
||||
NexT.boot.refresh();
|
||||
NexT.boot.motion();
|
||||
NexT.boot.refresh();
|
||||
});
|
||||
|
@ -11,21 +11,21 @@ const pjax = new Pjax({
|
||||
],
|
||||
analytics: false,
|
||||
cacheBust: false,
|
||||
scrollTo : !CONFIG.bookmark.enable
|
||||
scrollTo : !NexT.CONFIG.bookmark.enable
|
||||
});
|
||||
|
||||
document.addEventListener('pjax:success', () => {
|
||||
pjax.executeScripts(document.querySelectorAll('script[data-pjax]'));
|
||||
NexT.boot.refresh();
|
||||
// Define Motion Sequence & Bootstrap Motion.
|
||||
if (CONFIG.motion.enable) {
|
||||
if (NexT.CONFIG.motion.enable) {
|
||||
NexT.motion.integrator
|
||||
.init()
|
||||
.add(NexT.motion.middleWares.subMenu)
|
||||
.add(NexT.motion.middleWares.postList)
|
||||
.bootstrap();
|
||||
}
|
||||
if (CONFIG.sidebar.display !== 'remove') {
|
||||
if (NexT.CONFIG.sidebar.display !== 'remove') {
|
||||
const hasTOC = document.querySelector('.post-toc');
|
||||
document.querySelector('.sidebar-inner').classList.toggle('sidebar-nav-active', hasTOC);
|
||||
NexT.utils.activateSidebarPanel(hasTOC ? 0 : 1);
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
document.addEventListener('DOMContentLoaded', () => {
|
||||
|
||||
const isRight = CONFIG.sidebar.position === 'right';
|
||||
const isRight = NexT.CONFIG.sidebar.position === 'right';
|
||||
|
||||
const sidebarToggleMotion = {
|
||||
mouse: {},
|
||||
@ -46,7 +46,7 @@ document.addEventListener('DOMContentLoaded', () => {
|
||||
document.body.classList.remove('sidebar-active');
|
||||
}
|
||||
};
|
||||
if (CONFIG.sidebar.display !== 'remove') sidebarToggleMotion.init();
|
||||
if (NexT.CONFIG.sidebar.display !== 'remove') sidebarToggleMotion.init();
|
||||
|
||||
function updateFooterPosition() {
|
||||
const footer = document.querySelector('.footer');
|
||||
|
@ -1,7 +0,0 @@
|
||||
/* global _hmt */
|
||||
|
||||
if (!window._hmt) window._hmt = [];
|
||||
|
||||
document.addEventListener('pjax:success', () => {
|
||||
_hmt.push(['_trackPageview', location.pathname]);
|
||||
});
|
@ -1,35 +0,0 @@
|
||||
/* global CONFIG, dataLayer, gtag */
|
||||
|
||||
if (!CONFIG.google_analytics.only_pageview) {
|
||||
if (CONFIG.hostname === location.hostname) {
|
||||
window.dataLayer = window.dataLayer || [];
|
||||
window.gtag = function() {
|
||||
dataLayer.push(arguments);
|
||||
};
|
||||
gtag('js', new Date());
|
||||
gtag('config', CONFIG.google_analytics.tracking_id);
|
||||
|
||||
document.addEventListener('pjax:success', () => {
|
||||
gtag('event', 'page_view', {
|
||||
page_location: location.href,
|
||||
page_path : location.pathname,
|
||||
page_title : document.title
|
||||
});
|
||||
});
|
||||
}
|
||||
} else {
|
||||
const sendPageView = () => {
|
||||
if (CONFIG.hostname !== location.hostname) return;
|
||||
const uid = localStorage.getItem('uid') || (Math.random() + '.' + Math.random());
|
||||
localStorage.setItem('uid', uid);
|
||||
navigator.sendBeacon('https://www.google-analytics.com/collect', new URLSearchParams({
|
||||
v : 1,
|
||||
tid: CONFIG.google_analytics.tracking_id,
|
||||
cid: uid,
|
||||
t : 'pageview',
|
||||
dp : encodeURIComponent(location.pathname)
|
||||
}));
|
||||
};
|
||||
document.addEventListener('pjax:complete', sendPageView);
|
||||
sendPageView();
|
||||
}
|
10
assets/js/third-party/analytics/growingio.js
vendored
10
assets/js/third-party/analytics/growingio.js
vendored
@ -1,10 +0,0 @@
|
||||
/* global CONFIG, gio */
|
||||
|
||||
if (!window.gio) {
|
||||
window.gio = function() {
|
||||
(window.gio.q = window.gio.q || []).push(arguments);
|
||||
};
|
||||
}
|
||||
|
||||
gio('init', `${CONFIG.growingio_analytics}`, {});
|
||||
gio('send');
|
19
assets/js/third-party/chat/chatra.js
vendored
19
assets/js/third-party/chat/chatra.js
vendored
@ -1,19 +0,0 @@
|
||||
/* global CONFIG, Chatra */
|
||||
|
||||
(function() {
|
||||
if (CONFIG.chatra.embed) {
|
||||
window.ChatraSetup = {
|
||||
mode : 'frame',
|
||||
injectTo: CONFIG.chatra.embed
|
||||
};
|
||||
}
|
||||
|
||||
window.ChatraID = CONFIG.chatra.id;
|
||||
|
||||
const chatButton = document.querySelector('.sidebar-button button');
|
||||
if (chatButton) {
|
||||
chatButton.addEventListener('click', () => {
|
||||
Chatra('openChat', true);
|
||||
});
|
||||
}
|
||||
})();
|
5
assets/js/third-party/chat/gitter.js
vendored
5
assets/js/third-party/chat/gitter.js
vendored
@ -1,5 +0,0 @@
|
||||
/* global CONFIG */
|
||||
|
||||
((window.gitter = {}).chat = {}).options = {
|
||||
room: CONFIG.gitter.room
|
||||
};
|
10
assets/js/third-party/chat/tidio.js
vendored
10
assets/js/third-party/chat/tidio.js
vendored
@ -1,10 +0,0 @@
|
||||
/* global tidioChatApi */
|
||||
|
||||
(function() {
|
||||
const chatButton = document.querySelector('.sidebar-button button');
|
||||
if (chatButton) {
|
||||
chatButton.addEventListener('click', () => {
|
||||
tidioChatApi.open();
|
||||
});
|
||||
}
|
||||
})();
|
39
assets/js/third-party/comments/changyan.js
vendored
39
assets/js/third-party/comments/changyan.js
vendored
@ -1,39 +0,0 @@
|
||||
/* global NexT, CONFIG */
|
||||
|
||||
document.addEventListener('page:loaded', () => {
|
||||
const { appid, appkey } = CONFIG.changyan;
|
||||
const mainJs = 'https://cy-cdn.kuaizhan.com/upload/changyan.js';
|
||||
const countJs = `https://cy-cdn.kuaizhan.com/upload/plugins/plugins.list.count.js?clientId=${appid}`;
|
||||
|
||||
// Get the number of comments
|
||||
setTimeout(() => {
|
||||
return NexT.utils.getScript(countJs, {
|
||||
attributes: {
|
||||
async: true,
|
||||
id : 'cy_cmt_num'
|
||||
}
|
||||
});
|
||||
}, 0);
|
||||
|
||||
// When scroll to comment section
|
||||
if (CONFIG.page.comments && !CONFIG.page.isHome) {
|
||||
NexT.utils.loadComments('#SOHUCS')
|
||||
.then(() => {
|
||||
return NexT.utils.getScript(mainJs, {
|
||||
attributes: {
|
||||
async: true
|
||||
}
|
||||
});
|
||||
})
|
||||
.then(() => {
|
||||
window.changyan.api.config({
|
||||
appid,
|
||||
conf: appkey
|
||||
});
|
||||
})
|
||||
.catch(error => {
|
||||
// eslint-disable-next-line no-console
|
||||
console.error('Failed to load Changyan', error);
|
||||
});
|
||||
}
|
||||
});
|
41
assets/js/third-party/comments/disqus.js
vendored
41
assets/js/third-party/comments/disqus.js
vendored
@ -1,41 +0,0 @@
|
||||
/* global NexT, CONFIG, DISQUS */
|
||||
|
||||
document.addEventListener('page:loaded', () => {
|
||||
|
||||
if (CONFIG.disqus.count) {
|
||||
const loadCount = () => {
|
||||
NexT.utils.getScript(`https://${CONFIG.disqus.shortname}.disqus.com/count.js`, {
|
||||
attributes: { id: 'dsq-count-scr' }
|
||||
});
|
||||
};
|
||||
|
||||
// defer loading until the whole page loading is completed
|
||||
window.addEventListener('load', loadCount, false);
|
||||
}
|
||||
|
||||
if (CONFIG.page.comments) {
|
||||
// `disqus_config` should be a global variable
|
||||
// See https://help.disqus.com/en/articles/1717084-javascript-configuration-variables
|
||||
window.disqus_config = function() {
|
||||
this.page.url = CONFIG.page.permalink;
|
||||
this.page.identifier = CONFIG.page.path;
|
||||
this.page.title = CONFIG.page.title;
|
||||
if (CONFIG.disqus.i18n.disqus !== 'disqus') {
|
||||
this.language = CONFIG.disqus.i18n.disqus;
|
||||
}
|
||||
};
|
||||
NexT.utils.loadComments('#disqus_thread').then(() => {
|
||||
if (window.DISQUS) {
|
||||
DISQUS.reset({
|
||||
reload: true,
|
||||
config: window.disqus_config
|
||||
});
|
||||
} else {
|
||||
NexT.utils.getScript(`https://${CONFIG.disqus.shortname}.disqus.com/embed.js`, {
|
||||
attributes: { dataset: { timestamp: '' + +new Date() } }
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
});
|
18
assets/js/third-party/comments/disqusjs.js
vendored
18
assets/js/third-party/comments/disqusjs.js
vendored
@ -1,18 +0,0 @@
|
||||
/* global NexT, CONFIG, DisqusJS */
|
||||
|
||||
document.addEventListener('page:loaded', () => {
|
||||
if (!CONFIG.page.comments) return;
|
||||
|
||||
NexT.utils.loadComments('#disqus_thread')
|
||||
.then(() => NexT.utils.getScript(CONFIG.disqusjs.js, { condition: window.DisqusJS }))
|
||||
.then(() => {
|
||||
window.dsqjs = new DisqusJS({
|
||||
api : CONFIG.disqusjs.api || 'https://disqus.com/api/',
|
||||
apikey : CONFIG.disqusjs.apikey,
|
||||
shortname : CONFIG.disqusjs.shortname,
|
||||
url : CONFIG.page.permalink,
|
||||
identifier: CONFIG.page.path,
|
||||
title : CONFIG.page.title
|
||||
});
|
||||
});
|
||||
});
|
24
assets/js/third-party/comments/gitalk.js
vendored
24
assets/js/third-party/comments/gitalk.js
vendored
@ -1,24 +0,0 @@
|
||||
/* global NexT, CONFIG, Gitalk */
|
||||
|
||||
document.addEventListener('page:loaded', () => {
|
||||
if (!CONFIG.page.comments) return;
|
||||
|
||||
NexT.utils.loadComments('.gitalk-container')
|
||||
.then(() => NexT.utils.getScript(CONFIG.gitalk.js, {
|
||||
condition: window.Gitalk
|
||||
}))
|
||||
.then(() => {
|
||||
const gitalk = new Gitalk({
|
||||
clientID : CONFIG.gitalk.client_id,
|
||||
clientSecret : CONFIG.gitalk.client_secret,
|
||||
repo : CONFIG.gitalk.repo,
|
||||
owner : CONFIG.gitalk.github_id,
|
||||
admin : [CONFIG.gitalk.admin_user],
|
||||
id : CONFIG.gitalk.path_md5,
|
||||
proxy : CONFIG.gitalk.proxy,
|
||||
language : CONFIG.gitalk.language || window.navigator.language,
|
||||
distractionFreeMode: CONFIG.gitalk.distraction_free_mode
|
||||
});
|
||||
gitalk.render(document.querySelector('.gitalk-container'));
|
||||
});
|
||||
});
|
15
assets/js/third-party/comments/isso.js
vendored
15
assets/js/third-party/comments/isso.js
vendored
@ -1,15 +0,0 @@
|
||||
/* global NexT, CONFIG */
|
||||
|
||||
document.addEventListener('page:loaded', () => {
|
||||
if (!CONFIG.page.comments) return;
|
||||
|
||||
NexT.utils.loadComments('#isso-thread')
|
||||
.then(() => NexT.utils.getScript(`${CONFIG.isso}js/embed.min.js`, {
|
||||
attributes: {
|
||||
dataset: {
|
||||
isso: `${CONFIG.isso}`
|
||||
}
|
||||
},
|
||||
parentNode: document.querySelector('#isso-thread')
|
||||
}));
|
||||
});
|
19
assets/js/third-party/comments/livere.js
vendored
19
assets/js/third-party/comments/livere.js
vendored
@ -1,19 +0,0 @@
|
||||
/* global NexT, CONFIG, LivereTower */
|
||||
|
||||
document.addEventListener('page:loaded', () => {
|
||||
if (!CONFIG.page.comments) return;
|
||||
|
||||
NexT.utils.loadComments('#lv-container').then(() => {
|
||||
window.livereOptions = {
|
||||
refer: CONFIG.page.path.replace(/index\.html$/, '')
|
||||
};
|
||||
|
||||
if (typeof LivereTower === 'function') return;
|
||||
|
||||
NexT.utils.getScript('https://cdn-city.livere.com/js/embed.dist.js', {
|
||||
attributes: {
|
||||
async: true
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
17
assets/js/third-party/comments/utterances.js
vendored
17
assets/js/third-party/comments/utterances.js
vendored
@ -1,17 +0,0 @@
|
||||
/* global NexT, CONFIG */
|
||||
|
||||
document.addEventListener('page:loaded', () => {
|
||||
if (!CONFIG.page.comments) return;
|
||||
|
||||
NexT.utils.loadComments('.utterances-container')
|
||||
.then(() => NexT.utils.getScript('https://utteranc.es/client.js', {
|
||||
attributes: {
|
||||
async : true,
|
||||
crossOrigin : 'anonymous',
|
||||
'repo' : CONFIG.utterances.repo,
|
||||
'issue-term': CONFIG.utterances.issue_term,
|
||||
'theme' : CONFIG.utterances.theme
|
||||
},
|
||||
parentNode: document.querySelector('.utterances-container')
|
||||
}));
|
||||
});
|
38
assets/js/third-party/fancybox.js
vendored
38
assets/js/third-party/fancybox.js
vendored
@ -1,38 +0,0 @@
|
||||
document.addEventListener('page:loaded', () => {
|
||||
|
||||
/**
|
||||
* Wrap images with fancybox.
|
||||
*/
|
||||
document.querySelectorAll('.post-body :not(a) > img, .post-body > img').forEach(element => {
|
||||
const $image = $(element);
|
||||
const imageLink = $image.attr('data-src') || $image.attr('src');
|
||||
const $imageWrapLink = $image.wrap(`<a class="fancybox fancybox.image" href="${imageLink}" itemscope itemtype="http://schema.org/ImageObject" itemprop="url"></a>`).parent('a');
|
||||
if ($image.is('.post-gallery img')) {
|
||||
$imageWrapLink.attr('data-fancybox', 'gallery').attr('rel', 'gallery');
|
||||
} else if ($image.is('.group-picture img')) {
|
||||
$imageWrapLink.attr('data-fancybox', 'group').attr('rel', 'group');
|
||||
} else {
|
||||
$imageWrapLink.attr('data-fancybox', 'default').attr('rel', 'default');
|
||||
}
|
||||
|
||||
const imageTitle = $image.attr('title') || $image.attr('alt');
|
||||
if (imageTitle) {
|
||||
// Do not append image-caption if pandoc has already created a figcaption
|
||||
if (!$imageWrapLink.next('figcaption').length) {
|
||||
$imageWrapLink.append(`<p class="image-caption">${imageTitle}</p>`);
|
||||
}
|
||||
// Make sure img title tag will show correctly in fancybox
|
||||
$imageWrapLink.attr('title', imageTitle).attr('data-caption', imageTitle);
|
||||
}
|
||||
});
|
||||
|
||||
$.fancybox.defaults.hash = false;
|
||||
$('.fancybox').fancybox({
|
||||
loop : true,
|
||||
helpers: {
|
||||
overlay: {
|
||||
locked: false
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
7
assets/js/third-party/math/katex.js
vendored
7
assets/js/third-party/math/katex.js
vendored
@ -1,7 +0,0 @@
|
||||
/* global NexT, CONFIG */
|
||||
|
||||
document.addEventListener('page:loaded', () => {
|
||||
if (!CONFIG.enableMath) return;
|
||||
|
||||
NexT.utils.getScript(CONFIG.katex.copy_tex_js).catch(() => {});
|
||||
});
|
36
assets/js/third-party/math/mathjax.js
vendored
36
assets/js/third-party/math/mathjax.js
vendored
@ -1,36 +0,0 @@
|
||||
/* global NexT, CONFIG, MathJax */
|
||||
|
||||
document.addEventListener('page:loaded', () => {
|
||||
if (!CONFIG.enableMath) return;
|
||||
|
||||
if (typeof MathJax === 'undefined') {
|
||||
window.MathJax = {
|
||||
tex: {
|
||||
inlineMath: { '[+]': [['$', '$']] },
|
||||
tags : CONFIG.mathjax.tags
|
||||
},
|
||||
options: {
|
||||
renderActions: {
|
||||
insertedScript: [200, () => {
|
||||
document.querySelectorAll('mjx-container').forEach(node => {
|
||||
const target = node.parentNode;
|
||||
if (target.nodeName.toLowerCase() === 'li') {
|
||||
target.parentNode.classList.add('has-jax');
|
||||
}
|
||||
});
|
||||
}, '', false]
|
||||
}
|
||||
}
|
||||
};
|
||||
NexT.utils.getScript(CONFIG.mathjax.js, {
|
||||
attributes: {
|
||||
defer: true
|
||||
}
|
||||
});
|
||||
} else {
|
||||
MathJax.startup.document.state(0);
|
||||
MathJax.typesetClear();
|
||||
MathJax.texReset();
|
||||
MathJax.typesetPromise();
|
||||
}
|
||||
});
|
7
assets/js/third-party/pace.js
vendored
7
assets/js/third-party/pace.js
vendored
@ -1,7 +0,0 @@
|
||||
/* global Pace */
|
||||
|
||||
Pace.options.restartOnPushState = false;
|
||||
|
||||
document.addEventListener('pjax:send', () => {
|
||||
Pace.restart();
|
||||
});
|
37
assets/js/third-party/quicklink.js
vendored
37
assets/js/third-party/quicklink.js
vendored
@ -1,37 +0,0 @@
|
||||
/* global CONFIG, quicklink */
|
||||
|
||||
(function() {
|
||||
if (typeof CONFIG.quicklink.ignores === 'string') {
|
||||
const ignoresStr = `[${CONFIG.quicklink.ignores}]`;
|
||||
CONFIG.quicklink.ignores = JSON.parse(ignoresStr);
|
||||
}
|
||||
|
||||
let resetFn = null;
|
||||
|
||||
const onRefresh = () => {
|
||||
if (resetFn) resetFn();
|
||||
if (!CONFIG.quicklink.enable) return;
|
||||
|
||||
let ignoresArr = CONFIG.quicklink.ignores || [];
|
||||
if (!Array.isArray(ignoresArr)) {
|
||||
ignoresArr = [ignoresArr];
|
||||
}
|
||||
|
||||
resetFn = quicklink.listen({
|
||||
timeout : CONFIG.quicklink.timeout,
|
||||
priority: CONFIG.quicklink.priority,
|
||||
ignores : [
|
||||
uri => uri.includes('#'),
|
||||
uri => uri === CONFIG.quicklink.url,
|
||||
...ignoresArr
|
||||
]
|
||||
});
|
||||
};
|
||||
|
||||
if (CONFIG.quicklink.delay) {
|
||||
window.addEventListener('load', onRefresh);
|
||||
document.addEventListener('pjax:success', onRefresh);
|
||||
} else {
|
||||
document.addEventListener('page:loaded', onRefresh);
|
||||
}
|
||||
})();
|
22
assets/js/third-party/rating.js
vendored
22
assets/js/third-party/rating.js
vendored
@ -1,22 +0,0 @@
|
||||
/* global CONFIG, WPac */
|
||||
|
||||
(function() {
|
||||
const widgets = [{
|
||||
widget: 'Rating',
|
||||
id : CONFIG.rating.id,
|
||||
el : 'wpac-rating',
|
||||
color : CONFIG.rating.color
|
||||
}];
|
||||
|
||||
document.addEventListener('page:loaded', () => {
|
||||
if (!CONFIG.page.isPost) return;
|
||||
|
||||
const newWidgets = widgets.map(widget => ({ ...widget }));
|
||||
|
||||
if (window.WPac) {
|
||||
WPac.init(newWidgets);
|
||||
} else {
|
||||
window.wpac_init = newWidgets;
|
||||
}
|
||||
});
|
||||
})();
|
130
assets/js/third-party/search/algolia-search.js
vendored
130
assets/js/third-party/search/algolia-search.js
vendored
@ -1,130 +0,0 @@
|
||||
/* global instantsearch, algoliasearch, CONFIG, pjax */
|
||||
|
||||
document.addEventListener('DOMContentLoaded', () => {
|
||||
const { indexName, appID, apiKey, hits } = CONFIG.algolia;
|
||||
|
||||
const search = instantsearch({
|
||||
indexName,
|
||||
searchClient : algoliasearch(appID, apiKey),
|
||||
searchFunction: helper => {
|
||||
if (document.querySelector('.search-input').value) {
|
||||
helper.search();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
if (typeof pjax === 'object') {
|
||||
search.on('render', () => {
|
||||
pjax.refresh(document.querySelector('.algolia-hits'));
|
||||
});
|
||||
}
|
||||
|
||||
// Registering Widgets
|
||||
search.addWidgets([
|
||||
instantsearch.widgets.configure({
|
||||
hitsPerPage: hits.per_page || 10
|
||||
}),
|
||||
|
||||
instantsearch.widgets.searchBox({
|
||||
container : '.search-input-container',
|
||||
placeholder : CONFIG.i18n.placeholder,
|
||||
// Hide default icons of algolia search
|
||||
showReset : false,
|
||||
showSubmit : false,
|
||||
showLoadingIndicator: false,
|
||||
cssClasses : {
|
||||
input: 'search-input'
|
||||
}
|
||||
}),
|
||||
|
||||
instantsearch.widgets.stats({
|
||||
container: '.algolia-stats',
|
||||
templates: {
|
||||
text: data => {
|
||||
const stats = CONFIG.i18n.hits_time
|
||||
.replace('${hits}', data.nbHits)
|
||||
.replace('${time}', data.processingTimeMS);
|
||||
return `<span>${stats}</span>
|
||||
<img src="${CONFIG.images}/logo-algolia-nebula-blue-full.svg" alt="Algolia">`;
|
||||
}
|
||||
},
|
||||
cssClasses: {
|
||||
text: 'search-stats'
|
||||
}
|
||||
}),
|
||||
|
||||
instantsearch.widgets.hits({
|
||||
container : '.algolia-hits',
|
||||
escapeHTML: false,
|
||||
templates : {
|
||||
item: data => {
|
||||
const { title, excerpt, excerptStrip, contentStripTruncate } = data._highlightResult;
|
||||
let result = `<a href="${data.permalink}" class="search-result-title">${title.value}</a>`;
|
||||
const content = excerpt || excerptStrip || contentStripTruncate;
|
||||
if (content && content.value) {
|
||||
const div = document.createElement('div');
|
||||
div.innerHTML = content.value;
|
||||
result += `<a href="${data.permalink}"><p class="search-result">${div.textContent.substring(0, 100)}...</p></a>`;
|
||||
}
|
||||
return result;
|
||||
},
|
||||
empty: data => {
|
||||
return `<div class="algolia-hits-empty">
|
||||
${CONFIG.i18n.empty.replace('${query}', data.query)}
|
||||
</div>`;
|
||||
}
|
||||
},
|
||||
cssClasses: {
|
||||
list: 'search-result-list'
|
||||
}
|
||||
}),
|
||||
|
||||
instantsearch.widgets.pagination({
|
||||
container: '.algolia-pagination',
|
||||
scrollTo : false,
|
||||
showFirst: false,
|
||||
showLast : false,
|
||||
templates: {
|
||||
first : '<i class="fa fa-angle-double-left"></i>',
|
||||
last : '<i class="fa fa-angle-double-right"></i>',
|
||||
previous: '<i class="fa fa-angle-left"></i>',
|
||||
next : '<i class="fa fa-angle-right"></i>'
|
||||
},
|
||||
cssClasses: {
|
||||
list : ['pagination', 'algolia-pagination'],
|
||||
item : 'pagination-item',
|
||||
link : 'page-number',
|
||||
selectedItem: 'current',
|
||||
disabledItem: 'disabled-item'
|
||||
}
|
||||
})
|
||||
]);
|
||||
|
||||
search.start();
|
||||
|
||||
// Handle and trigger popup window
|
||||
document.querySelectorAll('.popup-trigger').forEach(element => {
|
||||
element.addEventListener('click', () => {
|
||||
document.body.classList.add('search-active');
|
||||
setTimeout(() => document.querySelector('.search-input').focus(), 500);
|
||||
});
|
||||
});
|
||||
|
||||
// Monitor main search box
|
||||
const onPopupClose = () => {
|
||||
document.body.classList.remove('search-active');
|
||||
};
|
||||
|
||||
document.querySelector('.search-pop-overlay').addEventListener('click', event => {
|
||||
if (event.target === document.querySelector('.search-pop-overlay')) {
|
||||
onPopupClose();
|
||||
}
|
||||
});
|
||||
document.querySelector('.popup-btn-close').addEventListener('click', onPopupClose);
|
||||
document.addEventListener('pjax:success', onPopupClose);
|
||||
window.addEventListener('keyup', event => {
|
||||
if (event.key === 'Escape') {
|
||||
onPopupClose();
|
||||
}
|
||||
});
|
||||
});
|
99
assets/js/third-party/search/local-search.js
vendored
99
assets/js/third-party/search/local-search.js
vendored
@ -1,99 +0,0 @@
|
||||
/* global CONFIG, pjax, LocalSearch */
|
||||
|
||||
document.addEventListener('DOMContentLoaded', () => {
|
||||
if (!CONFIG.path) {
|
||||
// Search DB path
|
||||
console.warn('`hexo-generator-searchdb` plugin is not installed!');
|
||||
return;
|
||||
}
|
||||
const localSearch = new LocalSearch({
|
||||
path : CONFIG.path,
|
||||
top_n_per_article: CONFIG.localsearch.top_n_per_article,
|
||||
unescape : CONFIG.localsearch.unescape
|
||||
});
|
||||
|
||||
const input = document.querySelector('.search-input');
|
||||
|
||||
const inputEventFunction = () => {
|
||||
if (!localSearch.isfetched) return;
|
||||
const searchText = input.value.trim().toLowerCase();
|
||||
const keywords = searchText.split(/[-\s]+/);
|
||||
const container = document.querySelector('.search-result-container');
|
||||
let resultItems = [];
|
||||
if (searchText.length > 0) {
|
||||
// Perform local searching
|
||||
resultItems = localSearch.getResultItems(keywords);
|
||||
}
|
||||
if (keywords.length === 1 && keywords[0] === '') {
|
||||
container.classList.add('no-result');
|
||||
container.innerHTML = '<div class="search-result-icon"><i class="fa fa-search fa-5x"></i></div>';
|
||||
} else if (resultItems.length === 0) {
|
||||
container.classList.add('no-result');
|
||||
container.innerHTML = '<div class="search-result-icon"><i class="far fa-frown fa-5x"></i></div>';
|
||||
} else {
|
||||
resultItems.sort((left, right) => {
|
||||
if (left.includedCount !== right.includedCount) {
|
||||
return right.includedCount - left.includedCount;
|
||||
} else if (left.hitCount !== right.hitCount) {
|
||||
return right.hitCount - left.hitCount;
|
||||
}
|
||||
return right.id - left.id;
|
||||
});
|
||||
const stats = CONFIG.i18n.hits.replace('${hits}', resultItems.length);
|
||||
|
||||
container.classList.remove('no-result');
|
||||
container.innerHTML = `<div class="search-stats">${stats}</div>
|
||||
<hr>
|
||||
<ul class="search-result-list">${resultItems.map(result => result.item).join('')}</ul>`;
|
||||
if (typeof pjax === 'object') pjax.refresh(container);
|
||||
}
|
||||
};
|
||||
|
||||
localSearch.highlightSearchWords(document.querySelector('.post-body'));
|
||||
if (CONFIG.localsearch.preload) {
|
||||
localSearch.fetchData();
|
||||
}
|
||||
|
||||
if (CONFIG.localsearch.trigger === 'auto') {
|
||||
input.addEventListener('input', inputEventFunction);
|
||||
} else {
|
||||
document.querySelector('.search-icon').addEventListener('click', inputEventFunction);
|
||||
input.addEventListener('keypress', event => {
|
||||
if (event.key === 'Enter') {
|
||||
inputEventFunction();
|
||||
}
|
||||
});
|
||||
}
|
||||
window.addEventListener('search:loaded', inputEventFunction);
|
||||
|
||||
// Handle and trigger popup window
|
||||
document.querySelectorAll('.popup-trigger').forEach(element => {
|
||||
element.addEventListener('click', () => {
|
||||
document.body.classList.add('search-active');
|
||||
// Wait for search-popup animation to complete
|
||||
setTimeout(() => input.focus(), 500);
|
||||
if (!localSearch.isfetched) localSearch.fetchData();
|
||||
});
|
||||
});
|
||||
|
||||
// Monitor main search box
|
||||
const onPopupClose = () => {
|
||||
document.body.classList.remove('search-active');
|
||||
};
|
||||
|
||||
document.querySelector('.search-pop-overlay').addEventListener('click', event => {
|
||||
if (event.target === document.querySelector('.search-pop-overlay')) {
|
||||
onPopupClose();
|
||||
}
|
||||
});
|
||||
document.querySelector('.popup-btn-close').addEventListener('click', onPopupClose);
|
||||
document.addEventListener('pjax:success', () => {
|
||||
localSearch.highlightSearchWords(document.querySelector('.post-body'));
|
||||
onPopupClose();
|
||||
});
|
||||
window.addEventListener('keyup', event => {
|
||||
if (event.key === 'Escape') {
|
||||
onPopupClose();
|
||||
}
|
||||
});
|
||||
});
|
64
assets/js/third-party/statistics/firestore.js
vendored
64
assets/js/third-party/statistics/firestore.js
vendored
@ -1,64 +0,0 @@
|
||||
/* global CONFIG, firebase */
|
||||
|
||||
firebase.initializeApp({
|
||||
apiKey : CONFIG.firestore.apiKey,
|
||||
projectId: CONFIG.firestore.projectId
|
||||
});
|
||||
|
||||
(function() {
|
||||
const getCount = (doc, increaseCount) => {
|
||||
// IncreaseCount will be false when not in article page
|
||||
return doc.get().then(d => {
|
||||
// Has no data, initialize count
|
||||
let count = d.exists ? d.data().count : 0;
|
||||
// If first view this article
|
||||
if (increaseCount) {
|
||||
// Increase count
|
||||
count++;
|
||||
doc.set({
|
||||
count
|
||||
});
|
||||
}
|
||||
return count;
|
||||
});
|
||||
};
|
||||
|
||||
const appendCountTo = el => {
|
||||
return count => {
|
||||
el.innerText = count;
|
||||
};
|
||||
};
|
||||
|
||||
const db = firebase.firestore();
|
||||
const articles = db.collection(CONFIG.firestore.collection);
|
||||
|
||||
document.addEventListener('page:loaded', () => {
|
||||
|
||||
if (CONFIG.page.isPost) {
|
||||
// Fix issue #118
|
||||
// https://developer.mozilla.org/en-US/docs/Web/API/Node/textContent
|
||||
const title = document.querySelector('.post-title').textContent.trim();
|
||||
const doc = articles.doc(title);
|
||||
let increaseCount = CONFIG.hostname === location.hostname;
|
||||
if (localStorage.getItem(title)) {
|
||||
increaseCount = false;
|
||||
} else {
|
||||
// Mark as visited
|
||||
localStorage.setItem(title, true);
|
||||
}
|
||||
getCount(doc, increaseCount).then(appendCountTo(document.querySelector('.firestore-visitors-count')));
|
||||
} else if (CONFIG.page.isHome) {
|
||||
const promises = [...document.querySelectorAll('.post-title')].map(element => {
|
||||
const title = element.textContent.trim();
|
||||
const doc = articles.doc(title);
|
||||
return getCount(doc);
|
||||
});
|
||||
Promise.all(promises).then(counts => {
|
||||
const metas = document.querySelectorAll('.firestore-visitors-count');
|
||||
counts.forEach((val, idx) => {
|
||||
appendCountTo(metas[idx])(val);
|
||||
});
|
||||
});
|
||||
}
|
||||
});
|
||||
})();
|
102
assets/js/third-party/statistics/lean-analytics.js
vendored
102
assets/js/third-party/statistics/lean-analytics.js
vendored
@ -1,102 +0,0 @@
|
||||
/* global CONFIG */
|
||||
/* eslint-disable no-console */
|
||||
|
||||
(function() {
|
||||
const leancloudSelector = url => {
|
||||
url = encodeURI(url);
|
||||
return document.getElementById(url).querySelector('.leancloud-visitors-count');
|
||||
};
|
||||
|
||||
const addCount = Counter => {
|
||||
const visitors = document.querySelector('.leancloud_visitors');
|
||||
const url = decodeURI(visitors.id);
|
||||
const title = visitors.dataset.flagTitle;
|
||||
|
||||
Counter('get', `/classes/Counter?where=${encodeURIComponent(JSON.stringify({ url }))}`)
|
||||
.then(response => response.json())
|
||||
.then(({ results }) => {
|
||||
if (results.length > 0) {
|
||||
const counter = results[0];
|
||||
leancloudSelector(url).innerText = counter.time + 1;
|
||||
Counter('put', '/classes/Counter/' + counter.objectId, {
|
||||
time: {
|
||||
'__op' : 'Increment',
|
||||
'amount': 1
|
||||
}
|
||||
})
|
||||
.catch(error => {
|
||||
console.error('Failed to save visitor count', error);
|
||||
});
|
||||
} else if (CONFIG.leancloud_visitors.security) {
|
||||
leancloudSelector(url).innerText = 'Counter not initialized! More info at console err msg.';
|
||||
console.error('ATTENTION! LeanCloud counter has security bug, see how to solve it here: https://github.com/theme-next/hexo-leancloud-counter-security. \n However, you can still use LeanCloud without security, by setting `security` option to `false`.');
|
||||
} else {
|
||||
Counter('post', '/classes/Counter', { title, url, time: 1 })
|
||||
.then(response => response.json())
|
||||
.then(() => {
|
||||
leancloudSelector(url).innerText = 1;
|
||||
})
|
||||
.catch(error => {
|
||||
console.error('Failed to create', error);
|
||||
});
|
||||
}
|
||||
})
|
||||
.catch(error => {
|
||||
console.error('LeanCloud Counter Error', error);
|
||||
});
|
||||
};
|
||||
|
||||
const showTime = Counter => {
|
||||
const visitors = document.querySelectorAll('.leancloud_visitors');
|
||||
const entries = [...visitors].map(element => {
|
||||
return decodeURI(element.id);
|
||||
});
|
||||
|
||||
Counter('get', `/classes/Counter?where=${encodeURIComponent(JSON.stringify({ url: { '$in': entries } }))}`)
|
||||
.then(response => response.json())
|
||||
.then(({ results }) => {
|
||||
for (const url of entries) {
|
||||
const target = results.find(item => item.url === url);
|
||||
leancloudSelector(url).innerText = target ? target.time : 0;
|
||||
}
|
||||
})
|
||||
.catch(error => {
|
||||
console.error('LeanCloud Counter Error', error);
|
||||
});
|
||||
};
|
||||
|
||||
const { app_id, app_key, server_url } = CONFIG.leancloud_visitors;
|
||||
const fetchData = api_server => {
|
||||
const Counter = (method, url, data) => {
|
||||
return fetch(`${api_server}/1.1${url}`, {
|
||||
method,
|
||||
headers: {
|
||||
'X-LC-Id' : app_id,
|
||||
'X-LC-Key' : app_key,
|
||||
'Content-Type': 'application/json'
|
||||
},
|
||||
body: JSON.stringify(data)
|
||||
});
|
||||
};
|
||||
if (CONFIG.page.isPost) {
|
||||
if (CONFIG.hostname !== location.hostname) return;
|
||||
addCount(Counter);
|
||||
} else if (document.querySelectorAll('.post-title-link').length >= 1) {
|
||||
showTime(Counter);
|
||||
}
|
||||
};
|
||||
|
||||
const api_server = app_id.slice(-9) === '-MdYXbMMI' ? `https://${app_id.slice(0, 8).toLowerCase()}.api.lncldglobal.com` : server_url;
|
||||
|
||||
document.addEventListener('page:loaded', () => {
|
||||
if (api_server) {
|
||||
fetchData(api_server);
|
||||
} else {
|
||||
fetch(`https://app-router.leancloud.cn/2/route?appId=${app_id}`)
|
||||
.then(response => response.json())
|
||||
.then(({ api_server }) => {
|
||||
fetchData(`https://${api_server}`);
|
||||
});
|
||||
}
|
||||
});
|
||||
})();
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user