Merge branch 'develop'

This commit is contained in:
Cell
2022-01-08 19:58:16 +08:00
21 changed files with 1030 additions and 913 deletions
+1
View File
@@ -14,6 +14,7 @@ $RECYCLE.BIN/
# OSX
.DS_Store
.hugo_build.lock
# Linux
.directory
+3
View File
@@ -0,0 +1,3 @@
[submodule "assets/lib/watermark"]
path = assets/lib/watermark
url = git@github.com:Lruihao/watermark.git
+5 -2
View File
@@ -1,10 +1,12 @@
<!-- See https://github.com/Lruihao/FixIt/releases -->
## v0.2.12
## v0.2.12 [2022-1-8]
- :tada: Feat: add PWA support
- :tada: Feat: add Watermark support ([#16](https://github.com/Lruihao/FixIt/issues/16))
- :bug: Fix: add scroll-margin to headerlink
- :bug: Fix: Check if content is empty beforing passing
- :bug: Fix: toc-auto display error ([#21](https://github.com/Lruihao/FixIt/issues/21))
- :fire: Feat: remove lib smooth-scroll ([#1](https://github.com/Lruihao/FixIt/issues/1))
- :lipstick: Style: change scroll-behavior to smooth
- :lipstick: Style: page image margin
@@ -12,7 +14,8 @@
- :wrench: Chore: minify card-link background image
- :wrench: Chore(i18n): change some translations
## v0.2.11
[`v0.2.11...v0.2.12`](https://github.com/Lruihao/FixIt/compare/v0.2.11...v0.2.12)
## v0.2.11 [2021-12-19]
> :tada: The beginning of FixIt to fix the theme LoveIt.
+1
View File
@@ -48,6 +48,7 @@ Thanks to the authors of following resources included in the theme:
* [Gitalk](https://github.com/gitalk/gitalk)
* [Valine](https://valine.js.org/)
* [cookieconsent](https://github.com/osano/cookieconsent)
* [Watermark](https://github.com/Lruihao/watermark)
## Author
+1 -1
View File
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+2 -1
View File
@@ -22,4 +22,5 @@ sharer.js@0.4.2 https://github.com/ellisonleao/sharer.js
simple-icons@5.21.1 https://github.com/simple-icons/simple-icons
twemoji@13.1.0 https://github.com/twitter/twemoji
typeit@7.0.4 https://github.com/alexmacarthur/typeit
valine@1.4.16 https://github.com/xCss/Valine
valine@1.4.16 https://github.com/xCss/Valine
watermark@1.0.2 https://github.com/Lruihao/watermark.git
+58 -24
View File
@@ -4,14 +4,14 @@ baseURL = "https://example.com"
defaultContentLanguage = "en"
# theme
# 主题
theme = "LoveIt"
theme = "FixIt"
# themes directory
# 主题目录
themesDir = "../.."
# website title
# 网站标题
title = "LoveIt"
title = "FixIt"
# whether to use robots.txt
# 是否使用 robots.txt
@@ -88,18 +88,18 @@ enableEmoji = true
pre = "<i class='fab fa-github fa-fw'></i>"
post = ""
name = ""
url = "https://github.com/dillonzq/LoveIt"
url = "https://github.com/Lruihao/FixIt"
title = "GitHub"
weight = 6
[languages.en.params]
# site description
description = "About LoveIt Theme"
description = "About FixIt Theme"
# site keywords
keywords = ["Theme", "Hugo"]
# App icon config
[languages.en.params.app]
# optional site title override for the app when added to an iOS home screen or Android launcher
title = "LoveIt"
title = "FixIt"
# whether to omit favicon resource links
noFavicon = false
# modern SVG favicon to use in place of older style .png and .ico files
@@ -290,18 +290,18 @@ enableEmoji = true
pre = "<i class='fab fa-github fa-fw'></i>"
post = ""
name = ""
url = "https://github.com/dillonzq/LoveIt"
url = "https://github.com/Lruihao/FixIt"
title = "GitHub"
weight = 6
[languages.zh-cn.params]
# 网站描述
description = "关于 LoveIt 主题"
description = "关于 FixIt 主题"
# 网站关键词
keywords = ["Theme", "Hugo"]
# 应用图标配置
[languages.zh-cn.params.app]
# 当添加到 iOS 主屏幕或者 Android 启动器时的标题, 覆盖默认标题
title = "LoveIt"
title = "FixIt"
# 是否隐藏网站图标资源链接
noFavicon = false
# 更现代的 SVG 网站图标, 可替代旧的 .png 和 .ico 文件
@@ -488,18 +488,18 @@ enableEmoji = true
pre = "<i class='fab fa-github fa-fw'></i>"
post = ""
name = ""
url = "https://github.com/dillonzq/LoveIt"
url = "https://github.com/Lruihao/FixIt"
title = "GitHub"
weight = 6
[languages.fr.params]
# site description
description = "À propos du thème LoveIt"
description = "À propos du thème FixIt"
# site keywords
keywords = ["Thème", "Hugo"]
# App icon config
[languages.fr.params.app]
# optional site title override for the app when added to an iOS home screen or Android launcher
title = "LoveIt"
title = "FixIt"
# whether to omit favicon resource links
noFavicon = false
# modern SVG favicon to use in place of older style .png and .ico files
@@ -564,7 +564,7 @@ enableEmoji = true
GitHub = "xxxx"
Linkedin = "xxxx"
Twitter = "xxxx"
Instagram = ""
Instagram = "xxxx"
Facebook = ""
Telegram = ""
Medium = ""
@@ -627,15 +627,15 @@ enableEmoji = true
RSS = true
[params]
# LoveIt theme version
# LoveIt 主题版本
# FixIt theme version
# FixIt 主题版本
version = "0.2.X"
# site default theme ("light", "dark", "auto")
# 网站默认主题 ("light", "dark", "auto")
defaultTheme = "auto"
# public git repo url only then enableGitInfo is true
# 公共 git 仓库路径,仅在 enableGitInfo 设为 true 时有效
gitRepo = "https://github.com/dillonzq/LoveIt"
gitRepo = "https://github.com/Lruihao/FixIt"
# which hash function used for SRI, when empty, no SRI is used ("sha256", "sha384", "sha512", "md5")
# 哪种哈希函数用来 SRI, 为空时表示不使用 SRI ("sha256", "sha384", "sha512", "md5")
fingerprint = ""
@@ -645,8 +645,8 @@ enableEmoji = true
# website images for Open Graph and Twitter Cards
# 网站图片, 用于 Open Graph 和 Twitter Cards
images = ["/logo.png"]
# enable PWA
# 开启 PWA 支持
# enable PWA since v0.2.12
# 开启 PWA 支持>v0.2.12 版本)
enablePWA = true
# Header config
@@ -666,7 +666,7 @@ enableEmoji = true
logo = ""
# title name
# 标题名称
name = "LoveIt"
name = "FixIt"
# you can add extra information before the name (HTML format is supported), such as icons
# 你可以在名称 (允许 HTML 格式) 之前添加其他信息, 例如图标
pre = "<i class='far fa-kiss-wink-heart fa-fw'></i>"
@@ -887,15 +887,15 @@ enableEmoji = true
recordIP = true
highlight = true
enableQQ = false
serverURLs = "https://leancloud.hugoloveit.com"
serverURLs = "https://leancloud.hugoFixIt.com"
# emoji data file name, default is "google.yml"
# ("apple.yml", "google.yml", "facebook.yml", "twitter.yml")
# located in "themes/LoveIt/assets/data/emoji/" directory
# located in "themes/FixIt/assets/data/emoji/" directory
# you can store your own data files in the same path under your project:
# "assets/data/emoji/"
# emoji 数据文件名称, 默认是 "google.yml"
# ("apple.yml", "google.yml", "facebook.yml", "twitter.yml")
# 位于 "themes/LoveIt/assets/data/emoji/" 目录
# 位于 "themes/FixIt/assets/data/emoji/" 目录
# 可以在你的项目下相同路径存放你自己的数据文件:
# "assets/data/emoji/"
emoji = ""
@@ -973,6 +973,40 @@ enableEmoji = true
# 打字结束之后光标的持续时间 (单位是毫秒, "-1" 代表无限大)
duration = -1
# Watermark config since v0.2.12
# Detail config see https://github.com/Lruihao/watermark#readme
# 水印配置
# 详细参数见 https://github.com/Lruihao/watermark#readme
[params.watermark]
enable = true
# watermark's text
# 水印内容
content = 'Theme FixIt'
# watermark's transparency
# 水印透明度
opacity = 0.02
# parent of watermark's container
# 水印父节点
appendTo = '.wrapper>.main'
# watermark's width. unit: px
# 单水印宽度 单位:px
width = 150
# watermark's height. unit: px
# 单水印高度 单位:px
height = 20
# row spacing of watermarks. unit: px
# 水印行间距 单位:px
rowSpacing = 60
# col spacing of watermarks. unit: px
# 水印列间距 单位:px
colSpacing = 30
# watermark's tangent angle. unit: deg
# 水印旋转角度 单位:deg
rotate = 15
# watermark's fontSize. unit: rem
# 水印字体大小,单位:rem
fontSize = 0.85
# Site verification code for Google/Bing/Yandex/Pinterest/Baidu
# 网站验证代码,用于 Google/Bing/Yandex/Pinterest/Baidu
[params.verification]
@@ -1025,15 +1059,15 @@ enableEmoji = true
[params.cdn]
# CDN data file name, disabled by default
# ("jsdelivr.yml")
# located in "themes/LoveIt/assets/data/cdn/" directory
# located in "themes/FixIt/assets/data/cdn/" directory
# you can store your own data files in the same path under your project:
# "assets/data/cdn/"
# CDN 数据文件名称, 默认不启用
# ("jsdelivr.yml")
# 位于 "themes/LoveIt/assets/data/cdn/" 目录
# 位于 "themes/FixIt/assets/data/cdn/" 目录
# 可以在你的项目下相同路径存放你自己的数据文件:
# "assets/data/cdn/"
data = "jsdelivr.yml"
# data = "jsdelivr.yml"
# Compatibility config
# 兼容性设置
+35
View File
@@ -0,0 +1,35 @@
---
title: "離線 (Offline)"
comment: false
---
> 您沒有連接到 Internet,只有緩存的頁面可用。
> You are not connected to the Internet, only cached pages will be available.
```bash
███████ ███████████ ███████████ █████ █████ ██████ █████ ██████████
███░░░░░███ ░░███░░░░░░█░░███░░░░░░█░░███ ░░███ ░░██████ ░░███ ░░███░░░░░█
███ ░░███ ░███ █ ░ ░███ █ ░ ░███ ░███ ░███░███ ░███ ░███ █ ░
░███ ░███ ░███████ ░███████ ░███ ░███ ░███░░███░███ ░██████
░███ ░███ ░███░░░█ ░███░░░█ ░███ ░███ ░███ ░░██████ ░███░░█
░░███ ███ ░███ ░ ░███ ░ ░███ █ ░███ ░███ ░░█████ ░███ ░ █
░░░███████░ █████ █████ ███████████ █████ █████ ░░█████ ██████████
░░░░░░░ ░░░░░ ░░░░░ ░░░░░░░░░░░ ░░░░░ ░░░░░ ░░░░░ ░░░░░░░░░░
▒█████ █████▒ █████▒██▓ ██▓ ███▄ █ ▓█████
▒██▒ ██▒▓██ ▒▓██ ▒▓██▒ ▓██▒ ██ ▀█ █ ▓█ ▀
▒██░ ██▒▒████ ░▒████ ░▒██░ ▒██▒▓██ ▀█ ██▒▒███
▒██ ██░░▓█▒ ░░▓█▒ ░▒██░ ░██░▓██▒ ▐▌██▒▒▓█ ▄
░ ████▓▒░░▒█░ ░▒█░ ░██████▒░██░▒██░ ▓██░░▒████▒
░ ▒░▒░▒░ ▒ ░ ▒ ░ ░ ▒░▓ ░░▓ ░ ▒░ ▒ ▒ ░░ ▒░ ░
░ ▒ ▒░ ░ ░ ░ ░ ▒ ░ ▒ ░░ ░░ ░ ▒░ ░ ░ ░
░ ░ ░ ▒ ░ ░ ░ ░ ░ ░ ▒ ░ ░ ░ ░ ░
░ ░ ░ ░ ░ ░ ░ ░
████▄ ▄████ ▄████ █ ▄█ ▄ ▄███▄
█ █ █▀ ▀ █▀ ▀ █ ██ █ █▀ ▀
█ █ █▀▀ █▀▀ █ ██ ██ █ ██▄▄
▀████ █ █ ███▄ ▐█ █ █ █ █▄ ▄▀
█ █ ▀ ▐ █ █ █ ▀███▀
▀ ▀ █ ██
```
@@ -107,7 +107,7 @@ The rendered output looks like this:
</section>
{{< /highlight >}}
## 4 instagram
## 4 instagram [Deprecated]
[Documentation of `instagram`](https://gohugo.io/content-management/shortcodes#instagram)
@@ -119,8 +119,6 @@ Example `instagram` input:
The rendered output looks like this:
{{< instagram BWNjjyYFxVx hidecaption >}}
## 5 param
[Documentation of `param`](https://gohugo.io/content-management/shortcodes#param)
@@ -112,7 +112,7 @@ The rendered output looks like this:
</section>
{{< /highlight >}}
## 4 instagram
## 4 instagram [Deprecated]
[Documentation of `instagram`](https://gohugo.io/content-management/shortcodes#instagram)
@@ -124,8 +124,6 @@ Example `instagram` input:
The rendered output looks like this:
{{< instagram BWNjjyYFxVx hidecaption >}}
## 5 param
[Documentation of `param`](https://gohugo.io/content-management/shortcodes#param)
@@ -6,7 +6,7 @@ lastmod: 2020-03-04T16:29:59+08:00
draft: false
author: "Dillon"
authorLink: "https://dillonzq.com"
description: "Hugo 提供了多个内置的 Shortcodes, 以方便作者保持 Markdown 内容的整洁."
description: "Hugo 提供了多个内置的 Shortcodes, 以方便作者保持 Markdown 内容的整洁"
resources:
- name: "featured-image"
src: "featured-image.png"
@@ -17,35 +17,35 @@ categories: ["documentation"]
lightgallery: true
---
**Hugo** 提供了多个内置的 Shortcodes, 以方便作者保持 Markdown 内容的整洁.
**Hugo** 提供了多个内置的 Shortcodes, 以方便作者保持 Markdown 内容的整洁
<!--more-->
Hugo 使用 Markdown 为其简单的内容格式. 但是, Markdown 在很多方面都无法很好地支持. 你可以使用纯 HTML 来扩展可能性.
Hugo 使用 Markdown 为其简单的内容格式。但是,Markdown 在很多方面都无法很好地支持你可以使用纯 HTML 来扩展可能性
但这恰好是一个坏主意. 大家使用 Markdown, 正是因为它即使不经过渲染也可以轻松阅读. 应该尽可能避免使用 HTML 以保持内容简洁.
但这恰好是一个坏主意大家使用 Markdown, 正是因为它即使不经过渲染也可以轻松阅读应该尽可能避免使用 HTML 以保持内容简洁
为了避免这种限制, Hugo 创建了 [shortcodes](https://gohugo.io/extras/shortcodes/).
shortcode 是一个简单代码段, 可以生成合理的 HTML 代码, 并且符合 Markdown 的设计哲学.
为了避免这种限制Hugo 创建了 [shortcodes](https://gohugo.io/extras/shortcodes/).
shortcode 是一个简单代码段可以生成合理的 HTML 代码并且符合 Markdown 的设计哲学
Hugo 附带了一组预定义的 shortcodes, 它们实现了一些非常常见的用法.
提供这些 shortcodes 是为了方便保持你的 Markdown 内容简洁.
Hugo 附带了一组预定义的 shortcodes, 它们实现了一些非常常见的用法
提供这些 shortcodes 是为了方便保持你的 Markdown 内容简洁
## 1 figure {#figure}
[`figure` 的文档](https://gohugo.io/content-management/shortcodes#figure)
一个 `figure` 示例:
一个 `figure` 示例
```markdown
{{</* figure src="/images/lighthouse.jpg" title="Lighthouse (figure)" */>}}
```
呈现的输出效果如下:
呈现的输出效果如下
{{< figure src="/images/lighthouse.jpg" title="Lighthouse (figure)" >}}
输出的 HTML 看起来像这样:
输出的 HTML 看起来像这样
```html
<figure>
@@ -60,17 +60,17 @@ Hugo 附带了一组预定义的 shortcodes, 它们实现了一些非常常见
[`gist` 的文档](https://gohugo.io/content-management/shortcodes#gist)
一个 `gist` 示例:
一个 `gist` 示例
```markdown
{{</* gist spf13 7896402 */>}}
```
呈现的输出效果如下:
呈现的输出效果如下
{{< gist spf13 7896402 >}}
输出的 HTML 看起来像这样:
输出的 HTML 看起来像这样
```html
<script type="application/javascript" src="https://gist.github.com/spf13/7896402.js"></script>
@@ -80,7 +80,7 @@ Hugo 附带了一组预定义的 shortcodes, 它们实现了一些非常常见
[`highlight` 的文档](https://gohugo.io/content-management/shortcodes#instagram)
一个 `highlight` 示例:
一个 `highlight` 示例
```markdown
{{</* highlight html */>}}
@@ -95,7 +95,7 @@ Hugo 附带了一组预定义的 shortcodes, 它们实现了一些非常常见
{{</* /highlight */>}}
```
呈现的输出效果如下:
呈现的输出效果如下
{{< highlight html >}}
<section id="main">
@@ -108,31 +108,29 @@ Hugo 附带了一组预定义的 shortcodes, 它们实现了一些非常常见
</section>
{{< /highlight >}}
## 4 instagram
## 4 instagram [Deprecated]
[`instagram` 的文档](https://gohugo.io/content-management/shortcodes#instagram)
一个 `instagram` 示例:
一个 `instagram` 示例
```markdown
{{</* instagram BWNjjyYFxVx hidecaption */>}}
```
呈现的输出效果如下:
{{< instagram BWNjjyYFxVx hidecaption >}}
呈现的输出效果如下
## 5 param
[`param` 的文档](https://gohugo.io/content-management/shortcodes#param)
一个 `param` 示例:
一个 `param` 示例
```markdown
{{</* param description */>}}
```
呈现的输出效果如下:
呈现的输出效果如下
{{< param description >}}
@@ -144,13 +142,13 @@ Hugo 附带了一组预定义的 shortcodes, 它们实现了一些非常常见
[`tweet` 的文档](https://gohugo.io/content-management/shortcodes#tweet)
一个 `tweet` 示例:
一个 `tweet` 示例
```markdown
{{</* tweet 877500564405444608 */>}}
```
呈现的输出效果如下:
呈现的输出效果如下
{{< tweet 877500564405444608 >}}
@@ -158,13 +156,13 @@ Hugo 附带了一组预定义的 shortcodes, 它们实现了一些非常常见
[`vimeo` 的文档](https://gohugo.io/content-management/shortcodes#vimeo)
一个 `vimeo` 示例:
一个 `vimeo` 示例
```markdown
{{</* vimeo 146022717 */>}}
```
呈现的输出效果如下:
呈现的输出效果如下
{{< vimeo 146022717 >}}
@@ -172,12 +170,12 @@ Hugo 附带了一组预定义的 shortcodes, 它们实现了一些非常常见
[`youtube` 的文档](https://gohugo.io/content-management/shortcodes#youtube)
一个 `youtube` 示例:
一个 `youtube` 示例
```markdown
{{</* youtube w7Ft2ymGmfc */>}}
```
呈现的输出效果如下:
呈现的输出效果如下
{{< youtube w7Ft2ymGmfc >}}
+25 -17
View File
@@ -1,19 +1,27 @@
{
"name": "LoveIt",
"short_name": "LoveIt",
"icons": [
{
"src": "/android-chrome-192x192.png",
"sizes": "192x192",
"type": "image/png"
},
{
"src": "/android-chrome-512x512.png",
"sizes": "512x512",
"type": "image/png"
}
],
"theme_color": "#ffffff",
"background_color": "#ffffff",
"display": "standalone"
"name": "FixIt",
"short_name": "FixIt",
"description": "A Clean, Elegant but Advanced Hugo Theme",
"icons": [
{
"src": "/apple-touch-icon.png",
"sizes": "180x180",
"type": "image/png",
"purpose": "any maskable"
},
{
"src": "/android-chrome-192x192.png",
"sizes": "192x192",
"type": "image/png"
},
{
"src": "/android-chrome-512x512.png",
"sizes": "512x512",
"type": "image/png"
}
],
"theme_color": "#ffffff",
"background_color": "#ffffff",
"display": "standalone",
"start_url": "/"
}
Binary file not shown.

Before

Width:  |  Height:  |  Size: 222 KiB

After

Width:  |  Height:  |  Size: 495 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 280 KiB

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 881 KiB

-21
View File
@@ -45,27 +45,6 @@
</a>
</div>
{{- /* PWA */ -}}
{{- if eq .Site.Params.enablePWA true -}}
{{- if eq hugo.Environment "production" -}}
<script type="text/javascript">
if ('serviceWorker' in navigator) {
navigator.serviceWorker
.register('/service-worker.min.js', { scope: '/' })
.then(function (registration) {
// console.log('Service Worker Registered');
})
.catch(function (error) {
console.error('error: ', error);
});
navigator.serviceWorker.ready.then(function (registration) {
// console.log('Service Worker Ready');
});
}
</script>
{{- end -}}
{{- end -}}
{{- /* Load JavaScript scripts and CSS */ -}}
{{- partial "assets.html" . -}}
</body>
+151 -108
View File
@@ -5,29 +5,29 @@
{{- /* Search */ -}}
{{- if .Site.Params.search | and .Site.Params.search.enable -}}
{{- $search := .Site.Params.search -}}
{{- $source := $cdn.autocompleteJS | default "lib/autocomplete/autocomplete.min.js" -}}
{{- dict "Source" $source "Fingerprint" $fingerprint | dict "Scratch" .Scratch "Data" | partial "scratch/script.html" -}}
{{- $config = dict "maxResultLength" $search.maxResultLength "snippetLength" $search.snippetLength "highlightTag" $search.highlightTag "noResultsFound" (T "noResultsFound") | dict "search" | merge $config -}}
{{- if eq $search.type "lunr" -}}
{{- with .Site.Home.OutputFormats.Get "json" -}}
{{- $config = dict "type" "lunr" "lunrIndexURL" .RelPermalink | dict "search" | merge $config -}}
{{- end -}}
{{- $source := $cdn.lunrJS | default "lib/lunr/lunr.min.js" -}}
{{- dict "Source" $source "Fingerprint" $fingerprint | dict "Scratch" .Scratch "Data" | partial "scratch/script.html" -}}
{{- if T "lunrLanguageLib" -}}
{{- $config = T "lunrLanguageCode" | dict "lunrLanguageCode" | dict "search" | merge $config -}}
{{- with T "lunrSegmentitLib" -}}
{{- $config = dict "lunrSegmentitURL" (resources.Get .).RelPermalink | dict "search" | merge $config -}}
{{- end -}}
{{- dict "Source" "lib/lunr/lunr.stemmer.support.js" "Minify" true "Fingerprint" $fingerprint | dict "Scratch" .Scratch "Data" | partial "scratch/script.html" -}}
{{- dict "Source" (T "lunrLanguageLib") "Minify" true "Fingerprint" $fingerprint | dict "Scratch" .Scratch "Data" | partial "scratch/script.html" -}}
{{- end -}}
{{- else if eq $search.type "algolia" -}}
{{- $source := $cdn.algoliasearchJS | default "lib/algoliasearch/algoliasearch-lite.umd.min.js" -}}
{{- dict "Source" $source "Fingerprint" $fingerprint | dict "Scratch" .Scratch "Data" | partial "scratch/script.html" -}}
{{- $config = dict "type" "algolia" "algoliaIndex" $search.algolia.index "algoliaAppID" $search.algolia.appID "algoliaSearchKey" $search.algolia.searchKey | dict "search" | merge $config -}}
{{- $search := .Site.Params.search -}}
{{- $source := $cdn.autocompleteJS | default "lib/autocomplete/autocomplete.min.js" -}}
{{- dict "Source" $source "Fingerprint" $fingerprint | dict "Scratch" .Scratch "Data" | partial "scratch/script.html" -}}
{{- $config = dict "maxResultLength" $search.maxResultLength "snippetLength" $search.snippetLength "highlightTag" $search.highlightTag "noResultsFound" (T "noResultsFound") | dict "search" | merge $config -}}
{{- if eq $search.type "lunr" -}}
{{- with .Site.Home.OutputFormats.Get "json" -}}
{{- $config = dict "type" "lunr" "lunrIndexURL" .RelPermalink | dict "search" | merge $config -}}
{{- end -}}
{{- $source := $cdn.lunrJS | default "lib/lunr/lunr.min.js" -}}
{{- dict "Source" $source "Fingerprint" $fingerprint | dict "Scratch" .Scratch "Data" | partial "scratch/script.html" -}}
{{- if T "lunrLanguageLib" -}}
{{- $config = T "lunrLanguageCode" | dict "lunrLanguageCode" | dict "search" | merge $config -}}
{{- with T "lunrSegmentitLib" -}}
{{- $config = dict "lunrSegmentitURL" (resources.Get .).RelPermalink | dict "search" | merge $config -}}
{{- end -}}
{{- dict "Source" "lib/lunr/lunr.stemmer.support.js" "Minify" true "Fingerprint" $fingerprint | dict "Scratch" .Scratch "Data" | partial "scratch/script.html" -}}
{{- dict "Source" (T "lunrLanguageLib") "Minify" true "Fingerprint" $fingerprint | dict "Scratch" .Scratch "Data" | partial "scratch/script.html" -}}
{{- end -}}
{{- else if eq $search.type "algolia" -}}
{{- $source := $cdn.algoliasearchJS | default "lib/algoliasearch/algoliasearch-lite.umd.min.js" -}}
{{- dict "Source" $source "Fingerprint" $fingerprint | dict "Scratch" .Scratch "Data" | partial "scratch/script.html" -}}
{{- $config = dict "type" "algolia" "algoliaIndex" $search.algolia.index "algoliaAppID" $search.algolia.appID "algoliaSearchKey" $search.algolia.searchKey | dict "search" | merge $config -}}
{{- end -}}
{{- end -}}
{{- /* lazysizes */ -}}
@@ -36,22 +36,22 @@
{{- /* twemoji */ -}}
{{- if $params.twemoji -}}
{{- $source := $cdn.twemojiJS | default "lib/twemoji/twemoji.min.js" -}}
{{- dict "Source" $source "Fingerprint" $fingerprint | dict "Scratch" .Scratch "Data" | partial "scratch/script.html" -}}
{{- $config = dict "twemoji" true | merge $config -}}
{{- $source := $cdn.twemojiJS | default "lib/twemoji/twemoji.min.js" -}}
{{- dict "Source" $source "Fingerprint" $fingerprint | dict "Scratch" .Scratch "Data" | partial "scratch/script.html" -}}
{{- $config = dict "twemoji" true | merge $config -}}
{{- end -}}
{{- /* lightgallery.js */ -}}
{{- if $params.lightgallery -}}
{{- $source := $cdn.lightgalleryCSS | default "lib/lightgallery/lightgallery.min.css" -}}
{{- dict "Source" $source "Fingerprint" $fingerprint | dict "Scratch" .Scratch "Data" | partial "scratch/style.html" -}}
{{- $source := $cdn.lightgalleryJS | default "lib/lightgallery/lightgallery.min.js" -}}
{{- dict "Source" $source "Fingerprint" $fingerprint | dict "Scratch" .Scratch "Data" | partial "scratch/script.html" -}}
{{- $source := $cdn.lightgalleryThumbnailJS | default "lib/lightgallery/lg-thumbnail.min.js" -}}
{{- dict "Source" $source "Fingerprint" $fingerprint | dict "Scratch" .Scratch "Data" | partial "scratch/script.html" -}}
{{- $source := $cdn.lightgalleryZoomJS | default "lib/lightgallery/lg-zoom.min.js" -}}
{{- dict "Source" $source "Fingerprint" $fingerprint | dict "Scratch" .Scratch "Data" | partial "scratch/script.html" -}}
{{- $config = dict "selector" ".lightgallery" "speed" 400 "hideBarsDelay" 2000 "thumbnail" true "exThumbImage" "data-thumbnail" "thumbWidth" 80 "thumbContHeight" 80 "actualSize" false | dict "lightGallery" | merge $config -}}
{{- $source := $cdn.lightgalleryCSS | default "lib/lightgallery/lightgallery.min.css" -}}
{{- dict "Source" $source "Fingerprint" $fingerprint | dict "Scratch" .Scratch "Data" | partial "scratch/style.html" -}}
{{- $source := $cdn.lightgalleryJS | default "lib/lightgallery/lightgallery.min.js" -}}
{{- dict "Source" $source "Fingerprint" $fingerprint | dict "Scratch" .Scratch "Data" | partial "scratch/script.html" -}}
{{- $source := $cdn.lightgalleryThumbnailJS | default "lib/lightgallery/lg-thumbnail.min.js" -}}
{{- dict "Source" $source "Fingerprint" $fingerprint | dict "Scratch" .Scratch "Data" | partial "scratch/script.html" -}}
{{- $source := $cdn.lightgalleryZoomJS | default "lib/lightgallery/lg-zoom.min.js" -}}
{{- dict "Source" $source "Fingerprint" $fingerprint | dict "Scratch" .Scratch "Data" | partial "scratch/script.html" -}}
{{- $config = dict "selector" ".lightgallery" "speed" 400 "hideBarsDelay" 2000 "thumbnail" true "exThumbImage" "data-thumbnail" "thumbWidth" 80 "thumbContHeight" 80 "actualSize" false | dict "lightGallery" | merge $config -}}
{{- end -}}
{{- $code := $params.code | default dict -}}
@@ -59,126 +59,132 @@
{{- /* clipboard.js */ -}}
{{- if ne $code.copy false -}}
{{- $source := $cdn.clipboardJS | default "lib/clipboard/clipboard.min.js" -}}
{{- dict "Source" $source "Fingerprint" $fingerprint | dict "Scratch" .Scratch "Data" | partial "scratch/script.html" -}}
{{- $config = T "copyToClipboard" | dict "copyTitle" | dict "code" | merge $config -}}
{{- $source := $cdn.clipboardJS | default "lib/clipboard/clipboard.min.js" -}}
{{- dict "Source" $source "Fingerprint" $fingerprint | dict "Scratch" .Scratch "Data" | partial "scratch/script.html" -}}
{{- $config = T "copyToClipboard" | dict "copyTitle" | dict "code" | merge $config -}}
{{- end -}}
{{- /* Sharer.js */ -}}
{{- if $params.share.enable -}}
{{- $source := $cdn.sharerJS | default "lib/sharer/sharer.min.js" -}}
{{- dict "Source" $source "Fingerprint" $fingerprint | dict "Scratch" .Scratch "Data" | partial "scratch/script.html" -}}
{{- $source := $cdn.sharerJS | default "lib/sharer/sharer.min.js" -}}
{{- dict "Source" $source "Fingerprint" $fingerprint | dict "Scratch" .Scratch "Data" | partial "scratch/script.html" -}}
{{- end -}}
{{- /* TypeIt */ -}}
{{- with (.Scratch.Get "this").typeitMap -}}
{{- $typeit := $.Site.Params.typeit -}}
{{- $source := $cdn.typeitJS | default "lib/typeit/typeit.min.js" -}}
{{- dict "Source" $source "Fingerprint" $fingerprint | dict "Scratch" $.Scratch "Data" | partial "scratch/script.html" -}}
{{- $config = dict "speed" $typeit.speed "cursorSpeed" $typeit.cursorSpeed "cursorChar" $typeit.cursorChar "duration" $typeit.duration "data" . | dict "typeit" | merge $config -}}
{{- $typeit := $.Site.Params.typeit -}}
{{- $source := $cdn.typeitJS | default "lib/typeit/typeit.min.js" -}}
{{- dict "Source" $source "Fingerprint" $fingerprint | dict "Scratch" $.Scratch "Data" | partial "scratch/script.html" -}}
{{- $config = dict "speed" $typeit.speed "cursorSpeed" $typeit.cursorSpeed "cursorChar" $typeit.cursorChar "duration" $typeit.duration "data" . | dict "typeit" | merge $config -}}
{{- end -}}
{{- /* KaTeX */ -}}
{{- $math := $params.math -}}
{{- if eq $math true -}}
{{- $math = .Site.Params.page.math | default dict -}}
{{- $math = .Site.Params.page.math | default dict -}}
{{- else if eq $math false -}}
{{- $math = dict "enable" false -}}
{{- $math = dict "enable" false -}}
{{- end -}}
{{- if $math.enable -}}
{{- $source := $cdn.katexCSS | default "lib/katex/katex.min.css" -}}
{{- $source := $cdn.katexCSS | default "lib/katex/katex.min.css" -}}
{{- dict "Source" $source "Fingerprint" $fingerprint | dict "Scratch" .Scratch "Data" | partial "scratch/style.html" -}}
{{- $source := $cdn.katexJS | default "lib/katex/katex.min.js" -}}
{{- dict "Source" $source "Fingerprint" $fingerprint | dict "Scratch" .Scratch "Data" | partial "scratch/script.html" -}}
{{- $source := $cdn.katexAutoRenderJS | default "lib/katex/auto-render.min.js" -}}
{{- dict "Source" $source "Fingerprint" $fingerprint | dict "Scratch" .Scratch "Data" | partial "scratch/script.html" -}}
{{- if $math.copyTex -}}
{{- $source := $cdn.katexCopyTexCSS | default "lib/katex/copy-tex.min.css" -}}
{{- dict "Source" $source "Fingerprint" $fingerprint | dict "Scratch" .Scratch "Data" | partial "scratch/style.html" -}}
{{- $source := $cdn.katexJS | default "lib/katex/katex.min.js" -}}
{{- $source := $cdn.katexCopyTexJS | default "lib/katex/copy-tex.min.js" -}}
{{- dict "Source" $source "Fingerprint" $fingerprint | dict "Scratch" .Scratch "Data" | partial "scratch/script.html" -}}
{{- $source := $cdn.katexAutoRenderJS | default "lib/katex/auto-render.min.js" -}}
{{- end -}}
{{- if $math.mhchem -}}
{{- $source := $cdn.katexMhchemJS | default "lib/katex/mhchem.min.js" -}}
{{- dict "Source" $source "Fingerprint" $fingerprint | dict "Scratch" .Scratch "Data" | partial "scratch/script.html" -}}
{{- if $math.copyTex -}}
{{- $source := $cdn.katexCopyTexCSS | default "lib/katex/copy-tex.min.css" -}}
{{- dict "Source" $source "Fingerprint" $fingerprint | dict "Scratch" .Scratch "Data" | partial "scratch/style.html" -}}
{{- $source := $cdn.katexCopyTexJS | default "lib/katex/copy-tex.min.js" -}}
{{- dict "Source" $source "Fingerprint" $fingerprint | dict "Scratch" .Scratch "Data" | partial "scratch/script.html" -}}
{{- end -}}
{{- if $math.mhchem -}}
{{- $source := $cdn.katexMhchemJS | default "lib/katex/mhchem.min.js" -}}
{{- dict "Source" $source "Fingerprint" $fingerprint | dict "Scratch" .Scratch "Data" | partial "scratch/script.html" -}}
{{- end -}}
{{- $delimiters := slice (dict "left" "$$" "right" "$$" "display" true) (dict "left" "\\[" "right" "\\]" "display" true) -}}
{{- if and $math.blockLeftDelimiter $math.blockRightDelimiter -}}
{{- $delimiters = $delimiters | append (dict "left" $math.blockLeftDelimiter "right" $math.blockRightDelimiter "display" true) -}}
{{- end -}}
{{- $delimiters = $delimiters | append (dict "left" "$" "right" "$" "display" false) (dict "left" "\\(" "right" "\\)" "display" false) -}}
{{- if and $math.inlineLeftDelimiter $math.inlineRightDelimiter -}}
{{- $delimiters = $delimiters | append (dict "left" $math.inlineRightDelimiter "right" $math.inlineRightDelimiter "display" false) -}}
{{- end -}}
{{- $config = dict "strict" false "delimiters" $delimiters | dict "math" | merge $config -}}
{{- end -}}
{{- $delimiters := slice (dict "left" "$$" "right" "$$" "display" true) (dict "left" "\\[" "right" "\\]" "display" true) -}}
{{- if and $math.blockLeftDelimiter $math.blockRightDelimiter -}}
{{- $delimiters = $delimiters | append (dict "left" $math.blockLeftDelimiter "right" $math.blockRightDelimiter "display" true) -}}
{{- end -}}
{{- $delimiters = $delimiters | append (dict "left" "$" "right" "$" "display" false) (dict "left" "\\(" "right" "\\)" "display" false) -}}
{{- if and $math.inlineLeftDelimiter $math.inlineRightDelimiter -}}
{{- $delimiters = $delimiters | append (dict "left" $math.inlineRightDelimiter "right" $math.inlineRightDelimiter "display" false) -}}
{{- end -}}
{{- $config = dict "strict" false "delimiters" $delimiters | dict "math" | merge $config -}}
{{- end -}}
{{- /* mermaid */ -}}
{{- if (.Scratch.Get "this").mermaid -}}
{{- $source := $cdn.mermaidJS | default "lib/mermaid/mermaid.min.js" -}}
{{- dict "Source" $source "Fingerprint" $fingerprint | dict "Scratch" .Scratch "Data" | partial "scratch/script.html" -}}
{{- $options := dict "targetPath" "lib/mermaid/mermaid.min.css" "enableSourceMap" true -}}
{{- dict "Source" "lib/mermaid/mermaid.scss" "ToCSS" $options "Fingerprint" $fingerprint | dict "Scratch" .Scratch "Data" | partial "scratch/style.html" -}}
{{- $source := $cdn.mermaidJS | default "lib/mermaid/mermaid.min.js" -}}
{{- dict "Source" $source "Fingerprint" $fingerprint | dict "Scratch" .Scratch "Data" | partial "scratch/script.html" -}}
{{- $options := dict "targetPath" "lib/mermaid/mermaid.min.css" "enableSourceMap" true -}}
{{- dict "Source" "lib/mermaid/mermaid.scss" "ToCSS" $options "Fingerprint" $fingerprint | dict "Scratch" .Scratch "Data" | partial "scratch/style.html" -}}
{{- end -}}
{{- /* ECharts */ -}}
{{- if (.Scratch.Get "this").echarts -}}
{{- $source := $cdn.echartsJS | default "lib/echarts/echarts.min.js" -}}
{{- dict "Source" $source "Fingerprint" $fingerprint | dict "Scratch" .Scratch "Data" | partial "scratch/script.html" -}}
{{- $source := $cdn.echartsMacaronsJS | default "lib/echarts/macarons.js" -}}
{{- dict "Source" $source "Minify" true "Fingerprint" $fingerprint | dict "Scratch" .Scratch "Data" | partial "scratch/script.html" -}}
{{- $source := $cdn.echartsJS | default "lib/echarts/echarts.min.js" -}}
{{- dict "Source" $source "Fingerprint" $fingerprint | dict "Scratch" .Scratch "Data" | partial "scratch/script.html" -}}
{{- $source := $cdn.echartsMacaronsJS | default "lib/echarts/macarons.js" -}}
{{- dict "Source" $source "Minify" true "Fingerprint" $fingerprint | dict "Scratch" .Scratch "Data" | partial "scratch/script.html" -}}
{{- end -}}
{{- /* Mapbox GL */ -}}
{{- if (.Scratch.Get "this").mapbox -}}
{{- $source := $cdn.mapboxGLCSS | default "lib/mapbox-gl/mapbox-gl.min.css" -}}
{{- dict "Source" $source "Fingerprint" $fingerprint | dict "Scratch" .Scratch "Data" | partial "scratch/style.html" -}}
{{- $source := $cdn.mapboxGLJS | default "lib/mapbox-gl/mapbox-gl.min.js" -}}
{{- dict "Source" $source "Fingerprint" $fingerprint | dict "Scratch" .Scratch "Data" | partial "scratch/script.html" -}}
{{- dict "Source" "lib/mapbox-gl/mapbox-gl-language.js" "Minify" true "Fingerprint" $fingerprint | dict "Scratch" .Scratch "Data" | partial "scratch/script.html" -}}
{{- $config = dict "accessToken" $params.mapbox.accessToken "RTLTextPlugin" "https://api.mapbox.com/mapbox-gl-js/plugins/mapbox-gl-rtl-text/v0.2.0/mapbox-gl-rtl-text.js" | dict "mapbox" | merge $config -}}
{{- $source := $cdn.mapboxGLCSS | default "lib/mapbox-gl/mapbox-gl.min.css" -}}
{{- dict "Source" $source "Fingerprint" $fingerprint | dict "Scratch" .Scratch "Data" | partial "scratch/style.html" -}}
{{- $source := $cdn.mapboxGLJS | default "lib/mapbox-gl/mapbox-gl.min.js" -}}
{{- dict "Source" $source "Fingerprint" $fingerprint | dict "Scratch" .Scratch "Data" | partial "scratch/script.html" -}}
{{- dict "Source" "lib/mapbox-gl/mapbox-gl-language.js" "Minify" true "Fingerprint" $fingerprint | dict "Scratch" .Scratch "Data" | partial "scratch/script.html" -}}
{{- $config = dict "accessToken" $params.mapbox.accessToken "RTLTextPlugin" "https://api.mapbox.com/mapbox-gl-js/plugins/mapbox-gl-rtl-text/v0.2.0/mapbox-gl-rtl-text.js" | dict "mapbox" | merge $config -}}
{{- end -}}
{{- /* Music */ -}}
{{- if (.Scratch.Get "this").music -}}
{{- /* APlayer */ -}}
{{- $source := $cdn.aplayerCSS | default "lib/aplayer/APlayer.min.css" -}}
{{- dict "Source" $source "Fingerprint" $fingerprint | dict "Scratch" .Scratch "Data" | partial "scratch/style.html" -}}
{{- $options := dict "targetPath" "lib/aplayer/dark.min.css" "enableSourceMap" true -}}
{{- dict "Source" "lib/aplayer/dark.scss" "ToCSS" $options "Fingerprint" $fingerprint | dict "Scratch" .Scratch "Data" | partial "scratch/style.html" -}}
{{- $source := $cdn.aplayerJS | default "lib/aplayer/APlayer.min.js" -}}
{{- dict "Source" $source "Fingerprint" $fingerprint | dict "Scratch" .Scratch "Data" | partial "scratch/script.html" -}}
{{- /* APlayer */ -}}
{{- $source := $cdn.aplayerCSS | default "lib/aplayer/APlayer.min.css" -}}
{{- dict "Source" $source "Fingerprint" $fingerprint | dict "Scratch" .Scratch "Data" | partial "scratch/style.html" -}}
{{- $options := dict "targetPath" "lib/aplayer/dark.min.css" "enableSourceMap" true -}}
{{- dict "Source" "lib/aplayer/dark.scss" "ToCSS" $options "Fingerprint" $fingerprint | dict "Scratch" .Scratch "Data" | partial "scratch/style.html" -}}
{{- $source := $cdn.aplayerJS | default "lib/aplayer/APlayer.min.js" -}}
{{- dict "Source" $source "Fingerprint" $fingerprint | dict "Scratch" .Scratch "Data" | partial "scratch/script.html" -}}
{{- /* MetingJS */ -}}
{{- $source := $cdn.metingJS | default "lib/meting/Meting.min.js" -}}
{{- dict "Source" $source "Fingerprint" $fingerprint | dict "Scratch" .Scratch "Data" | partial "scratch/script.html" -}}
{{- /* MetingJS */ -}}
{{- $source := $cdn.metingJS | default "lib/meting/Meting.min.js" -}}
{{- dict "Source" $source "Fingerprint" $fingerprint | dict "Scratch" .Scratch "Data" | partial "scratch/script.html" -}}
{{- end -}}
{{- /* Cookie Consent */ -}}
{{- if .Site.Params.cookieconsent | and .Site.Params.cookieconsent.enable -}}
{{- $source := $cdn.cookieconsentCSS | default "lib/cookieconsent/cookieconsent.min.css" -}}
{{- dict "Source" $source "Fingerprint" $fingerprint | dict "Scratch" .Scratch "Data" | partial "scratch/style.html" -}}
{{- $source := $cdn.cookieconsentJS | default "lib/cookieconsent/cookieconsent.min.js" -}}
{{- dict "Source" $source "Fingerprint" $fingerprint | dict "Scratch" .Scratch "Data" | partial "scratch/script.html" -}}
{{- $cookieconsentConfig := dict "popup" (dict "background" "#1aa3ff") "button" (dict "background" "#f0f0f0") | dict "theme" "edgeless" "palette" -}}
{{- $cookieconsentConfig = .Site.Params.cookieconsent | merge $cookieconsentConfig -}}
{{- $cookieconsentConfig = dict "message" ($cookieconsentConfig.content.message | default (T "cookieconsentMessage")) "dismiss" ($cookieconsentConfig.content.dismiss | default (T "cookieconsentDismiss")) "link" ($cookieconsentConfig.content.link | default (T "cookieconsentLink")) | dict "content" | merge $cookieconsentConfig -}}
{{- $config = $cookieconsentConfig | dict "cookieconsent" | merge $config -}}
{{- $source := $cdn.cookieconsentCSS | default "lib/cookieconsent/cookieconsent.min.css" -}}
{{- dict "Source" $source "Fingerprint" $fingerprint | dict "Scratch" .Scratch "Data" | partial "scratch/style.html" -}}
{{- $source := $cdn.cookieconsentJS | default "lib/cookieconsent/cookieconsent.min.js" -}}
{{- dict "Source" $source "Fingerprint" $fingerprint | dict "Scratch" .Scratch "Data" | partial "scratch/script.html" -}}
{{- $cookieconsentConfig := dict "popup" (dict "background" "#1aa3ff") "button" (dict "background" "#f0f0f0") | dict "theme" "edgeless" "palette" -}}
{{- $cookieconsentConfig = .Site.Params.cookieconsent | merge $cookieconsentConfig -}}
{{- $cookieconsentConfig = dict "message" ($cookieconsentConfig.content.message | default (T "cookieconsentMessage")) "dismiss" ($cookieconsentConfig.content.dismiss | default (T "cookieconsentDismiss")) "link" ($cookieconsentConfig.content.link | default (T "cookieconsentLink")) | dict "content" | merge $cookieconsentConfig -}}
{{- $config = $cookieconsentConfig | dict "cookieconsent" | merge $config -}}
{{- end -}}
{{- /* Watermark */ -}}
{{- if eq .Site.Params.watermark.enable true -}}
{{- $source := "lib/watermark/watermark.min.js" -}}
{{- dict "Source" $source "Fingerprint" $fingerprint | dict "Scratch" .Scratch "Data" | partial "scratch/script.html" -}}
{{- end -}}
{{- range $params.library.css -}}
{{- dict "Source" . "Fingerprint" $fingerprint | dict "Scratch" $.Scratch "Data" | partial "scratch/style.html" -}}
{{- dict "Source" . "Fingerprint" $fingerprint | dict "Scratch" $.Scratch "Data" | partial "scratch/style.html" -}}
{{- end -}}
{{- range $params.library.js -}}
{{- dict "Source" . "Fingerprint" $fingerprint | dict "Scratch" $.Scratch "Data" | partial "scratch/script.html" -}}
{{- dict "Source" . "Fingerprint" $fingerprint | dict "Scratch" $.Scratch "Data" | partial "scratch/script.html" -}}
{{- end -}}
{{- with (.Scratch.Get "this").styleArr -}}
{{- $content := delimit . "" -}}
{{- $path := substr (md5 $content) 0 6 | printf "css/%v" -}}
{{- $options := printf "%v.min.css" $path | dict "targetPath" -}}
{{- dict "Content" $content "Path" (printf "%v.scss" $path) "ToCSS" $options | dict "Scratch" $.Scratch "Data" | partial "scratch/style.html" -}}
{{- $content := delimit . "" -}}
{{- $path := substr (md5 $content) 0 6 | printf "css/%v" -}}
{{- $options := printf "%v.min.css" $path | dict "targetPath" -}}
{{- dict "Content" $content "Path" (printf "%v.scss" $path) "ToCSS" $options | dict "Scratch" $.Scratch "Data" | partial "scratch/style.html" -}}
{{- end -}}
{{- /* Config script */ -}}
@@ -189,15 +195,52 @@
{{- $_ := (resources.Get "js/theme.min.js.map").RelPermalink -}}
{{- with (.Scratch.Get "this").scriptArr -}}
{{- delimit . "\n" | dict "Content" | dict "Scratch" $.Scratch "Data" | partial "scratch/script.html" -}}
{{- delimit . "\n" | dict "Content" | dict "Scratch" $.Scratch "Data" | partial "scratch/script.html" -}}
{{- end -}}
{{- range (.Scratch.Get "this").style -}}
{{- partial "plugin/style.html" . -}}
{{- partial "plugin/style.html" . -}}
{{- end -}}
{{- range (.Scratch.Get "this").script -}}
{{- partial "plugin/script.html" . -}}
{{- partial "plugin/script.html" . -}}
{{- end -}}
{{- partial "plugin/analytics.html" . -}}
{{- /* Inline scripts */ -}}
<script type="text/javascript">
{{- /* PWA */ -}}
{{- if eq .Site.Params.enablePWA true -}}
{{- if eq hugo.Environment "production" -}}
if ('serviceWorker' in navigator) {
navigator.serviceWorker
.register('/service-worker.min.js', { scope: '/' })
.then(function (registration) {
// console.log('Service Worker Registered');
})
.catch(function (error) {
console.error('error: ', error);
});
navigator.serviceWorker.ready.then(function (registration) {
// console.log('Service Worker Ready');
});
}
{{- end -}}
{{- end -}}
{{- /* Watermark */ -}}
{{- if eq .Site.Params.watermark.enable true -}}
new Watermark({
content: {{ $.Site.Params.watermark.content }} || ' Theme FixIt',
appendTo: {{ $.Site.Params.watermark.appendTo }} || '.wrapper>.main',
opacity: {{ $.Site.Params.watermark.opacity }},
width: {{ $.Site.Params.watermark.width }},
height: {{ $.Site.Params.watermark.height }},
rowSpacing: {{ $.Site.Params.watermark.rowSpacing }},
colSpacing: {{ $.Site.Params.watermark.colSpacing }},
rotate: {{ $.Site.Params.watermark.rotate }},
fontSize: {{ $.Site.Params.watermark.fontSize }}
});
{{- end -}}
</script>
+707 -701
View File
File diff suppressed because it is too large Load Diff
+10 -2
View File
@@ -20,9 +20,11 @@ features = [
"pagination",
"social-menu",
"syntax-highlighting",
"SEO Optimized"
"SEO Optimized",
"friends link template",
"PWA support",
"watermark support"
]
min_version = "0.62.0"
[author]
name = "Lruihao"
@@ -31,3 +33,9 @@ min_version = "0.62.0"
[original]
name = "Dillon"
homepage = "https://dillonzq.com"
repo = "https://github.com/dillonzq/LoveIt"
[module]
[module.hugoVersion]
extended = true
min = "0.62.0"