feat(home): add custom content for home page (#248)
This commit is contained in:
@@ -62,8 +62,8 @@ I hope you will LoveIt ❤️!
|
|||||||
|
|
||||||
* Optimized for **performance**: 99/100 on mobile and 100/100 on desktop in [Google PageSpeed Insights](https://developers.google.com/speed/pagespeed/insights)
|
* Optimized for **performance**: 99/100 on mobile and 100/100 on desktop in [Google PageSpeed Insights](https://developers.google.com/speed/pagespeed/insights)
|
||||||
* Optimized SEO performance with a correct **SEO SCHEMA** based on JSON-LD
|
* Optimized SEO performance with a correct **SEO SCHEMA** based on JSON-LD
|
||||||
* [**Google Analytics**](https://analytics.google.com/analytics) supported
|
* **[Google Analytics](https://analytics.google.com/analytics)** supported
|
||||||
* [**Fathom Analytics**](https://usefathom.com/) supported
|
* **[Fathom Analytics](https://usefathom.com/)** supported
|
||||||
* Search engine **verification** supported (Google, Bind, Yandex and Baidu)
|
* Search engine **verification** supported (Google, Bind, Yandex and Baidu)
|
||||||
* **CDN** for third-party libraries supported
|
* **CDN** for third-party libraries supported
|
||||||
* Automatically converted images with **Lazy Load** by [lazysizes](https://github.com/aFarkas/lazysizes)
|
* Automatically converted images with **Lazy Load** by [lazysizes](https://github.com/aFarkas/lazysizes)
|
||||||
@@ -136,7 +136,7 @@ All feedback is welcome! Head over to the [issue tracker](https://github.com/dil
|
|||||||
|
|
||||||
## License
|
## License
|
||||||
|
|
||||||
LoveIt is licensed under the MIT license. Check the [LICENSE file](https://github.com/dillonzq/LoveIt/blob/master/LICENSE) for details.
|
LoveIt is licensed under the **MIT** license. Check the [LICENSE file](https://github.com/dillonzq/LoveIt/blob/master/LICENSE) for details.
|
||||||
|
|
||||||
Thanks to the authors of following resources included in the theme:
|
Thanks to the authors of following resources included in the theme:
|
||||||
|
|
||||||
|
|||||||
@@ -58,6 +58,7 @@
|
|||||||
* **性能**优化:在 [Google PageSpeed Insights](https://developers.google.com/speed/pagespeed/insights) 中, 99/100 的移动设备得分和 100/100 的桌面设备得分
|
* **性能**优化:在 [Google PageSpeed Insights](https://developers.google.com/speed/pagespeed/insights) 中, 99/100 的移动设备得分和 100/100 的桌面设备得分
|
||||||
* 使用基于 JSON-LD 格式 的 **SEO SCHEMA** 文件进行 SEO 优化
|
* 使用基于 JSON-LD 格式 的 **SEO SCHEMA** 文件进行 SEO 优化
|
||||||
* 支持 **[Google Analytics](https://analytics.google.com/analytics)**
|
* 支持 **[Google Analytics](https://analytics.google.com/analytics)**
|
||||||
|
* 支持 **[Fathom Analytics](https://usefathom.com/)**
|
||||||
* 支持搜索引擎的**网站验证** (Google, Bind, Yandex and Baidu)
|
* 支持搜索引擎的**网站验证** (Google, Bind, Yandex and Baidu)
|
||||||
* 支持所有第三方库的 **CDN**
|
* 支持所有第三方库的 **CDN**
|
||||||
* 基于 [lazysizes](https://github.com/aFarkas/lazysizes) 自动转换图片为**懒加载**
|
* 基于 [lazysizes](https://github.com/aFarkas/lazysizes) 自动转换图片为**懒加载**
|
||||||
@@ -130,7 +131,7 @@ LoveIt 支持下列语言:
|
|||||||
|
|
||||||
## 许可协议
|
## 许可协议
|
||||||
|
|
||||||
LoveIt 根据 MIT 许可协议授权。 更多信息请查看 [LICENSE 文件](https://github.com/dillonzq/LoveIt/blob/master/LICENSE)。
|
LoveIt 根据 **MIT** 许可协议授权。 更多信息请查看 [LICENSE 文件](https://github.com/dillonzq/LoveIt/blob/master/LICENSE)。
|
||||||
|
|
||||||
LoveIt 主题中用到了以下项目,感谢它们的作者:
|
LoveIt 主题中用到了以下项目,感谢它们的作者:
|
||||||
|
|
||||||
|
|||||||
2
assets/js/theme.min.js
vendored
2
assets/js/theme.min.js
vendored
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -537,6 +537,7 @@ enableEmoji = true
|
|||||||
# date format
|
# date format
|
||||||
# 日期格式
|
# 日期格式
|
||||||
dateFormat = "2006-01-02"
|
dateFormat = "2006-01-02"
|
||||||
|
|
||||||
# Header config
|
# Header config
|
||||||
# 页面头部导航栏配置
|
# 页面头部导航栏配置
|
||||||
[params.header]
|
[params.header]
|
||||||
@@ -546,6 +547,7 @@ enableEmoji = true
|
|||||||
# mobile header mode ("fixed", "normal", "auto")
|
# mobile header mode ("fixed", "normal", "auto")
|
||||||
# 移动端导航栏模式 ("fixed", "normal", "auto")
|
# 移动端导航栏模式 ("fixed", "normal", "auto")
|
||||||
mobileMode = "auto"
|
mobileMode = "auto"
|
||||||
|
|
||||||
# Footer config
|
# Footer config
|
||||||
# 页面底部信息配置
|
# 页面底部信息配置
|
||||||
[params.footer]
|
[params.footer]
|
||||||
@@ -571,6 +573,7 @@ enableEmoji = true
|
|||||||
# license info (HTML format is supported)
|
# license info (HTML format is supported)
|
||||||
# 许可协议信息 (支持 HTML 格式)
|
# 许可协议信息 (支持 HTML 格式)
|
||||||
license= '<a rel="license external nofollow noopener noreffer" href="https://creativecommons.org/licenses/by-nc/4.0/" target="_blank">CC BY-NC 4.0</a>'
|
license= '<a rel="license external nofollow noopener noreffer" href="https://creativecommons.org/licenses/by-nc/4.0/" target="_blank">CC BY-NC 4.0</a>'
|
||||||
|
|
||||||
# Section (all posts) page config
|
# Section (all posts) page config
|
||||||
# Section (所有文章) 页面配置
|
# Section (所有文章) 页面配置
|
||||||
[params.section]
|
[params.section]
|
||||||
@@ -580,6 +583,7 @@ enableEmoji = true
|
|||||||
# date format (month and day)
|
# date format (month and day)
|
||||||
# 日期格式 (月和日)
|
# 日期格式 (月和日)
|
||||||
dateFormat = "01-02"
|
dateFormat = "01-02"
|
||||||
|
|
||||||
# List (category or tag) page config
|
# List (category or tag) page config
|
||||||
# List (目录或标签) 页面配置
|
# List (目录或标签) 页面配置
|
||||||
[params.list]
|
[params.list]
|
||||||
@@ -589,6 +593,7 @@ enableEmoji = true
|
|||||||
# date format (month and day)
|
# date format (month and day)
|
||||||
# 日期格式 (月和日)
|
# 日期格式 (月和日)
|
||||||
dateFormat = "01-02"
|
dateFormat = "01-02"
|
||||||
|
|
||||||
# Page config
|
# Page config
|
||||||
# 文章页面配置
|
# 文章页面配置
|
||||||
[params.page]
|
[params.page]
|
||||||
@@ -774,7 +779,8 @@ enableEmoji = true
|
|||||||
url = "cover.png"
|
url = "cover.png"
|
||||||
width = 800
|
width = 800
|
||||||
height = 600
|
height = 600
|
||||||
# site verification code for Google/Bing/Yandex/Pinterest/Baidu
|
|
||||||
|
# Site verification code for Google/Bing/Yandex/Pinterest/Baidu
|
||||||
# 网站验证代码,用于 Google/Bing/Yandex/Pinterest/Baidu
|
# 网站验证代码,用于 Google/Bing/Yandex/Pinterest/Baidu
|
||||||
[params.verification]
|
[params.verification]
|
||||||
google = ""
|
google = ""
|
||||||
@@ -782,10 +788,26 @@ enableEmoji = true
|
|||||||
yandex = ""
|
yandex = ""
|
||||||
pinterest = ""
|
pinterest = ""
|
||||||
baidu = ""
|
baidu = ""
|
||||||
[params.fathomAnalytics]
|
|
||||||
# siteID = "ABC123"
|
# Analytics config
|
||||||
# If you're self hosting use this for your tracker
|
# 网站分析配置
|
||||||
# serverURL = "https://example.com"
|
[params.analytics]
|
||||||
|
enable = false
|
||||||
|
# Google Analytics
|
||||||
|
[params.analytics.google]
|
||||||
|
id = ""
|
||||||
|
# whether to anonymize IP
|
||||||
|
# 是否匿名化用户 IP
|
||||||
|
anonymizeIP = true
|
||||||
|
# whether to use cookie
|
||||||
|
# 是否使用 cookie
|
||||||
|
cookie = false
|
||||||
|
# Fathom Analytics
|
||||||
|
[params.analytics.fathom]
|
||||||
|
id = ""
|
||||||
|
# server url for your tracker if you're self hosting
|
||||||
|
# 自行托管追踪器时的主机路径
|
||||||
|
server = ""
|
||||||
|
|
||||||
# CSS and JS Files CDN
|
# CSS and JS Files CDN
|
||||||
# CSS 和 JS 文件的 CDN 设置
|
# CSS 和 JS 文件的 CDN 设置
|
||||||
@@ -899,8 +921,12 @@ enableEmoji = true
|
|||||||
# Privacy config (https://gohugo.io/about/hugo-and-gdpr/)
|
# Privacy config (https://gohugo.io/about/hugo-and-gdpr/)
|
||||||
# 隐私信息配置 (https://gohugo.io/about/hugo-and-gdpr/)
|
# 隐私信息配置 (https://gohugo.io/about/hugo-and-gdpr/)
|
||||||
[privacy]
|
[privacy]
|
||||||
|
# privacy of the Google Analytics (replaced by params.analytics.google)
|
||||||
|
# Google Analytics 相关隐私 (被 params.analytics.google 替代)
|
||||||
[privacy.googleAnalytics]
|
[privacy.googleAnalytics]
|
||||||
anonymizeIP = true
|
# ...
|
||||||
|
[privacy.twitter]
|
||||||
|
enableDNT = true
|
||||||
[privacy.youtube]
|
[privacy.youtube]
|
||||||
privacyEnhanced = true
|
privacyEnhanced = true
|
||||||
|
|
||||||
|
|||||||
@@ -26,7 +26,8 @@ It is based on the original [LeaveIt Theme](https://github.com/liuzc/LeaveIt/) a
|
|||||||
|
|
||||||
* :(fas fa-rocket): Optimized for **performance**: [99]/[100] on mobile and [100]/[100] on desktop in [Google PageSpeed Insights](https://developers.google.com/speed/pagespeed/insights)
|
* :(fas fa-rocket): Optimized for **performance**: [99]/[100] on mobile and [100]/[100] on desktop in [Google PageSpeed Insights](https://developers.google.com/speed/pagespeed/insights)
|
||||||
* :(fab fa-searchengin): Optimized SEO performance with a correct **SEO SCHEMA** based on JSON-LD
|
* :(fab fa-searchengin): Optimized SEO performance with a correct **SEO SCHEMA** based on JSON-LD
|
||||||
* :(fab fa-google): [**Google Analytics**](https://analytics.google.com/analytics) supported
|
* :(fab fa-google): **[Google Analytics](https://analytics.google.com/analytics)** supported
|
||||||
|
* :(far fa-chart-bar): **[Fathom Analytics](https://usefathom.com/)** supported
|
||||||
* :(fas fa-search): Search engine **verification** supported (Google, Bind, Yandex and Baidu)
|
* :(fas fa-search): Search engine **verification** supported (Google, Bind, Yandex and Baidu)
|
||||||
* :(fas fa-tachometer-alt): **CDN** for third-party libraries supported
|
* :(fas fa-tachometer-alt): **CDN** for third-party libraries supported
|
||||||
* :(fas fa-cloud-download-alt): Automatically converted images with **Lazy Load** by [lazysizes](https://github.com/aFarkas/lazysizes)
|
* :(fas fa-cloud-download-alt): Automatically converted images with **Lazy Load** by [lazysizes](https://github.com/aFarkas/lazysizes)
|
||||||
@@ -76,7 +77,7 @@ It is based on the original [LeaveIt Theme](https://github.com/liuzc/LeaveIt/) a
|
|||||||
|
|
||||||
### License
|
### License
|
||||||
|
|
||||||
LoveIt is licensed under the MIT license.
|
LoveIt is licensed under the **MIT** license.
|
||||||
|
|
||||||
Check the [LICENSE file](https://github.com/dillonzq/LoveIt/blob/master/LICENSE) for details.
|
Check the [LICENSE file](https://github.com/dillonzq/LoveIt/blob/master/LICENSE) for details.
|
||||||
|
|
||||||
|
|||||||
@@ -31,7 +31,8 @@ It is based on the original [LeaveIt Theme](https://github.com/liuzc/LeaveIt/) a
|
|||||||
|
|
||||||
* :(fas fa-rocket): Optimized for **performance**: [99]/[100] on mobile and [100]/[100] on desktop in [Google PageSpeed Insights](https://developers.google.com/speed/pagespeed/insights)
|
* :(fas fa-rocket): Optimized for **performance**: [99]/[100] on mobile and [100]/[100] on desktop in [Google PageSpeed Insights](https://developers.google.com/speed/pagespeed/insights)
|
||||||
* :(fab fa-searchengin): Optimized SEO performance with a correct **SEO SCHEMA** based on JSON-LD
|
* :(fab fa-searchengin): Optimized SEO performance with a correct **SEO SCHEMA** based on JSON-LD
|
||||||
* :(fab fa-google): [**Google Analytics**](https://analytics.google.com/analytics) supported
|
* :(fab fa-google): **[Google Analytics](https://analytics.google.com/analytics)** supported
|
||||||
|
* :(far fa-chart-bar): **[Fathom Analytics](https://usefathom.com/)** supported
|
||||||
* :(fas fa-search): Search engine **verification** supported (Google, Bind, Yandex and Baidu)
|
* :(fas fa-search): Search engine **verification** supported (Google, Bind, Yandex and Baidu)
|
||||||
* :(fas fa-tachometer-alt): **CDN** for third-party libraries supported
|
* :(fas fa-tachometer-alt): **CDN** for third-party libraries supported
|
||||||
* :(fas fa-cloud-download-alt): Automatically converted images with **Lazy Load** by [lazysizes](https://github.com/aFarkas/lazysizes)
|
* :(fas fa-cloud-download-alt): Automatically converted images with **Lazy Load** by [lazysizes](https://github.com/aFarkas/lazysizes)
|
||||||
@@ -81,7 +82,7 @@ It is based on the original [LeaveIt Theme](https://github.com/liuzc/LeaveIt/) a
|
|||||||
|
|
||||||
### License
|
### License
|
||||||
|
|
||||||
LoveIt is licensed under the MIT license.
|
LoveIt is licensed under the **MIT** license.
|
||||||
|
|
||||||
Check the [LICENSE file](https://github.com/dillonzq/LoveIt/blob/master/LICENSE) for details.
|
Check the [LICENSE file](https://github.com/dillonzq/LoveIt/blob/master/LICENSE) for details.
|
||||||
|
|
||||||
|
|||||||
@@ -27,6 +27,7 @@ lightgallery: true
|
|||||||
* :(fas fa-rocket): **性能**优化:在 [Google PageSpeed Insights](https://developers.google.com/speed/pagespeed/insights) 中, [99]/[100] 的移动设备得分和 [100]/[100] 的桌面设备得分
|
* :(fas fa-rocket): **性能**优化:在 [Google PageSpeed Insights](https://developers.google.com/speed/pagespeed/insights) 中, [99]/[100] 的移动设备得分和 [100]/[100] 的桌面设备得分
|
||||||
* :(fab fa-searchengin): 使用基于 JSON-LD 格式 的 **SEO SCHEMA** 文件进行 SEO 优化
|
* :(fab fa-searchengin): 使用基于 JSON-LD 格式 的 **SEO SCHEMA** 文件进行 SEO 优化
|
||||||
* :(fab fa-google): 支持 **[Google Analytics](https://analytics.google.com/analytics)**
|
* :(fab fa-google): 支持 **[Google Analytics](https://analytics.google.com/analytics)**
|
||||||
|
* :(far fa-chart-bar): 支持 **[Fathom Analytics](https://usefathom.com/)**
|
||||||
* :(fas fa-search): 支持搜索引擎的**网站验证** (Google, Bind, Yandex and Baidu)
|
* :(fas fa-search): 支持搜索引擎的**网站验证** (Google, Bind, Yandex and Baidu)
|
||||||
* :(fas fa-tachometer-alt): 支持所有第三方库的 **CDN**
|
* :(fas fa-tachometer-alt): 支持所有第三方库的 **CDN**
|
||||||
* :(fas fa-cloud-download-alt): 基于 [lazysizes](https://github.com/aFarkas/lazysizes) 自动转换图片为**懒加载**
|
* :(fas fa-cloud-download-alt): 基于 [lazysizes](https://github.com/aFarkas/lazysizes) 自动转换图片为**懒加载**
|
||||||
@@ -76,7 +77,7 @@ lightgallery: true
|
|||||||
|
|
||||||
### 许可协议
|
### 许可协议
|
||||||
|
|
||||||
LoveIt 根据 MIT 许可协议授权。
|
LoveIt 根据 **MIT** 许可协议授权。
|
||||||
|
|
||||||
更多信息请查看 [LICENSE 文件](https://github.com/dillonzq/LoveIt/blob/master/LICENSE)。
|
更多信息请查看 [LICENSE 文件](https://github.com/dillonzq/LoveIt/blob/master/LICENSE)。
|
||||||
|
|
||||||
|
|||||||
@@ -503,6 +503,22 @@ Note that some of these parameters are explained in details in other sections of
|
|||||||
pinterest = ""
|
pinterest = ""
|
||||||
baidu = ""
|
baidu = ""
|
||||||
|
|
||||||
|
# {{< version 0.2.0 >}} Analytics config
|
||||||
|
[params.analytics]
|
||||||
|
enable = false
|
||||||
|
# Google Analytics
|
||||||
|
[params.analytics.google]
|
||||||
|
id = ""
|
||||||
|
# whether to anonymize IP
|
||||||
|
anonymizeIP = true
|
||||||
|
# whether to use cookie
|
||||||
|
cookie = false
|
||||||
|
# Fathom Analytics
|
||||||
|
[params.analytics.fathom]
|
||||||
|
id = ""
|
||||||
|
# server url for your tracker if you're self hosting
|
||||||
|
server = ""
|
||||||
|
|
||||||
# CSS and JS Files CDN config
|
# CSS and JS Files CDN config
|
||||||
[params.cdn]
|
[params.cdn]
|
||||||
# {{< version 0.2.0 >}} {{< link "https://github.com/necolas/normalize.css" "normalize.css" >}}@8.0.1
|
# {{< version 0.2.0 >}} {{< link "https://github.com/necolas/normalize.css" "normalize.css" >}}@8.0.1
|
||||||
@@ -605,8 +621,11 @@ Note that some of these parameters are explained in details in other sections of
|
|||||||
|
|
||||||
# {{< link "https://gohugo.io/about/hugo-and-gdpr/" "Privacy config" >}}
|
# {{< link "https://gohugo.io/about/hugo-and-gdpr/" "Privacy config" >}}
|
||||||
[privacy]
|
[privacy]
|
||||||
|
# {{< version 0.2.0 deleted >}} privacy of the Google Analytics (replaced by params.analytics.google)
|
||||||
[privacy.googleAnalytics]
|
[privacy.googleAnalytics]
|
||||||
anonymizeIP = true
|
# ...
|
||||||
|
[privacy.twitter]
|
||||||
|
enableDNT = true
|
||||||
[privacy.youtube]
|
[privacy.youtube]
|
||||||
privacyEnhanced = true
|
privacyEnhanced = true
|
||||||
|
|
||||||
|
|||||||
@@ -508,6 +508,22 @@ Note that some of these parameters are explained in details in other sections of
|
|||||||
pinterest = ""
|
pinterest = ""
|
||||||
baidu = ""
|
baidu = ""
|
||||||
|
|
||||||
|
# {{< version 0.2.0 >}} Analytics config
|
||||||
|
[params.analytics]
|
||||||
|
enable = false
|
||||||
|
# Google Analytics
|
||||||
|
[params.analytics.google]
|
||||||
|
id = ""
|
||||||
|
# whether to anonymize IP
|
||||||
|
anonymizeIP = true
|
||||||
|
# whether to use cookie
|
||||||
|
cookie = false
|
||||||
|
# Fathom Analytics
|
||||||
|
[params.analytics.fathom]
|
||||||
|
id = ""
|
||||||
|
# server url for your tracker if you're self hosting
|
||||||
|
server = ""
|
||||||
|
|
||||||
# CSS and JS Files CDN config
|
# CSS and JS Files CDN config
|
||||||
[params.cdn]
|
[params.cdn]
|
||||||
# {{< version 0.2.0 >}} {{< link "https://github.com/necolas/normalize.css" "normalize.css" >}}@8.0.1
|
# {{< version 0.2.0 >}} {{< link "https://github.com/necolas/normalize.css" "normalize.css" >}}@8.0.1
|
||||||
@@ -610,8 +626,11 @@ Note that some of these parameters are explained in details in other sections of
|
|||||||
|
|
||||||
# {{< link "https://gohugo.io/about/hugo-and-gdpr/" "Privacy config" >}}
|
# {{< link "https://gohugo.io/about/hugo-and-gdpr/" "Privacy config" >}}
|
||||||
[privacy]
|
[privacy]
|
||||||
|
# {{< version 0.2.0 deleted >}} privacy of the Google Analytics (replaced by params.analytics.google)
|
||||||
[privacy.googleAnalytics]
|
[privacy.googleAnalytics]
|
||||||
anonymizeIP = true
|
# ...
|
||||||
|
[privacy.twitter]
|
||||||
|
enableDNT = true
|
||||||
[privacy.youtube]
|
[privacy.youtube]
|
||||||
privacyEnhanced = true
|
privacyEnhanced = true
|
||||||
|
|
||||||
|
|||||||
@@ -506,6 +506,22 @@ hugo
|
|||||||
pinterest = ""
|
pinterest = ""
|
||||||
baidu = ""
|
baidu = ""
|
||||||
|
|
||||||
|
# {{< version 0.2.0 >}} 网站分析配置
|
||||||
|
[params.analytics]
|
||||||
|
enable = false
|
||||||
|
# Google Analytics
|
||||||
|
[params.analytics.google]
|
||||||
|
id = ""
|
||||||
|
# 是否匿名化用户 IP
|
||||||
|
anonymizeIP = true
|
||||||
|
# 是否使用 cookie
|
||||||
|
cookie = false
|
||||||
|
# Fathom Analytics
|
||||||
|
[params.analytics.fathom]
|
||||||
|
id = ""
|
||||||
|
# 自行托管追踪器时的主机路径
|
||||||
|
server = ""
|
||||||
|
|
||||||
# CSS 和 JS 文件的 CDN 设置
|
# CSS 和 JS 文件的 CDN 设置
|
||||||
[params.cdn]
|
[params.cdn]
|
||||||
# {{< version 0.2.0 >}} {{< link "https://github.com/necolas/normalize.css" "normalize.css" >}}@8.0.1
|
# {{< version 0.2.0 >}} {{< link "https://github.com/necolas/normalize.css" "normalize.css" >}}@8.0.1
|
||||||
@@ -608,8 +624,11 @@ hugo
|
|||||||
|
|
||||||
# {{< link "https://gohugo.io/about/hugo-and-gdpr/" "隐私信息配置" >}}
|
# {{< link "https://gohugo.io/about/hugo-and-gdpr/" "隐私信息配置" >}}
|
||||||
[privacy]
|
[privacy]
|
||||||
|
# {{< version 0.2.0 deleted >}} Google Analytics 相关隐私 (被 params.analytics.google 替代)
|
||||||
[privacy.googleAnalytics]
|
[privacy.googleAnalytics]
|
||||||
anonymizeIP = true
|
# ...
|
||||||
|
[privacy.twitter]
|
||||||
|
enableDNT = true
|
||||||
[privacy.youtube]
|
[privacy.youtube]
|
||||||
privacyEnhanced = true
|
privacyEnhanced = true
|
||||||
|
|
||||||
|
|||||||
@@ -13,8 +13,8 @@
|
|||||||
{{- if eq hugo.Environment "production" -}}
|
{{- if eq hugo.Environment "production" -}}
|
||||||
{{- .Scratch.Set "cdn" .Site.Params.cdn -}}
|
{{- .Scratch.Set "cdn" .Site.Params.cdn -}}
|
||||||
{{- .Scratch.Set "fingerprint" .Site.Params.fingerprint -}}
|
{{- .Scratch.Set "fingerprint" .Site.Params.fingerprint -}}
|
||||||
{{- else -}}
|
{{- .Scratch.Set "analytics" .Site.Params.analytics -}}
|
||||||
{{- $params = dict "comment" nil | merge $params -}}
|
{{- .Scratch.Set "comment" $params.comment -}}
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
|
|
||||||
{{- .Scratch.Set "params" $params -}}
|
{{- .Scratch.Set "params" $params -}}
|
||||||
|
|||||||
@@ -1,10 +1,20 @@
|
|||||||
{{- define "content" -}}
|
{{- define "content" -}}
|
||||||
|
{{- $params := .Scratch.Get "params" -}}
|
||||||
<div class="page home">
|
<div class="page home">
|
||||||
{{- /* Profile */ -}}
|
{{- /* Profile */ -}}
|
||||||
{{- if ne .Site.Params.home.profile.enable false -}}
|
{{- if ne .Site.Params.home.profile.enable false -}}
|
||||||
{{- partial "home/profile.html" . -}}
|
{{- partial "home/profile.html" . -}}
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
|
|
||||||
|
{{- /* Content */ -}}
|
||||||
|
{{- if .Content -}}
|
||||||
|
<div class="single">
|
||||||
|
<div class="content" id="content">
|
||||||
|
{{- dict "content" .Content "ruby" $params.ruby "fraction" $params.fraction "fontawesome" $params.fontawesome | partial "function/content.html" | safeHTML -}}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
{{- /* Posts */ -}}
|
{{- /* Posts */ -}}
|
||||||
{{- if ne .Site.Params.home.posts.enable false -}}
|
{{- if ne .Site.Params.home.posts.enable false -}}
|
||||||
{{- /* Paginate */ -}}
|
{{- /* Paginate */ -}}
|
||||||
|
|||||||
@@ -261,11 +261,6 @@
|
|||||||
{{- partial "plugin/script.html" . -}}
|
{{- partial "plugin/script.html" . -}}
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
|
|
||||||
{{- /* Google analytics async */ -}}
|
{{- with .Scratch.Get "analytics" -}}
|
||||||
{{- if eq hugo.Environment "production" | and .Site.GoogleAnalytics -}}
|
{{- partial "plugin/analytics.html" . -}}
|
||||||
{{- template "_internal/google_analytics_async.html" . -}}
|
{{- end -}}
|
||||||
|
|
||||||
{{ if and .Site.Params.fathomAnalytics .Site.Params.fathomAnalytics.siteID }}
|
|
||||||
{{- partial "plugin/analytics/fathom" . -}}
|
|
||||||
{{ end }}
|
|
||||||
{{- end -}}
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{{- $cdn := .Scratch.Get "cdn" | default dict -}}
|
{{- $cdn := .Scratch.Get "cdn" | default dict -}}
|
||||||
{{- $fingerprint := .Scratch.Get "fingerprint" -}}
|
{{- $fingerprint := .Scratch.Get "fingerprint" -}}
|
||||||
{{- $comment := (.Scratch.Get "params").comment | default dict -}}
|
{{- $comment := .Scratch.Get "comment" | default dict -}}
|
||||||
{{- $commentConfig := dict -}}
|
{{- $commentConfig := dict -}}
|
||||||
|
|
||||||
{{- if $comment.enable -}}
|
{{- if $comment.enable -}}
|
||||||
|
|||||||
22
layouts/partials/plugin/analytics.html
Normal file
22
layouts/partials/plugin/analytics.html
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
{{- if .enable -}}
|
||||||
|
{{- /* Google Analytics */ -}}
|
||||||
|
{{- with .google.id -}}
|
||||||
|
<script type="text/javascript">
|
||||||
|
window.ga=window.ga||function(){(ga.q=ga.q||[]).push(arguments)};ga.l=+new Date;
|
||||||
|
ga('create', '{{ . }}', {{- if $.google.cookie }}'auto'{{ else }}{ 'storage': 'none' }{{ end }});
|
||||||
|
{{- if $.google.anonymizeIP }}ga('set', 'anonymizeIp', true);{{ end -}}
|
||||||
|
ga('send', 'pageview');
|
||||||
|
</script>
|
||||||
|
{{- dict "source" "https://www.google-analytics.com/analytics.js" "async" true | partial "plugin/script.html" -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{- /* Fathom Analytics */ -}}
|
||||||
|
{{- with .fathom.id -}}
|
||||||
|
<script type="text/javascript">
|
||||||
|
window.fathom=window.fathom||function(){(fathom.q=fathom.q||[]).push(arguments)};
|
||||||
|
fathom('set', 'siteId', '{{ . }}');
|
||||||
|
fathom('trackPageview');
|
||||||
|
</script>
|
||||||
|
{{- dict "source" ($.fathom.server | default "cdn.usefathom.com" | printf "https://%s/tracker.js") "async" true "attr" "id=fathom-script" | partial "plugin/script.html" -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
@@ -1,13 +0,0 @@
|
|||||||
<script>
|
|
||||||
(function(f, a, t, h, o, m){
|
|
||||||
a[h]=a[h]||function(){
|
|
||||||
(a[h].q=a[h].q||[]).push(arguments)
|
|
||||||
};
|
|
||||||
o=f.createElement('script'),
|
|
||||||
m=f.getElementsByTagName('script')[0];
|
|
||||||
o.async=1; o.src=t; o.id='fathom-script';
|
|
||||||
m.parentNode.insertBefore(o,m)
|
|
||||||
})(document, window, '//{{ .Site.Params.fathomAnalytics.serverURL | default "cdn.usefathom.com" }}/tracker.js', 'fathom');
|
|
||||||
fathom('set', 'siteId', '{{ .Site.Params.fathomAnalytics.siteID }}');
|
|
||||||
fathom('trackPageview');
|
|
||||||
</script>
|
|
||||||
@@ -3,7 +3,7 @@
|
|||||||
{{- else -}}
|
{{- else -}}
|
||||||
{{- $src := .source -}}
|
{{- $src := .source -}}
|
||||||
{{- $integrity := .integrity -}}
|
{{- $integrity := .integrity -}}
|
||||||
{{- if strings.HasPrefix $src "http" | not -}}
|
{{- if strings.HasPrefix $src "http" | or (strings.HasPrefix $src "||") | not -}}
|
||||||
{{- $res := resources.Get $src -}}
|
{{- $res := resources.Get $src -}}
|
||||||
{{- with .template -}}
|
{{- with .template -}}
|
||||||
{{- $res = $res | resources.ExecuteAsTemplate . $.context -}}
|
{{- $res = $res | resources.ExecuteAsTemplate . $.context -}}
|
||||||
|
|||||||
@@ -48,7 +48,7 @@
|
|||||||
<i class="far fa-calendar-alt fa-fw"></i><time datetime={{ $publish_date }}>{{ $publish_date }}</time>
|
<i class="far fa-calendar-alt fa-fw"></i><time datetime={{ $publish_date }}>{{ $publish_date }}</time>
|
||||||
<i class="fas fa-pencil-alt fa-fw"></i>{{ T "wordCount" .WordCount }}
|
<i class="fas fa-pencil-alt fa-fw"></i>{{ T "wordCount" .WordCount }}
|
||||||
<i class="far fa-clock fa-fw"></i>{{ T "readingTime" .ReadingTime }}
|
<i class="far fa-clock fa-fw"></i>{{ T "readingTime" .ReadingTime }}
|
||||||
{{- $comment := $params.comment | default dict -}}
|
{{- $comment := .Scratch.Get "comment" | default dict -}}
|
||||||
{{- if $comment.enable | and $comment.valine.enable | and $comment.valine.visitor -}}
|
{{- if $comment.enable | and $comment.valine.enable | and $comment.valine.visitor -}}
|
||||||
<span id="{{ .RelPermalink | relURL }}" class="leancloud_visitors" data-flag-title="{{ .Title }}">
|
<span id="{{ .RelPermalink | relURL }}" class="leancloud_visitors" data-flag-title="{{ .Title }}">
|
||||||
<i class="far fa-eye fa-fw"></i><span class=leancloud-visitors-count></span> {{ T "views" }}
|
<i class="far fa-eye fa-fw"></i><span class=leancloud-visitors-count></span> {{ T "views" }}
|
||||||
|
|||||||
@@ -325,7 +325,7 @@ class Theme {
|
|||||||
|
|
||||||
initHeaderLink() {
|
initHeaderLink() {
|
||||||
for (let num = 1; num <= 6; num++) {
|
for (let num = 1; num <= 6; num++) {
|
||||||
this.util.forEach(document.querySelectorAll('.page.single .content > h' + num), $header => {
|
this.util.forEach(document.querySelectorAll('.single .content > h' + num), $header => {
|
||||||
$header.classList.add('headerLink');
|
$header.classList.add('headerLink');
|
||||||
$header.innerHTML = `<a href="#${$header.id}" class="header-mark"></a>${$header.innerHTML}`;
|
$header.innerHTML = `<a href="#${$header.id}" class="header-mark"></a>${$header.innerHTML}`;
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user