mirror of
https://github.com/dillonzq/LoveIt.git
synced 2025-01-11 12:41:39 +01:00
feat: improve configuration (#245)
* feat: improve configuration * fix: fix partials/footer.html error
This commit is contained in:
parent
8a0e61085c
commit
f14301c395
62 changed files with 1548 additions and 1669 deletions
|
@ -7,32 +7,22 @@ draft: true
|
|||
author: ""
|
||||
authorLink: ""
|
||||
description: ""
|
||||
license: ""
|
||||
|
||||
tags: []
|
||||
categories: []
|
||||
|
||||
hiddenFromHomePage: false
|
||||
hiddenFromSearch: false
|
||||
|
||||
featuredImage: ""
|
||||
featuredImagePreview: ""
|
||||
|
||||
toc: false
|
||||
autoCollapseToc: true
|
||||
math: false
|
||||
mapbox:
|
||||
accessToken: ""
|
||||
lightStyle: ""
|
||||
darkStyle: ""
|
||||
navigation: true
|
||||
geolocate: true
|
||||
scale: true
|
||||
fullscreen: true
|
||||
lightgallery: true
|
||||
linkToMarkdown: true
|
||||
share:
|
||||
toc:
|
||||
enable: true
|
||||
comment: true
|
||||
math:
|
||||
enable: false
|
||||
lightgallery: false
|
||||
license: ""
|
||||
---
|
||||
|
||||
<!--more-->
|
||||
|
|
|
@ -5,10 +5,10 @@ footer {
|
|||
line-height: 1.5rem;
|
||||
padding-top: 2rem;
|
||||
|
||||
.copyright {
|
||||
.footer-container {
|
||||
font-size: .875rem;
|
||||
|
||||
.copyright-line {
|
||||
.footer-line {
|
||||
width: 100%;
|
||||
|
||||
.icp-br {
|
||||
|
|
|
@ -4,8 +4,8 @@ code {
|
|||
color: $code-color;
|
||||
|
||||
img, .version img {
|
||||
min-height: 1.1 * $code-font-size;
|
||||
height: 1.1 * $code-font-size;
|
||||
min-height: 1.2 * $code-font-size;
|
||||
height: 1.2 * $code-font-size;
|
||||
}
|
||||
|
||||
.dark & {
|
||||
|
@ -25,7 +25,7 @@ pre {
|
|||
|
||||
.copy-button {
|
||||
font-size: $code-font-size;
|
||||
line-height: $code-font-size;
|
||||
line-height: 1.4 * $code-font-size;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
right: 0;
|
||||
|
@ -129,7 +129,7 @@ code, pre, .highlight table, .highlight tr, .highlight td {
|
|||
.highlight {
|
||||
font-family: $code-font-family;
|
||||
font-size: $code-font-size;
|
||||
line-height: round($code-font-size * 1.4);
|
||||
line-height: 1.4 * $code-font-size;
|
||||
/* Comment */ .c,
|
||||
/* CommentHashbang */ .ch,
|
||||
/* CommentMultiline */ .cm,
|
||||
|
|
|
@ -127,7 +127,7 @@ $code-info-color-dark: #b1b0b0 !default;
|
|||
$code-font-size: .875rem !default;
|
||||
|
||||
// Font family of the code
|
||||
$code-font-family: Source Code Pro, Menlo, Consolas, Monaco, monospace !default;
|
||||
$code-font-family: Source Code Pro, Menlo, Consolas, Monaco, monospace, $global-font-family !default;
|
||||
|
||||
// Code type map
|
||||
$code-type-map: (
|
||||
|
|
4
assets/js/theme.min.js
vendored
4
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
|
@ -1,5 +1,5 @@
|
|||
{{- /* https://img.shields.io/badge/$label-$version-$color?style=flat-square&labelColor=403c3d */ -}}
|
||||
{{- $labelLength := strings.RuneCount .label | mul 60 | add 120 -}}
|
||||
{{- $labelLength := strings.RuneCount .label | mul 64 | add 100 -}}
|
||||
{{- $versionLength := strings.RuneCount .version | mul 60 -}}
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="{{ add $labelLength $versionLength | add 200 | mul 0.1 }}" height="20">
|
||||
<g shape-rendering="crispEdges">
|
||||
|
|
|
@ -38,9 +38,7 @@ enableEmoji = true
|
|||
googleAnalytics = ""
|
||||
# copyright description used only for seo schema
|
||||
copyright = "This work is licensed under a Creative Commons Attribution-NonCommercial 4.0 International License."
|
||||
# date format
|
||||
dateFormatToUse = "2006-01-02"
|
||||
# Menu Info
|
||||
# Menu config
|
||||
[languages.en.menu]
|
||||
[[languages.en.menu.main]]
|
||||
identifier = "posts"
|
||||
|
@ -91,22 +89,22 @@ enableEmoji = true
|
|||
description = "About LoveIt Theme"
|
||||
# site keywords
|
||||
keywords = ["Theme", "Hugo"]
|
||||
# site default theme ("light", "dark", "auto")
|
||||
defaultTheme = "auto"
|
||||
# Search
|
||||
# Search config
|
||||
[languages.en.params.search]
|
||||
enable = true
|
||||
# type of search engine ("lunr", "algolia")
|
||||
type = "algolia"
|
||||
# index length of the content
|
||||
contentLength = 5000
|
||||
# placeholder of the search bar
|
||||
placeholder = ""
|
||||
[languages.en.params.search.algolia]
|
||||
index = "index.en"
|
||||
appID = "PASDMWALPK"
|
||||
searchKey = "b42948e51daaa93df92381c8e2ac0f93"
|
||||
# Home Page Info
|
||||
# Home page config
|
||||
[languages.en.params.home]
|
||||
# Home Page Profile
|
||||
# Home page profile
|
||||
[languages.en.params.home.profile]
|
||||
enable = true
|
||||
# Gravatar Email for preferred avatar in home page
|
||||
|
@ -121,14 +119,12 @@ enableEmoji = true
|
|||
social = true
|
||||
# disclaimer (HTML format is supported)
|
||||
disclaimer = ""
|
||||
# Home Page Posts
|
||||
# Home page posts
|
||||
[languages.en.params.home.posts]
|
||||
enable = true
|
||||
# special amount of posts in each home posts page
|
||||
paginate = 6
|
||||
# default behavior when you don't set "hiddenFromHomePage" in front matter
|
||||
defaultHiddenFromHomePage = false
|
||||
# Social Info in home page
|
||||
# Social config in home page
|
||||
[languages.en.params.social]
|
||||
GitHub = "xxxx"
|
||||
Linkedin = "xxxx"
|
||||
|
@ -194,82 +190,6 @@ enableEmoji = true
|
|||
# XMPP = "xxxx"
|
||||
# Matrix = "xxxx"
|
||||
# Bilibili = "xxxx"
|
||||
# Social Share Links in post page
|
||||
[languages.en.params.share]
|
||||
enable = true
|
||||
Twitter = true
|
||||
Facebook = true
|
||||
Linkedin = true
|
||||
Whatsapp = true
|
||||
Pinterest = true
|
||||
# Tumblr = true
|
||||
HackerNews = true
|
||||
# Reddit = true
|
||||
# VK = true
|
||||
# Buffer = true
|
||||
# Xing = true
|
||||
# Line = true
|
||||
# Instapaper = true
|
||||
# Pocket = true
|
||||
# Digg = true
|
||||
# Stumbleupon = true
|
||||
# Flipboard = true
|
||||
# Weibo = true
|
||||
# Renren = true
|
||||
# Myspace = true
|
||||
# Blogger = true
|
||||
# Baidu = true
|
||||
# Odnoklassniki = true
|
||||
# Evernote = true
|
||||
# Skype = true
|
||||
# Trello = true
|
||||
# Mix = true
|
||||
# Comment Config
|
||||
[languages.en.params.comment]
|
||||
enable = true
|
||||
# Disqus Comment Config (https://disqus.com/)
|
||||
[languages.en.params.comment.disqus]
|
||||
enable = false
|
||||
# Disqus shortname to use Disqus in posts
|
||||
shortname = ""
|
||||
# Gitalk Comment Config (https://github.com/gitalk/gitalk)
|
||||
[languages.en.params.comment.gitalk]
|
||||
enable = false
|
||||
owner = ""
|
||||
repo = ""
|
||||
clientId = ""
|
||||
clientSecret = ""
|
||||
# Valine Comment Config (https://github.com/xCss/Valine)
|
||||
[languages.en.params.comment.valine]
|
||||
enable = true
|
||||
appId = "QGzwQXOqs5JOhN4RGPOkR2mR-MdYXbMMI"
|
||||
appKey = "WBmoGyJtbqUswvfLh6L8iEBr"
|
||||
placeholder = "Your comment ..."
|
||||
notify = false
|
||||
verify = true
|
||||
avatar = "mp"
|
||||
meta= ""
|
||||
pageSize = 10
|
||||
lang = "en"
|
||||
visitor = true
|
||||
recordIP = true
|
||||
# Facebook Comment Config (https://developers.facebook.com/docs/plugins/comments)
|
||||
[languages.en.params.comment.facebook]
|
||||
enable = false
|
||||
width = "100%"
|
||||
numPosts = 10
|
||||
appId = ""
|
||||
languageCode = "en_US"
|
||||
# Telegram Comments Config (https://comments.app/)
|
||||
[languages.en.params.comment.telegram]
|
||||
enable = false
|
||||
siteID = ""
|
||||
limit = 5
|
||||
height = ""
|
||||
color = ""
|
||||
colorful = true
|
||||
dislikes = false
|
||||
outlined = false
|
||||
|
||||
[languages.zh-cn]
|
||||
weight = 2
|
||||
|
@ -285,9 +205,7 @@ enableEmoji = true
|
|||
googleAnalytics = ""
|
||||
# 版权描述,仅仅用于 SEO
|
||||
copyright = "This work is licensed under a Creative Commons Attribution-NonCommercial 4.0 International License."
|
||||
# 日期格式
|
||||
dateFormatToUse = "2006-01-02"
|
||||
# 菜单信息
|
||||
# 菜单配置
|
||||
[languages.zh-cn.menu]
|
||||
[[languages.zh-cn.menu.main]]
|
||||
identifier = "posts"
|
||||
|
@ -336,15 +254,15 @@ enableEmoji = true
|
|||
description = "关于 LoveIt 主题"
|
||||
# 网站关键词
|
||||
keywords = ["Theme", "Hugo"]
|
||||
# 网站默认主题 ("light", "dark", "auto")
|
||||
defaultTheme = "auto"
|
||||
# 搜索
|
||||
# 搜索配置
|
||||
[languages.zh-cn.params.search]
|
||||
enable = true
|
||||
# 搜索引擎的类型 ("lunr", "algolia")
|
||||
type = "algolia"
|
||||
# 文章内容索引长度
|
||||
contentLength = 5000
|
||||
# 搜索框的占位提示语
|
||||
placeholder = ""
|
||||
[languages.zh-cn.params.search.algolia]
|
||||
index = "index.zh-cn"
|
||||
appID = "PASDMWALPK"
|
||||
|
@ -371,8 +289,6 @@ enableEmoji = true
|
|||
enable = true
|
||||
# 主页每页显示文章数量
|
||||
paginate = 6
|
||||
# 当你没有在文章前面设置 "hiddenFromHomePage" 时的默认行为
|
||||
defaultHiddenFromHomePage = false
|
||||
# 主页的社交信息设置
|
||||
[languages.zh-cn.params.social]
|
||||
GitHub = "xxxx"
|
||||
|
@ -439,82 +355,6 @@ enableEmoji = true
|
|||
# XMPP = "xxxx@example.com"
|
||||
# Matrix = "xxxx"
|
||||
Bilibili = "xxxx"
|
||||
# 文章页面的分享信息设置
|
||||
[languages.zh-cn.params.share]
|
||||
enable = true
|
||||
Twitter = true
|
||||
Facebook = true
|
||||
# Linkedin = true
|
||||
# Whatsapp = true
|
||||
# Pinterest = true
|
||||
# Tumblr = true
|
||||
# HackerNews = true
|
||||
# Reddit = true
|
||||
# VK = true
|
||||
# Buffer = true
|
||||
# Xing = true
|
||||
# Line = true
|
||||
# Instapaper = true
|
||||
# Pocket = true
|
||||
# Digg = true
|
||||
# Stumbleupon = true
|
||||
# Flipboard = true
|
||||
Weibo = true
|
||||
Renren = true
|
||||
# Myspace = true
|
||||
# Blogger = true
|
||||
Baidu = true
|
||||
# Odnoklassniki = true
|
||||
Evernote = true
|
||||
# Skype = true
|
||||
# Trello = true
|
||||
# Mix = true
|
||||
# 评论系统设置
|
||||
[languages.zh-cn.params.comment]
|
||||
enable = true
|
||||
# Disqus 评论系统设置 (https://disqus.com/)
|
||||
[languages.zh-cn.params.comment.disqus]
|
||||
enable = false
|
||||
# Disqus 的 shortname,用来在文章中启用 Disqus 评论系统
|
||||
shortname = ""
|
||||
# Gitalk 评论系统设置 (https://github.com/gitalk/gitalk)
|
||||
[languages.zh-cn.params.comment.gitalk]
|
||||
enable = false
|
||||
owner = ""
|
||||
repo = ""
|
||||
clientId = ""
|
||||
clientSecret = ""
|
||||
# Valine 评论系统设置 (https://github.com/xCss/Valine)
|
||||
[languages.zh-cn.params.comment.valine]
|
||||
enable = true
|
||||
appId = "QGzwQXOqs5JOhN4RGPOkR2mR-MdYXbMMI"
|
||||
appKey = "WBmoGyJtbqUswvfLh6L8iEBr"
|
||||
placeholder = "你的评论 ..."
|
||||
notify = false
|
||||
verify = true
|
||||
avatar = "mp"
|
||||
meta= ""
|
||||
pageSize = 10
|
||||
lang = "zh-cn"
|
||||
visitor = true
|
||||
recordIP = true
|
||||
# Facebook 评论系统设置 (https://developers.facebook.com/docs/plugins/comments)
|
||||
[languages.zh-cn.params.comment.facebook]
|
||||
enable = false
|
||||
width = "100%"
|
||||
numPosts = 10
|
||||
appId = ""
|
||||
languageCode = "zh_CN"
|
||||
# Telegram Comments 评论系统设置 (https://comments.app/)
|
||||
[languages.zh-cn.params.comment.telegram]
|
||||
enable = false
|
||||
siteID = ""
|
||||
limit = 5
|
||||
height = ""
|
||||
color = ""
|
||||
colorful = true
|
||||
dislikes = false
|
||||
outlined = false
|
||||
|
||||
[languages.fr]
|
||||
weight = 3
|
||||
|
@ -530,9 +370,7 @@ enableEmoji = true
|
|||
googleAnalytics = ""
|
||||
# copyright description used only for seo schema
|
||||
copyright = "This work is licensed under a Creative Commons Attribution-NonCommercial 4.0 International License."
|
||||
# date format
|
||||
dateFormatToUse = "2006-01-02"
|
||||
# Menu Info
|
||||
# Menu config
|
||||
[languages.fr.menu]
|
||||
[[languages.fr.menu.main]]
|
||||
identifier = "posts"
|
||||
|
@ -581,22 +419,22 @@ enableEmoji = true
|
|||
description = "À propos du thème LoveIt"
|
||||
# site keywords
|
||||
keywords = ["Thème", "Hugo"]
|
||||
# site default theme ("light", "dark", "auto")
|
||||
defaultTheme = "auto"
|
||||
# Search
|
||||
# Search config
|
||||
[languages.fr.params.search]
|
||||
enable = true
|
||||
# type of search engine ("lunr", "algolia")
|
||||
type = "algolia"
|
||||
# index length of the content
|
||||
contentLength = 5000
|
||||
# placeholder of the search bar
|
||||
placeholder = ""
|
||||
[languages.fr.params.search.algolia]
|
||||
index = "index.fr"
|
||||
appID = "PASDMWALPK"
|
||||
searchKey = "b42948e51daaa93df92381c8e2ac0f93"
|
||||
# Home Page Info
|
||||
# Home page config
|
||||
[languages.fr.params.home]
|
||||
# Home Page Profile
|
||||
# Home page profile
|
||||
[languages.fr.params.home.profile]
|
||||
enable = true
|
||||
# Gravatar Email for preferred avatar in home page
|
||||
|
@ -611,14 +449,12 @@ enableEmoji = true
|
|||
social = true
|
||||
# disclaimer (HTML format is supported)
|
||||
disclaimer = ""
|
||||
# Home Page Posts
|
||||
# Home page posts
|
||||
[languages.fr.params.home.posts]
|
||||
enable = true
|
||||
# special amount of posts in each home posts page
|
||||
paginate = 6
|
||||
# default behavior when you don't set "hiddenFromHomePage" in front matter
|
||||
defaultHiddenFromHomePage = false
|
||||
# Social Info in home page
|
||||
# Social config in home page
|
||||
[languages.fr.params.social]
|
||||
GitHub = "xxxx"
|
||||
Linkedin = "xxxx"
|
||||
|
@ -684,95 +520,25 @@ enableEmoji = true
|
|||
# XMPP = "xxxx"
|
||||
# Matrix = "xxxx"
|
||||
# Bilibili = "xxxx"
|
||||
# Social Share Links in post page
|
||||
[languages.fr.params.share]
|
||||
enable = true
|
||||
Twitter = true
|
||||
Facebook = true
|
||||
Linkedin = true
|
||||
Whatsapp = true
|
||||
Pinterest = true
|
||||
# Tumblr = true
|
||||
HackerNews = true
|
||||
# Reddit = true
|
||||
# VK = true
|
||||
# Buffer = true
|
||||
# Xing = true
|
||||
# Line = true
|
||||
# Instapaper = true
|
||||
# Pocket = true
|
||||
# Digg = true
|
||||
# Stumbleupon = true
|
||||
# Flipboard = true
|
||||
# Weibo = true
|
||||
# Renren = true
|
||||
# Myspace = true
|
||||
# Blogger = true
|
||||
# Baidu = true
|
||||
# Odnoklassniki = true
|
||||
# Evernote = true
|
||||
# Skype = true
|
||||
# Trello = true
|
||||
# Mix = true
|
||||
# Comment Config
|
||||
[languages.fr.params.comment]
|
||||
enable = true
|
||||
# Disqus Comment Config (https://disqus.com/)
|
||||
[languages.fr.params.comment.disqus]
|
||||
enable = false
|
||||
# Disqus shortname to use Disqus in posts
|
||||
shortname = ""
|
||||
# Gitalk Comment Config (https://github.com/gitalk/gitalk)
|
||||
[languages.fr.params.comment.gitalk]
|
||||
enable = false
|
||||
owner = ""
|
||||
repo = ""
|
||||
clientId = ""
|
||||
clientSecret = ""
|
||||
# Valine Comment Config (https://github.com/xCss/Valine)
|
||||
[languages.fr.params.comment.valine]
|
||||
enable = true
|
||||
appId = "QGzwQXOqs5JOhN4RGPOkR2mR-MdYXbMMI"
|
||||
appKey = "WBmoGyJtbqUswvfLh6L8iEBr"
|
||||
placeholder = "Votre commentaire ..."
|
||||
notify = false
|
||||
verify = true
|
||||
avatar = "mp"
|
||||
meta= ""
|
||||
pageSize = 10
|
||||
lang = "en"
|
||||
visitor = true
|
||||
recordIP = true
|
||||
# Facebook Comment Config (https://developers.facebook.com/docs/plugins/comments)
|
||||
[languages.fr.params.comment.facebook]
|
||||
enable = false
|
||||
width = "100%"
|
||||
numPosts = 10
|
||||
appId = ""
|
||||
languageCode = "fr"
|
||||
# Telegram Comments Config (https://comments.app/)
|
||||
[languages.fr.params.comment.telegram]
|
||||
enable = false
|
||||
siteID = ""
|
||||
limit = 5
|
||||
height = ""
|
||||
color = ""
|
||||
colorful = true
|
||||
dislikes = false
|
||||
outlined = false
|
||||
|
||||
[params]
|
||||
# LoveIt theme version
|
||||
# LoveIt 主题版本
|
||||
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"
|
||||
# which hash function used for SRI, when empty, no SRI is used ("sha256", "sha384", "sha512", "md5")
|
||||
# 哪种哈希函数用来 SRI, 为空时表示不使用 SRI ("sha256", "sha384", "sha512", "md5")
|
||||
fingerprint = ""
|
||||
# Header info
|
||||
# 页面头部导航栏信息
|
||||
# date format
|
||||
# 日期格式
|
||||
dateFormat = "2006-01-02"
|
||||
# Header config
|
||||
# 页面头部导航栏配置
|
||||
[params.header]
|
||||
# desktop header mode ("fixed", "normal", "auto")
|
||||
# 桌面端导航栏模式 ("fixed", "normal", "auto")
|
||||
|
@ -780,10 +546,23 @@ enableEmoji = true
|
|||
# mobile header mode ("fixed", "normal", "auto")
|
||||
# 移动端导航栏模式 ("fixed", "normal", "auto")
|
||||
mobileMode = "auto"
|
||||
# Footer Copyright Info
|
||||
# 页面底部版权信息设置
|
||||
# Footer config
|
||||
# 页面底部信息配置
|
||||
[params.footer]
|
||||
# Site creation time
|
||||
enable = true
|
||||
# Custom content (HTML format is supported)
|
||||
# 自定义内容 (支持 HTML 格式)
|
||||
custom = ''
|
||||
# whether to show Hugo and theme info
|
||||
# 是否显示 Hugo 和主题信息
|
||||
hugo = true
|
||||
# whether to show copyright info
|
||||
# 是否显示版权信息
|
||||
copyright = true
|
||||
# whether to show the author
|
||||
# 是否显示作者
|
||||
author = true
|
||||
# site creation time
|
||||
# 网站创立年份
|
||||
since = 2019
|
||||
# ICP info only in China (HTML format is supported)
|
||||
|
@ -792,57 +571,209 @@ enableEmoji = true
|
|||
# license info (HTML format is supported)
|
||||
# 许可协议信息 (支持 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>'
|
||||
# Section (all posts) page config
|
||||
# Section (所有文章) 页面配置
|
||||
[params.section]
|
||||
# special amount of posts in each section page
|
||||
# section 页面每页显示文章数量
|
||||
paginate = 20
|
||||
# date format (month and day)
|
||||
# 日期格式 (月和日)
|
||||
dateFormat = "01-02"
|
||||
# List (category or tag) page config
|
||||
# List (目录或标签) 页面配置
|
||||
[params.list]
|
||||
# special amount of posts in each list page
|
||||
# list 页面每页显示文章数量
|
||||
paginate = 20
|
||||
# date format (month and day)
|
||||
# 日期格式 (月和日)
|
||||
dateFormat = "01-02"
|
||||
# Page config
|
||||
# 文章页面配置
|
||||
[params.page]
|
||||
# whether to use lightgallery in the page
|
||||
# 是否在文章页面使用 lightgallery
|
||||
lightgallery = true
|
||||
# whether to show link to Raw Markdown content of the post
|
||||
# 是否在文章页面显示原始 Markdown 文档链接
|
||||
# whether to hide a page from home page
|
||||
# 是否在主页隐藏一篇文章
|
||||
hiddenFromHomePage = false
|
||||
# whether to hide a page from search results
|
||||
# 是否在搜索结果中隐藏一篇文章
|
||||
hiddenFromSearch = false
|
||||
# whether to enable lightgallery
|
||||
# 是否使用 lightgallery
|
||||
lightgallery = false
|
||||
# whether to show the copy button of the code block
|
||||
# 是否显示代码块的复制按钮
|
||||
copyCode = true
|
||||
# whether to enable the ruby extended syntax
|
||||
# 是否使用 ruby 扩展语法
|
||||
ruby = true
|
||||
# whether to enable the fraction extended syntax
|
||||
# 是否使用 fraction 扩展语法
|
||||
fraction = true
|
||||
# whether to enable the fontawesome extended syntax
|
||||
# 是否使用 fontawesome 扩展语法
|
||||
fontawesome = true
|
||||
# whether to show link to Raw Markdown content of the content
|
||||
# 是否显示原始 Markdown 文档内容的链接
|
||||
linkToMarkdown = true
|
||||
# KaTeX mathematical formulas config (KaTeX https://katex.org/)
|
||||
# KaTeX 数学公式配置 (KaTeX https://katex.org/)
|
||||
[params.math]
|
||||
enable = true
|
||||
# default block delimiter is $$ ... $$ and \\[ ... \\]
|
||||
# 默认块定界符是 $$ ... $$ 和 \\[ ... \\]
|
||||
blockLeftDelimiter = ""
|
||||
blockRightDelimiter = ""
|
||||
# default inline delimiter is $ ... $ and \\( ... \\)
|
||||
# 默认内联定界符是 $ ... $ 和 \\( ... \\)
|
||||
inlineLeftDelimiter = ""
|
||||
inlineRightDelimiter = ""
|
||||
# KaTeX extension copy_tex
|
||||
# KaTeX 插件 copy_tex
|
||||
copyTex = true
|
||||
# KaTeX extension mhchem
|
||||
# KaTeX 插件 mhchem
|
||||
mhchem = true
|
||||
# Mapbox GL JS config (Mapbox GL JS https://docs.mapbox.com/mapbox-gl-js)
|
||||
# Mapbox GL JS 配置 (Mapbox GL JS https://docs.mapbox.com/mapbox-gl-js)
|
||||
[params.mapbox]
|
||||
# access token of Mapbox GL JS
|
||||
# Mapbox GL JS 的 access token
|
||||
accessToken = "pk.eyJ1IjoiZGlsbG9uenEiLCJhIjoiY2s2czd2M2x3MDA0NjNmcGxmcjVrZmc2cyJ9.aSjv2BNuZUfARvxRYjSVZQ"
|
||||
# style for the light theme
|
||||
# 浅色主题的地图样式
|
||||
lightStyle = "mapbox://styles/mapbox/light-v9?optimize=true"
|
||||
# style for the dark theme
|
||||
# 深色主题的地图样式
|
||||
darkStyle = "mapbox://styles/mapbox/dark-v9?optimize=true"
|
||||
# whether to add NavigationControl (https://docs.mapbox.com/mapbox-gl-js/api/#navigationcontrol)
|
||||
# 是否添加 NavigationControl (https://docs.mapbox.com/mapbox-gl-js/api/#navigationcontrol)
|
||||
navigation = true
|
||||
# whether to add GeolocateControl (https://docs.mapbox.com/mapbox-gl-js/api/#geolocatecontrol)
|
||||
# 是否添加 GeolocateControl (https://docs.mapbox.com/mapbox-gl-js/api/#geolocatecontrol)
|
||||
geolocate = true
|
||||
# whether to add ScaleControl (https://docs.mapbox.com/mapbox-gl-js/api/#scalecontrol)
|
||||
# 是否添加 ScaleControl (https://docs.mapbox.com/mapbox-gl-js/api/#scalecontrol)
|
||||
scale = true
|
||||
# whether to add FullscreenControl (https://docs.mapbox.com/mapbox-gl-js/api/#fullscreencontrol)
|
||||
# 是否添加 FullscreenControl (https://docs.mapbox.com/mapbox-gl-js/api/#fullscreencontrol)
|
||||
fullscreen = true
|
||||
# Table of the contents config
|
||||
# 目录配置
|
||||
[params.page.toc]
|
||||
# whether to enable the table of the contents
|
||||
# 是否使用目录
|
||||
enable = true
|
||||
# whether to make the table of the contents automatically collapsed
|
||||
# 是否使目录自动折叠展开
|
||||
auto = true
|
||||
# KaTeX mathematical formulas config (KaTeX https://katex.org/)
|
||||
# KaTeX 数学公式配置 (KaTeX https://katex.org/)
|
||||
[params.page.math]
|
||||
enable = false
|
||||
# default block delimiter is $$ ... $$ and \\[ ... \\]
|
||||
# 默认块定界符是 $$ ... $$ 和 \\[ ... \\]
|
||||
blockLeftDelimiter = ""
|
||||
blockRightDelimiter = ""
|
||||
# default inline delimiter is $ ... $ and \\( ... \\)
|
||||
# 默认内联定界符是 $ ... $ 和 \\( ... \\)
|
||||
inlineLeftDelimiter = ""
|
||||
inlineRightDelimiter = ""
|
||||
# KaTeX extension copy_tex
|
||||
# KaTeX 插件 copy_tex
|
||||
copyTex = true
|
||||
# KaTeX extension mhchem
|
||||
# KaTeX 插件 mhchem
|
||||
mhchem = true
|
||||
# Mapbox GL JS config (Mapbox GL JS https://docs.mapbox.com/mapbox-gl-js)
|
||||
# Mapbox GL JS 配置 (Mapbox GL JS https://docs.mapbox.com/mapbox-gl-js)
|
||||
[params.page.mapbox]
|
||||
# access token of Mapbox GL JS
|
||||
# Mapbox GL JS 的 access token
|
||||
accessToken = "pk.eyJ1IjoiZGlsbG9uenEiLCJhIjoiY2s2czd2M2x3MDA0NjNmcGxmcjVrZmc2cyJ9.aSjv2BNuZUfARvxRYjSVZQ"
|
||||
# style for the light theme
|
||||
# 浅色主题的地图样式
|
||||
lightStyle = "mapbox://styles/mapbox/light-v9?optimize=true"
|
||||
# style for the dark theme
|
||||
# 深色主题的地图样式
|
||||
darkStyle = "mapbox://styles/mapbox/dark-v9?optimize=true"
|
||||
# whether to add NavigationControl (https://docs.mapbox.com/mapbox-gl-js/api/#navigationcontrol)
|
||||
# 是否添加 NavigationControl (https://docs.mapbox.com/mapbox-gl-js/api/#navigationcontrol)
|
||||
navigation = true
|
||||
# whether to add GeolocateControl (https://docs.mapbox.com/mapbox-gl-js/api/#geolocatecontrol)
|
||||
# 是否添加 GeolocateControl (https://docs.mapbox.com/mapbox-gl-js/api/#geolocatecontrol)
|
||||
geolocate = true
|
||||
# whether to add ScaleControl (https://docs.mapbox.com/mapbox-gl-js/api/#scalecontrol)
|
||||
# 是否添加 ScaleControl (https://docs.mapbox.com/mapbox-gl-js/api/#scalecontrol)
|
||||
scale = true
|
||||
# whether to add FullscreenControl (https://docs.mapbox.com/mapbox-gl-js/api/#fullscreencontrol)
|
||||
# 是否添加 FullscreenControl (https://docs.mapbox.com/mapbox-gl-js/api/#fullscreencontrol)
|
||||
fullscreen = true
|
||||
# Social share links in post page
|
||||
# 文章页面的分享信息设置
|
||||
[params.page.share]
|
||||
enable = true
|
||||
Twitter = true
|
||||
Facebook = true
|
||||
# Linkedin = true
|
||||
# Whatsapp = true
|
||||
# Pinterest = true
|
||||
# Tumblr = true
|
||||
# HackerNews = true
|
||||
# Reddit = true
|
||||
# VK = true
|
||||
# Buffer = true
|
||||
# Xing = true
|
||||
# Line = true
|
||||
# Instapaper = true
|
||||
# Pocket = true
|
||||
# Digg = true
|
||||
# Stumbleupon = true
|
||||
# Flipboard = true
|
||||
Weibo = true
|
||||
Renren = true
|
||||
# Myspace = true
|
||||
# Blogger = true
|
||||
Baidu = true
|
||||
# Odnoklassniki = true
|
||||
Evernote = true
|
||||
# Skype = true
|
||||
# Trello = true
|
||||
# Mix = true
|
||||
# Comment config
|
||||
# 评论系统设置
|
||||
[params.page.comment]
|
||||
enable = true
|
||||
# Disqus comment config (https://disqus.com/)
|
||||
# Disqus 评论系统设置 (https://disqus.com/)
|
||||
[params.page.comment.disqus]
|
||||
enable = false
|
||||
# Disqus shortname to use Disqus in posts
|
||||
# Disqus 的 shortname,用来在文章中启用 Disqus 评论系统
|
||||
shortname = ""
|
||||
# Gitalk comment config (https://github.com/gitalk/gitalk)
|
||||
# Gitalk 评论系统设置 (https://github.com/gitalk/gitalk)
|
||||
[params.page.comment.gitalk]
|
||||
enable = false
|
||||
owner = ""
|
||||
repo = ""
|
||||
clientId = ""
|
||||
clientSecret = ""
|
||||
# Valine comment config (https://github.com/xCss/Valine)
|
||||
# Valine 评论系统设置 (https://github.com/xCss/Valine)
|
||||
[params.page.comment.valine]
|
||||
enable = true
|
||||
appId = "QGzwQXOqs5JOhN4RGPOkR2mR-MdYXbMMI"
|
||||
appKey = "WBmoGyJtbqUswvfLh6L8iEBr"
|
||||
placeholder = ""
|
||||
notify = false
|
||||
verify = true
|
||||
avatar = "mp"
|
||||
meta= ""
|
||||
pageSize = 10
|
||||
lang = ""
|
||||
visitor = true
|
||||
recordIP = true
|
||||
# Facebook comment config (https://developers.facebook.com/docs/plugins/comments)
|
||||
# Facebook 评论系统设置 (https://developers.facebook.com/docs/plugins/comments)
|
||||
[params.page.comment.facebook]
|
||||
enable = false
|
||||
width = "100%"
|
||||
numPosts = 10
|
||||
appId = ""
|
||||
languageCode = ""
|
||||
# Telegram comments config (https://comments.app/)
|
||||
# Telegram Comments 评论系统设置 (https://comments.app/)
|
||||
[params.page.comment.telegram]
|
||||
enable = false
|
||||
siteID = ""
|
||||
limit = 5
|
||||
height = ""
|
||||
color = ""
|
||||
colorful = true
|
||||
dislikes = false
|
||||
outlined = false
|
||||
# SEO config
|
||||
# SEO 配置
|
||||
[params.page.seo]
|
||||
# Publisher info
|
||||
# 出版者信息
|
||||
[params.page.seo.publisher]
|
||||
name = "xxxx"
|
||||
[params.page.seo.publisher.logo]
|
||||
url = "logo.png"
|
||||
width = 127
|
||||
height = 40
|
||||
# Logo info
|
||||
# Logo 信息
|
||||
[params.page.seo.logo]
|
||||
url = "logo.png"
|
||||
width = 127
|
||||
height = 40
|
||||
# Image info
|
||||
# 图片信息
|
||||
[params.page.seo.image]
|
||||
url = "cover.png"
|
||||
width = 800
|
||||
height = 600
|
||||
# site verification code for Google/Bing/Yandex/Pinterest/Baidu
|
||||
# 网站验证代码,用于 Google/Bing/Yandex/Pinterest/Baidu
|
||||
[params.verification]
|
||||
|
@ -851,26 +782,6 @@ enableEmoji = true
|
|||
yandex = ""
|
||||
pinterest = ""
|
||||
baidu = ""
|
||||
# Publisher Info just for SEO
|
||||
# 出版者信息,仅用于 SEO
|
||||
[params.publisher]
|
||||
name = "xxxx"
|
||||
[params.publisher.logo]
|
||||
url = "logo.png"
|
||||
width = 127
|
||||
height = 40
|
||||
# Website Log Info just for SEO
|
||||
# 网站 Logo 信息,仅用于 SEO
|
||||
[params.logo]
|
||||
url = "logo.png"
|
||||
width = 127
|
||||
height = 40
|
||||
# Website Image Info just for SEO
|
||||
# 网站图标信息,仅用于 SEO
|
||||
[params.image]
|
||||
url = "cover.png"
|
||||
width = 800
|
||||
height = 600
|
||||
# CSS and JS Files CDN
|
||||
# CSS 和 JS 文件的 CDN 设置
|
||||
[params.cdn]
|
||||
|
@ -961,31 +872,30 @@ enableEmoji = true
|
|||
startLevel = 2
|
||||
endLevel = 6
|
||||
|
||||
# Author Info
|
||||
# 作者信息
|
||||
# Author config
|
||||
# 作者配置
|
||||
[author]
|
||||
name = "xxxx"
|
||||
link = ""
|
||||
|
||||
# Sitemap Info
|
||||
# 网站地图信息
|
||||
# Sitemap config
|
||||
# 网站地图配置
|
||||
[sitemap]
|
||||
changefreq = "weekly"
|
||||
filename = "sitemap.xml"
|
||||
priority = 0.5
|
||||
|
||||
# Permalinks Info (https://gohugo.io/content-management/urls/#permalinks)
|
||||
# Permalinks 信息 (https://gohugo.io/content-management/urls/#permalinks)
|
||||
# Permalinks config (https://gohugo.io/content-management/urls/#permalinks)
|
||||
# Permalinks 配置 (https://gohugo.io/content-management/urls/#permalinks)
|
||||
[Permalinks]
|
||||
# posts = ":year/:month/:filename"
|
||||
posts = ":filename"
|
||||
|
||||
# Privacy Info (https://gohugo.io/about/hugo-and-gdpr/)
|
||||
# 隐私信息设置 (https://gohugo.io/about/hugo-and-gdpr/)
|
||||
# Privacy config (https://gohugo.io/about/hugo-and-gdpr/)
|
||||
# 隐私信息配置 (https://gohugo.io/about/hugo-and-gdpr/)
|
||||
[privacy]
|
||||
[privacy.googleAnalytics]
|
||||
anonymizeIP = true
|
||||
|
||||
[privacy.youtube]
|
||||
privacyEnhanced = true
|
||||
|
||||
|
|
|
@ -3,7 +3,8 @@ title: "About LoveIt"
|
|||
date: 2019-08-02T11:04:49+08:00
|
||||
draft: false
|
||||
|
||||
math: true
|
||||
math:
|
||||
enable: true
|
||||
lightgallery: true
|
||||
---
|
||||
|
||||
|
|
|
@ -3,7 +3,8 @@ title: "À propos de LoveIt"
|
|||
date: 2019-08-02T11:04:49+08:00
|
||||
draft: false
|
||||
|
||||
math: true
|
||||
math:
|
||||
enable: true
|
||||
lightgallery: true
|
||||
---
|
||||
|
||||
|
|
|
@ -3,7 +3,8 @@ title: "关于 LoveIt"
|
|||
date: 2019-08-02T11:04:49+08:00
|
||||
draft: false
|
||||
|
||||
math: true
|
||||
math:
|
||||
enable: true
|
||||
lightgallery: true
|
||||
---
|
||||
|
||||
|
|
|
@ -1,38 +1,19 @@
|
|||
---
|
||||
weight: 4
|
||||
title: "Basic Markdown Syntax"
|
||||
subtitle: ""
|
||||
date: 2019-12-01T21:57:40+08:00
|
||||
lastmod: 2020-01-01T16:45:40+08:00
|
||||
draft: false
|
||||
author: "Dillon"
|
||||
authorLink: "https://dillonzq.com"
|
||||
description: "This article shows the basic Markdown syntax and format."
|
||||
license: ""
|
||||
|
||||
tags: ["markdown"]
|
||||
categories: ["markdown"]
|
||||
hiddenFromHomePage: false
|
||||
|
||||
featuredImage: "/images/basic-markdown-syntax/featured-image.png"
|
||||
featuredImagePreview: ""
|
||||
|
||||
toc: true
|
||||
autoCollapseToc: true
|
||||
math: false
|
||||
mapbox:
|
||||
accessToken: ""
|
||||
lightStyle: ""
|
||||
darkStyle: ""
|
||||
navigation: true
|
||||
geolocate: true
|
||||
scale: true
|
||||
fullscreen: true
|
||||
lightgallery: true
|
||||
linkToMarkdown: true
|
||||
share:
|
||||
enable: true
|
||||
comment: true
|
||||
---
|
||||
|
||||
This article offers a sample of basic Markdown syntax that can be used in Hugo content files.
|
||||
|
|
|
@ -1,38 +1,19 @@
|
|||
---
|
||||
weight: 4
|
||||
title: "Syntaxe de Markdown de Base"
|
||||
subtitle: ""
|
||||
date: 2019-12-01T21:57:40+08:00
|
||||
lastmod: 2020-01-01T16:45:40+08:00
|
||||
draft: false
|
||||
author: "Dillon"
|
||||
authorLink: "https://dillonzq.com"
|
||||
description: "Cet article présente la syntaxe et le format de base de Markdown."
|
||||
license: ""
|
||||
|
||||
tags: ["markdown"]
|
||||
categories: ["markdown"]
|
||||
hiddenFromHomePage: false
|
||||
|
||||
featuredImage: "/images/basic-markdown-syntax/featured-image.png"
|
||||
featuredImagePreview: ""
|
||||
|
||||
toc: true
|
||||
autoCollapseToc: true
|
||||
math: false
|
||||
mapbox:
|
||||
accessToken: ""
|
||||
lightStyle: ""
|
||||
darkStyle: ""
|
||||
navigation: true
|
||||
geolocate: true
|
||||
scale: true
|
||||
fullscreen: true
|
||||
lightgallery: true
|
||||
linkToMarkdown: true
|
||||
share:
|
||||
enable: true
|
||||
comment: true
|
||||
---
|
||||
|
||||
Cet article propose un exemple de syntaxe Markdown de base qui peut être utilisée dans les fichiers de contenu Hugo.
|
||||
|
|
|
@ -1,38 +1,19 @@
|
|||
---
|
||||
weight: 4
|
||||
title: "Markdown 基本语法"
|
||||
subtitle: ""
|
||||
date: 2019-12-01T21:57:40+08:00
|
||||
lastmod: 2020-01-01T16:45:40+08:00
|
||||
draft: false
|
||||
author: "Dillon"
|
||||
authorLink: "https://dillonzq.com"
|
||||
description: "这篇文章展示了基本的 Markdown 语法和格式."
|
||||
license: ""
|
||||
|
||||
tags: ["markdown"]
|
||||
categories: ["markdown"]
|
||||
hiddenFromHomePage: false
|
||||
|
||||
featuredImage: "/images/basic-markdown-syntax/featured-image.png"
|
||||
featuredImagePreview: ""
|
||||
|
||||
toc: true
|
||||
autoCollapseToc: true
|
||||
math: false
|
||||
mapbox:
|
||||
accessToken: ""
|
||||
lightStyle: ""
|
||||
darkStyle: ""
|
||||
navigation: true
|
||||
geolocate: true
|
||||
scale: true
|
||||
fullscreen: true
|
||||
lightgallery: true
|
||||
linkToMarkdown: true
|
||||
share:
|
||||
enable: true
|
||||
comment: true
|
||||
---
|
||||
|
||||
这篇文章提供了可以在 Hugo 的文章中使用的基本 Markdown 语法示例.
|
||||
|
|
|
@ -1,38 +1,19 @@
|
|||
---
|
||||
weight: 5
|
||||
title: "Emoji Support"
|
||||
subtitle: ""
|
||||
date: 2019-10-01T17:55:28+08:00
|
||||
lastmod: 2019-10-01T17:55:28+08:00
|
||||
draft: false
|
||||
author: "Dillon"
|
||||
authorLink: "https://dillonzq.com"
|
||||
description: "Guide to emoji usage in Hugo and LoveIt."
|
||||
license: ""
|
||||
|
||||
tags: ["emoji"]
|
||||
categories: ["markdown"]
|
||||
hiddenFromHomePage: false
|
||||
|
||||
featuredImage: "/images/emoji-support/featured-image.jpg"
|
||||
featuredImagePreview: ""
|
||||
|
||||
toc: true
|
||||
autoCollapseToc: true
|
||||
math: false
|
||||
mapbox:
|
||||
accessToken: ""
|
||||
lightStyle: ""
|
||||
darkStyle: ""
|
||||
navigation: true
|
||||
geolocate: true
|
||||
scale: true
|
||||
fullscreen: true
|
||||
lightgallery: true
|
||||
linkToMarkdown: true
|
||||
share:
|
||||
enable: true
|
||||
comment: true
|
||||
---
|
||||
|
||||
Emoji can be enabled in a Hugo project in a number of ways.
|
||||
|
|
|
@ -1,14 +1,12 @@
|
|||
---
|
||||
weight: 5
|
||||
title: "Emoji Support"
|
||||
subtitle: ""
|
||||
date: 2019-10-01T17:55:28+08:00
|
||||
lastmod: 2019-10-01T17:55:28+08:00
|
||||
draft: false
|
||||
author: "Dillon"
|
||||
authorLink: "https://dillonzq.com"
|
||||
description: "Guide d'utilisation des emoji dans Hugo et LoveIt."
|
||||
license: ""
|
||||
|
||||
tags: ["emoji"]
|
||||
categories: ["markdown"]
|
||||
|
@ -17,22 +15,7 @@ hiddenFromHomePage: false
|
|||
featuredImage: "/images/emoji-support/featured-image.jpg"
|
||||
featuredImagePreview: ""
|
||||
|
||||
toc: true
|
||||
autoCollapseToc: true
|
||||
math: false
|
||||
mapbox:
|
||||
accessToken: ""
|
||||
lightStyle: ""
|
||||
darkStyle: ""
|
||||
navigation: true
|
||||
geolocate: true
|
||||
scale: true
|
||||
fullscreen: true
|
||||
lightgallery: true
|
||||
linkToMarkdown: true
|
||||
share:
|
||||
enable: true
|
||||
comment: true
|
||||
---
|
||||
|
||||
Emoji peut être activé dans un projet Hugo de plusieurs façons.
|
||||
|
|
|
@ -1,38 +1,19 @@
|
|||
---
|
||||
weight: 5
|
||||
title: "Emoji 支持"
|
||||
subtitle: ""
|
||||
date: 2019-10-01T17:55:28+08:00
|
||||
lastmod: 2019-10-01T17:55:28+08:00
|
||||
draft: false
|
||||
author: "Dillon"
|
||||
authorLink: "https://dillonzq.com"
|
||||
description: "Hugo 和 LoveIt 中的 Emoji 的用法指南."
|
||||
license: ""
|
||||
|
||||
tags: ["emoji"]
|
||||
categories: ["markdown"]
|
||||
hiddenFromHomePage: false
|
||||
|
||||
featuredImage: "/images/emoji-support/featured-image.jpg"
|
||||
featuredImagePreview: ""
|
||||
|
||||
toc: true
|
||||
autoCollapseToc: true
|
||||
math: false
|
||||
mapbox:
|
||||
accessToken: ""
|
||||
lightStyle: ""
|
||||
darkStyle: ""
|
||||
navigation: true
|
||||
geolocate: true
|
||||
scale: true
|
||||
fullscreen: true
|
||||
lightgallery: true
|
||||
linkToMarkdown: true
|
||||
share:
|
||||
enable: true
|
||||
comment: true
|
||||
---
|
||||
|
||||
Emoji 可以通过多种方式在 Hugo 项目中启用.
|
||||
|
|
|
@ -1,38 +1,21 @@
|
|||
---
|
||||
weight: 1
|
||||
title: "Theme Documentation - Basics"
|
||||
subtitle: ""
|
||||
date: 2020-03-06T21:29:01+08:00
|
||||
lastmod: 2020-03-06T21:29:01+08:00
|
||||
draft: false
|
||||
author: "Dillon"
|
||||
authorLink: "https://dillonzq.com"
|
||||
description: "Discover what the Hugo - LoveIt theme is all about and the core-concepts behind it."
|
||||
license: ""
|
||||
|
||||
tags: ["installation", "configuration"]
|
||||
categories: ["documentation"]
|
||||
hiddenFromHomePage: false
|
||||
|
||||
featuredImage: "/images/theme-documentation-basics/featured-image.jpg"
|
||||
featuredImagePreview: ""
|
||||
|
||||
toc: true
|
||||
autoCollapseToc: false
|
||||
math: false
|
||||
mapbox:
|
||||
accessToken: ""
|
||||
lightStyle: ""
|
||||
darkStyle: ""
|
||||
navigation: true
|
||||
geolocate: true
|
||||
scale: true
|
||||
fullscreen: true
|
||||
toc:
|
||||
auto: false
|
||||
lightgallery: true
|
||||
linkToMarkdown: true
|
||||
share:
|
||||
enable: true
|
||||
comment: true
|
||||
---
|
||||
|
||||
Discover what the Hugo - **LoveIt** theme is all about and the core-concepts behind it.
|
||||
|
@ -50,7 +33,7 @@ Since [Markdown Render Hooks](https://gohugo.io/getting-started/configuration-ma
|
|||
{{< /admonition >}}
|
||||
|
||||
{{< admonition note "Why need the Hugo extended version?" >}}
|
||||
Since this theme processes SCSS to CSS, Hugo needs to be the **extended** version.
|
||||
Since the theme processes SCSS to CSS, Hugo needs to be the **extended** version.
|
||||
{{< /admonition >}}
|
||||
|
||||
## 2 Installation
|
||||
|
@ -102,7 +85,7 @@ theme = "LoveIt"
|
|||
|
||||
[params]
|
||||
# LoveIt theme version
|
||||
version = "0.1.X"
|
||||
version = "0.2.X"
|
||||
|
||||
[menu]
|
||||
[[menu.main]]
|
||||
|
@ -145,7 +128,7 @@ hugo new posts/first_post.md
|
|||
Feel free to edit the post file by adding some sample content and replacing the title value in the beginning of the file.
|
||||
|
||||
{{< admonition >}}
|
||||
By default all posts and pages are created as a draft. If you want to render these pages, remove the property `draft: true` from the metadata or set the property `draft: false`.
|
||||
By default all posts and pages are created as a draft. If you want to render these pages, remove the property `draft: true` from the metadata, set the property `draft: false` or add `-D`/`--buildDrafts` parameter to `hugo` command.
|
||||
{{< /admonition >}}
|
||||
|
||||
### 2.5 Launching the Website Locally
|
||||
|
@ -164,6 +147,15 @@ Go to `http://localhost:1313`.
|
|||
When you run `hugo serve`, when the contents of the files change, the page automatically refreshes with the changes.
|
||||
{{< /admonition >}}
|
||||
|
||||
{{< admonition >}}
|
||||
Since the theme use `.Scratch` in Hugo to implement some features,
|
||||
it is highly recommended that you add `--disableFastRender` parameter to `hugo server` command for the live preview of the page you are editing.
|
||||
|
||||
```bash
|
||||
hugo serve --disableFastRender
|
||||
```
|
||||
{{< /admonition >}}
|
||||
|
||||
### 2.6 Build the Website
|
||||
|
||||
When your site is ready to deploy, run the following command:
|
||||
|
@ -191,8 +183,8 @@ Note that some of these parameters are explained in details in other sections of
|
|||
|
||||
```toml
|
||||
[params]
|
||||
# LoveIt theme version
|
||||
version = "0.1.X"
|
||||
# {{< version 0.2.0 changed >}} LoveIt theme version
|
||||
version = "0.2.X"
|
||||
# site description
|
||||
description = "This is My New Hugo Site"
|
||||
# site keywords
|
||||
|
@ -204,34 +196,65 @@ Note that some of these parameters are explained in details in other sections of
|
|||
# {{< version 0.1.1 >}} which hash function used for SRI, when empty, no SRI is used
|
||||
# ("sha256", "sha384", "sha512", "md5")
|
||||
fingerprint = ""
|
||||
# {{< version 0.2.0 >}} Search
|
||||
# {{< version 0.2.0 >}} date format
|
||||
dateFormat = "2006-01-02"
|
||||
|
||||
# {{< version 0.2.0 >}} Search config
|
||||
[params.search]
|
||||
enable = true
|
||||
# type of search engine ("lunr", "algolia")
|
||||
type = "lunr"
|
||||
# index length of the content
|
||||
contentLength = 5000
|
||||
# placeholder of the search bar
|
||||
placeholder = ""
|
||||
[params.search.algolia]
|
||||
index = ""
|
||||
appID = ""
|
||||
searchKey = ""
|
||||
# Header info
|
||||
|
||||
# Header config
|
||||
[params.header]
|
||||
# desktop header mode ("fixed", "normal", "auto")
|
||||
desktopMode = "fixed"
|
||||
# mobile header mode ("fixed", "normal", "auto")
|
||||
mobileMode = "auto"
|
||||
# Footer Copyright Info
|
||||
|
||||
# Footer config
|
||||
[params.footer]
|
||||
enable = true
|
||||
# {{< version 0.2.0 >}} Custom content (HTML format is supported)
|
||||
custom = ''
|
||||
# {{< version 0.2.0 >}} whether to show Hugo and theme info
|
||||
hugo = true
|
||||
# {{< version 0.2.0 >}} whether to show copyright info
|
||||
copyright = true
|
||||
# {{< version 0.2.0 >}} whether to show the author
|
||||
author = true
|
||||
# Site creation time
|
||||
since = 2019
|
||||
# ICP info only in China (HTML format is supported)
|
||||
icp = ""
|
||||
# license info (HTML format is supported)
|
||||
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>'
|
||||
# Home Page Info
|
||||
|
||||
# {{< version 0.2.0 >}} Section (all posts) page config
|
||||
[params.section]
|
||||
# special amount of posts in each section page
|
||||
paginate = 20
|
||||
# date format (month and day)
|
||||
dateFormat = "01-02"
|
||||
|
||||
# {{< version 0.2.0 >}} List (category or tag) page config
|
||||
[params.list]
|
||||
# special amount of posts in each list page
|
||||
paginate = 20
|
||||
# date format (month and day)
|
||||
dateFormat = "01-02"
|
||||
|
||||
# Home page config
|
||||
[params.home]
|
||||
# Home Page Profile
|
||||
# Home page profile
|
||||
[params.home.profile]
|
||||
enable = true
|
||||
# Gravatar Email for preferred avatar in home page
|
||||
|
@ -246,14 +269,15 @@ Note that some of these parameters are explained in details in other sections of
|
|||
social = true
|
||||
# {{< version 0.2.0 >}} disclaimer (HTML format is supported)
|
||||
disclaimer = ""
|
||||
# Home Page Posts
|
||||
# Home page posts
|
||||
[params.home.posts]
|
||||
enable = true
|
||||
# special amount of posts in each home posts page
|
||||
paginate = 6
|
||||
# default behavior when you don't set "hiddenFromHomePage" in front matter
|
||||
# {{< version 0.2.0 deleted >}} default behavior when you don't set "hiddenFromHomePage" in front matter
|
||||
defaultHiddenFromHomePage = false
|
||||
# Social Info in home page
|
||||
|
||||
# Social config about the author
|
||||
[params.social]
|
||||
GitHub = "xxxx"
|
||||
Linkedin = "xxxx"
|
||||
|
@ -320,145 +344,166 @@ Note that some of these parameters are explained in details in other sections of
|
|||
# Matrix = "xxxx"
|
||||
# Bilibili = "xxxx"
|
||||
|
||||
# Page config
|
||||
# {{< version 0.2.0 changed >}} Page config
|
||||
[params.page]
|
||||
# whether to use lightgallery in the page
|
||||
lightgallery = true
|
||||
# whether to show link to Raw Markdown content of the post
|
||||
# {{< version 0.2.0 >}} whether to hide a page from home page
|
||||
hiddenFromHomePage = false
|
||||
# {{< version 0.2.0 >}} whether to hide a page from search results
|
||||
hiddenFromSearch = false
|
||||
# whether to enable lightgallery
|
||||
lightgallery = false
|
||||
# {{< version 0.2.0 >}} whether to show the copy button of the code block
|
||||
copyCode = true
|
||||
# {{< version 0.2.0 >}} whether to enable the ruby extended syntax
|
||||
ruby = true
|
||||
# {{< version 0.2.0 >}} whether to enable the fraction extended syntax
|
||||
fraction = true
|
||||
# {{< version 0.2.0 >}} whether to enable the fontawesome extended syntax
|
||||
fontawesome = true
|
||||
# whether to show link to Raw Markdown content of the content
|
||||
linkToMarkdown = true
|
||||
# {{< link "https://katex.org/" KaTeX >}} mathematical formulas
|
||||
[params.math]
|
||||
enable = true
|
||||
# default block delimiter is $$ ... $$ and \\[ ... \\]
|
||||
blockLeftDelimiter = ""
|
||||
blockRightDelimiter = ""
|
||||
# default inline delimiter is $ ... $ and \\( ... \\)
|
||||
inlineLeftDelimiter = ""
|
||||
inlineRightDelimiter = ""
|
||||
# KaTeX extension copy_tex
|
||||
copyTex = true
|
||||
# KaTeX extension mhchem
|
||||
mhchem = true
|
||||
# {{< version 0.2.0 >}} {{< link "https://docs.mapbox.com/mapbox-gl-js" "Mapbox GL JS" >}} config
|
||||
[params.mapbox]
|
||||
# access token of Mapbox GL JS
|
||||
accessToken = ""
|
||||
# style for the light theme
|
||||
lightStyle = "mapbox://styles/mapbox/light-v9"
|
||||
# style for the dark theme
|
||||
darkStyle = "mapbox://styles/mapbox/dark-v9"
|
||||
# whether to add {{< link "https://docs.mapbox.com/mapbox-gl-js/api/#navigationcontrol" NavigationControl >}}
|
||||
navigation = true
|
||||
# whether to add {{< link "https://docs.mapbox.com/mapbox-gl-js/api/#geolocatecontrol" GeolocateControl >}}
|
||||
geolocate = true
|
||||
# whether to add {{< link "https://docs.mapbox.com/mapbox-gl-js/api/#scalecontrol" ScaleControl >}}
|
||||
scale = true
|
||||
# whether to add {{< link "https://docs.mapbox.com/mapbox-gl-js/api/#fullscreencontrol" FullscreenControl >}}
|
||||
fullscreen = true
|
||||
# Social Share Links in post page
|
||||
[params.share]
|
||||
enable = true
|
||||
Twitter = true
|
||||
Facebook = true
|
||||
Linkedin = true
|
||||
Whatsapp = true
|
||||
Pinterest = true
|
||||
# Tumblr = true
|
||||
HackerNews = true
|
||||
# Reddit = true
|
||||
# VK = true
|
||||
# Buffer = true
|
||||
# Xing = true
|
||||
# Line = true
|
||||
# Instapaper = true
|
||||
# Pocket = true
|
||||
# Digg = true
|
||||
# Stumbleupon = true
|
||||
# Flipboard = true
|
||||
# Weibo = true
|
||||
# Renren = true
|
||||
# Myspace = true
|
||||
# Blogger = true
|
||||
# Baidu = true
|
||||
# Odnoklassniki = true
|
||||
# Evernote = true
|
||||
# Skype = true
|
||||
# Trello = true
|
||||
# Mix = true
|
||||
# Comment Config
|
||||
[params.comment]
|
||||
enable = true
|
||||
# {{< link "https://disqus.com/" Disqus >}} Comment Config
|
||||
[params.comment.disqus]
|
||||
# {{< version 0.1.1 >}}
|
||||
enable = false
|
||||
# Disqus shortname to use Disqus in posts
|
||||
shortname = ""
|
||||
# {{< link "https://github.com/gitalk/gitalk" Gitalk >}} Comment Config
|
||||
[params.comment.gitalk]
|
||||
# {{< version 0.1.1 >}}
|
||||
enable = false
|
||||
owner = ""
|
||||
repo = ""
|
||||
clientId = ""
|
||||
clientSecret = ""
|
||||
# {{< link "https://github.com/xCss/Valine" Valine >}} Comment Config
|
||||
[params.comment.valine]
|
||||
enable = false
|
||||
appId = ""
|
||||
appKey = ""
|
||||
placeholder = "Your comment ..."
|
||||
notify = false
|
||||
verify = true
|
||||
avatar = "mp"
|
||||
meta= ""
|
||||
pageSize = 10
|
||||
lang = "en"
|
||||
visitor = true
|
||||
recordIP = true
|
||||
# {{< link "https://developers.facebook.com/docs/plugins/comments" "Facebook Comment" >}} Config
|
||||
[params.comment.facebook]
|
||||
enable = false
|
||||
width = "100%"
|
||||
numPosts = 10
|
||||
appId = ""
|
||||
languageCode = "en_US"
|
||||
# {{< version 0.2.0 >}} {{< link "https://comments.app/" "Telegram Comments" >}} Config
|
||||
[params.comment.telegram]
|
||||
enable = false
|
||||
siteID = ""
|
||||
limit = 5
|
||||
height = ""
|
||||
color = ""
|
||||
colorful = true
|
||||
dislikes = false
|
||||
outlined = false
|
||||
# {{< version 0.2.0 >}} Table of the contents config
|
||||
[params.page.toc]
|
||||
# whether to enable the table of the contents
|
||||
enable = true
|
||||
# whether to make the table of the contents automatically collapsed
|
||||
auto = true
|
||||
# {{< version 0.2.0 changed >}} {{< link "https://katex.org/" KaTeX >}} mathematical formulas
|
||||
[params.page.math]
|
||||
enable = true
|
||||
# default block delimiter is $$ ... $$ and \\[ ... \\]
|
||||
blockLeftDelimiter = ""
|
||||
blockRightDelimiter = ""
|
||||
# default inline delimiter is $ ... $ and \\( ... \\)
|
||||
inlineLeftDelimiter = ""
|
||||
inlineRightDelimiter = ""
|
||||
# KaTeX extension copy_tex
|
||||
copyTex = true
|
||||
# KaTeX extension mhchem
|
||||
mhchem = true
|
||||
# {{< version 0.2.0 >}} {{< link "https://docs.mapbox.com/mapbox-gl-js" "Mapbox GL JS" >}} config
|
||||
[params.page.mapbox]
|
||||
# access token of Mapbox GL JS
|
||||
accessToken = ""
|
||||
# style for the light theme
|
||||
lightStyle = "mapbox://styles/mapbox/light-v9"
|
||||
# style for the dark theme
|
||||
darkStyle = "mapbox://styles/mapbox/dark-v9"
|
||||
# whether to add {{< link "https://docs.mapbox.com/mapbox-gl-js/api/#navigationcontrol" NavigationControl >}}
|
||||
navigation = true
|
||||
# whether to add {{< link "https://docs.mapbox.com/mapbox-gl-js/api/#geolocatecontrol" GeolocateControl >}}
|
||||
geolocate = true
|
||||
# whether to add {{< link "https://docs.mapbox.com/mapbox-gl-js/api/#scalecontrol" ScaleControl >}}
|
||||
scale = true
|
||||
# whether to add {{< link "https://docs.mapbox.com/mapbox-gl-js/api/#fullscreencontrol" FullscreenControl >}}
|
||||
fullscreen = true
|
||||
# {{< version 0.2.0 changed >}} social share links in post page
|
||||
[params.page.share]
|
||||
enable = true
|
||||
Twitter = true
|
||||
Facebook = true
|
||||
Linkedin = true
|
||||
Whatsapp = true
|
||||
Pinterest = true
|
||||
# Tumblr = true
|
||||
HackerNews = true
|
||||
# Reddit = true
|
||||
# VK = true
|
||||
# Buffer = true
|
||||
# Xing = true
|
||||
# Line = true
|
||||
# Instapaper = true
|
||||
# Pocket = true
|
||||
# Digg = true
|
||||
# Stumbleupon = true
|
||||
# Flipboard = true
|
||||
# Weibo = true
|
||||
# Renren = true
|
||||
# Myspace = true
|
||||
# Blogger = true
|
||||
# Baidu = true
|
||||
# Odnoklassniki = true
|
||||
# Evernote = true
|
||||
# Skype = true
|
||||
# Trello = true
|
||||
# Mix = true
|
||||
# {{< version 0.2.0 changed >}} Comment config
|
||||
[params.page.comment]
|
||||
enable = true
|
||||
# {{< link "https://disqus.com/" Disqus >}} comment config
|
||||
[params.page.comment.disqus]
|
||||
# {{< version 0.1.1 >}}
|
||||
enable = false
|
||||
# Disqus shortname to use Disqus in posts
|
||||
shortname = ""
|
||||
# {{< link "https://github.com/gitalk/gitalk" Gitalk >}} comment config
|
||||
[params.page.comment.gitalk]
|
||||
# {{< version 0.1.1 >}}
|
||||
enable = false
|
||||
owner = ""
|
||||
repo = ""
|
||||
clientId = ""
|
||||
clientSecret = ""
|
||||
# {{< link "https://github.com/xCss/Valine" Valine >}} comment config
|
||||
[params.page.comment.valine]
|
||||
enable = false
|
||||
appId = ""
|
||||
appKey = ""
|
||||
placeholder = ""
|
||||
notify = false
|
||||
verify = true
|
||||
avatar = "mp"
|
||||
meta= ""
|
||||
pageSize = 10
|
||||
lang = ""
|
||||
visitor = true
|
||||
recordIP = true
|
||||
# {{< link "https://developers.facebook.com/docs/plugins/comments" "Facebook comment" >}} config
|
||||
[params.page.comment.facebook]
|
||||
enable = false
|
||||
width = "100%"
|
||||
numPosts = 10
|
||||
appId = ""
|
||||
languageCode = ""
|
||||
# {{< version 0.2.0 >}} {{< link "https://comments.app/" "Telegram comments" >}} config
|
||||
[params.page.comment.telegram]
|
||||
enable = false
|
||||
siteID = ""
|
||||
limit = 5
|
||||
height = ""
|
||||
color = ""
|
||||
colorful = true
|
||||
dislikes = false
|
||||
outlined = false
|
||||
# {{< version 0.2.0 >}} SEO config
|
||||
[params.page.seo]
|
||||
# Publisher info
|
||||
[params.page.seo.publisher]
|
||||
name = "xxxx"
|
||||
[params.page.seo.publisher.logo]
|
||||
url = "logo.png"
|
||||
width = 127
|
||||
height = 40
|
||||
# Logo info
|
||||
[params.page.seo.logo]
|
||||
url = "logo.png"
|
||||
width = 127
|
||||
height = 40
|
||||
# Image info
|
||||
[params.page.seo.image]
|
||||
url = "cover.png"
|
||||
width = 800
|
||||
height = 600
|
||||
|
||||
# site verification code for Google/Bing/Yandex/Pinterest/Baidu
|
||||
# Site verification code config for Google/Bing/Yandex/Pinterest/Baidu
|
||||
[params.verification]
|
||||
google = ""
|
||||
bing = ""
|
||||
yandex = ""
|
||||
pinterest = ""
|
||||
baidu = ""
|
||||
# Publisher Info just for SEO
|
||||
[params.publisher]
|
||||
name = "xxxx"
|
||||
[params.publisher.logo]
|
||||
url = "logo.png"
|
||||
width = 127
|
||||
height = 40
|
||||
# Website Log Info just for SEO
|
||||
[params.logo]
|
||||
url = "logo.png"
|
||||
width = 127
|
||||
height = 40
|
||||
# Website Image Info just for SEO
|
||||
[params.image]
|
||||
url = "cover.png"
|
||||
width = 800
|
||||
height = 600
|
||||
# CSS and JS Files CDN
|
||||
|
||||
# CSS and JS Files CDN config
|
||||
[params.cdn]
|
||||
# {{< version 0.2.0 >}} {{< link "https://github.com/necolas/normalize.css" "normalize.css" >}}@8.0.1
|
||||
normalizeCSS = ''
|
||||
|
@ -513,7 +558,7 @@ Note that some of these parameters are explained in details in other sections of
|
|||
# {{< link "https://valine.js.org/" "valine" >}}@1.3.10
|
||||
valineJS = ''
|
||||
|
||||
# Markup related configuration in Hugo
|
||||
# Markup related config in Hugo
|
||||
[markup]
|
||||
# {{< link "https://gohugo.io/content-management/syntax-highlighting" "Syntax Highlighting" >}}
|
||||
[markup.highlight]
|
||||
|
@ -542,27 +587,26 @@ Note that some of these parameters are explained in details in other sections of
|
|||
startLevel = 2
|
||||
endLevel = 6
|
||||
|
||||
# Author Info
|
||||
# Author config
|
||||
[author]
|
||||
name = "xxxx"
|
||||
link = ""
|
||||
|
||||
# Sitemap Info
|
||||
# Sitemap config
|
||||
[sitemap]
|
||||
changefreq = "weekly"
|
||||
filename = "sitemap.xml"
|
||||
priority = 0.5
|
||||
|
||||
# {{< link "https://gohugo.io/content-management/urls/#permalinks" "Permalinks Info" >}}
|
||||
# {{< link "https://gohugo.io/content-management/urls/#permalinks" "Permalinks config" >}}
|
||||
[Permalinks]
|
||||
# posts = ":year/:month/:filename"
|
||||
posts = ":filename"
|
||||
|
||||
# {{< link "https://gohugo.io/about/hugo-and-gdpr/" "Privacy Info" >}}
|
||||
# {{< link "https://gohugo.io/about/hugo-and-gdpr/" "Privacy config" >}}
|
||||
[privacy]
|
||||
[privacy.googleAnalytics]
|
||||
anonymizeIP = true
|
||||
|
||||
[privacy.youtube]
|
||||
privacyEnhanced = true
|
||||
|
||||
|
|
|
@ -1,38 +1,21 @@
|
|||
---
|
||||
weight: 1
|
||||
title: "Thème Documentation - Concepts de Base"
|
||||
subtitle: ""
|
||||
date: 2020-03-06T21:40:32+08:00
|
||||
lastmod: 2020-03-06T21:40:32+08:00
|
||||
draft: false
|
||||
author: "Dillon"
|
||||
authorLink: "https://dillonzq.com"
|
||||
description: "Découvrez en quoi consiste le thème Hugo - LoveIt et les concepts fondamentaux qui le sous-tendent."
|
||||
license: ""
|
||||
|
||||
tags: ["installation", "configuration"]
|
||||
categories: ["documentation"]
|
||||
hiddenFromHomePage: false
|
||||
|
||||
featuredImage: "/images/theme-documentation-basics/featured-image.jpg"
|
||||
featuredImagePreview: ""
|
||||
|
||||
toc: true
|
||||
autoCollapseToc: false
|
||||
math: false
|
||||
mapbox:
|
||||
accessToken: ""
|
||||
lightStyle: ""
|
||||
darkStyle: ""
|
||||
navigation: true
|
||||
geolocate: true
|
||||
scale: true
|
||||
fullscreen: true
|
||||
toc:
|
||||
auto: false
|
||||
lightgallery: true
|
||||
linkToMarkdown: true
|
||||
share:
|
||||
enable: true
|
||||
comment: true
|
||||
---
|
||||
|
||||
Découvrez en quoi consiste le thème Hugo - **LoveIt** et les concepts fondamentaux qui le sous-tendent.
|
||||
|
@ -55,7 +38,7 @@ Since [Markdown Render Hooks](https://gohugo.io/getting-started/configuration-ma
|
|||
{{< /admonition >}}
|
||||
|
||||
{{< admonition note "Why need the Hugo extended version?" >}}
|
||||
Since this theme processes SCSS to CSS, Hugo needs to be the **extended** version.
|
||||
Since the theme processes SCSS to CSS, Hugo needs to be the **extended** version.
|
||||
{{< /admonition >}}
|
||||
|
||||
## 2 Installation
|
||||
|
@ -107,7 +90,7 @@ theme = "LoveIt"
|
|||
|
||||
[params]
|
||||
# LoveIt theme version
|
||||
version = "0.1.X"
|
||||
version = "0.2.X"
|
||||
|
||||
[menu]
|
||||
[[menu.main]]
|
||||
|
@ -150,7 +133,7 @@ hugo new posts/first_post.md
|
|||
Feel free to edit the post file by adding some sample content and replacing the title value in the beginning of the file.
|
||||
|
||||
{{< admonition >}}
|
||||
By default all posts and pages are created as a draft. If you want to render these pages, remove the property `draft: true` from the metadata or set the property `draft: false`.
|
||||
By default all posts and pages are created as a draft. If you want to render these pages, remove the property `draft: true` from the metadata, set the property `draft: false` or add `-D`/`--buildDrafts` parameter to `hugo` command.
|
||||
{{< /admonition >}}
|
||||
|
||||
### 2.5 Launching the Website Locally
|
||||
|
@ -169,6 +152,15 @@ Go to `http://localhost:1313`.
|
|||
When you run `hugo serve`, when the contents of the files change, the page automatically refreshes with the changes.
|
||||
{{< /admonition >}}
|
||||
|
||||
{{< admonition >}}
|
||||
Since the theme use `.Scratch` in Hugo to implement some features,
|
||||
it is highly recommended that you add `--disableFastRender` parameter to `hugo server` command for the live preview of the page you are editing.
|
||||
|
||||
```bash
|
||||
hugo serve --disableFastRender
|
||||
```
|
||||
{{< /admonition >}}
|
||||
|
||||
### 2.6 Build the Website
|
||||
|
||||
When your site is ready to deploy, run the following command:
|
||||
|
@ -196,8 +188,8 @@ Note that some of these parameters are explained in details in other sections of
|
|||
|
||||
```toml
|
||||
[params]
|
||||
# LoveIt theme version
|
||||
version = "0.1.X"
|
||||
# {{< version 0.2.0 changed >}} LoveIt theme version
|
||||
version = "0.2.X"
|
||||
# site description
|
||||
description = "This is My New Hugo Site"
|
||||
# site keywords
|
||||
|
@ -209,34 +201,65 @@ Note that some of these parameters are explained in details in other sections of
|
|||
# {{< version 0.1.1 >}} which hash function used for SRI, when empty, no SRI is used
|
||||
# ("sha256", "sha384", "sha512", "md5")
|
||||
fingerprint = ""
|
||||
# {{< version 0.2.0 >}} Search
|
||||
# {{< version 0.2.0 >}} date format
|
||||
dateFormat = "2006-01-02"
|
||||
|
||||
# {{< version 0.2.0 >}} Search config
|
||||
[params.search]
|
||||
enable = true
|
||||
# type of search engine ("lunr", "algolia")
|
||||
type = "lunr"
|
||||
# index length of the content
|
||||
contentLength = 5000
|
||||
# placeholder of the search bar
|
||||
placeholder = ""
|
||||
[params.search.algolia]
|
||||
index = ""
|
||||
appID = ""
|
||||
searchKey = ""
|
||||
# Header info
|
||||
|
||||
# Header config
|
||||
[params.header]
|
||||
# desktop header mode ("fixed", "normal", "auto")
|
||||
desktopMode = "fixed"
|
||||
# mobile header mode ("fixed", "normal", "auto")
|
||||
mobileMode = "auto"
|
||||
# Footer Copyright Info
|
||||
|
||||
# Footer config
|
||||
[params.footer]
|
||||
enable = true
|
||||
# {{< version 0.2.0 >}} Custom content (HTML format is supported)
|
||||
custom = ''
|
||||
# {{< version 0.2.0 >}} whether to show Hugo and theme info
|
||||
hugo = true
|
||||
# {{< version 0.2.0 >}} whether to show copyright info
|
||||
copyright = true
|
||||
# {{< version 0.2.0 >}} whether to show the author
|
||||
author = true
|
||||
# Site creation time
|
||||
since = 2019
|
||||
# ICP info only in China (HTML format is supported)
|
||||
icp = ""
|
||||
# license info (HTML format is supported)
|
||||
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>'
|
||||
# Home Page Info
|
||||
|
||||
# {{< version 0.2.0 >}} Section (all posts) page config
|
||||
[params.section]
|
||||
# special amount of posts in each section page
|
||||
paginate = 20
|
||||
# date format (month and day)
|
||||
dateFormat = "01-02"
|
||||
|
||||
# {{< version 0.2.0 >}} List (category or tag) page config
|
||||
[params.list]
|
||||
# special amount of posts in each list page
|
||||
paginate = 20
|
||||
# date format (month and day)
|
||||
dateFormat = "01-02"
|
||||
|
||||
# Home page config
|
||||
[params.home]
|
||||
# Home Page Profile
|
||||
# Home page profile
|
||||
[params.home.profile]
|
||||
enable = true
|
||||
# Gravatar Email for preferred avatar in home page
|
||||
|
@ -251,14 +274,15 @@ Note that some of these parameters are explained in details in other sections of
|
|||
social = true
|
||||
# {{< version 0.2.0 >}} disclaimer (HTML format is supported)
|
||||
disclaimer = ""
|
||||
# Home Page Posts
|
||||
# Home page posts
|
||||
[params.home.posts]
|
||||
enable = true
|
||||
# special amount of posts in each home posts page
|
||||
paginate = 6
|
||||
# default behavior when you don't set "hiddenFromHomePage" in front matter
|
||||
# {{< version 0.2.0 deleted >}} default behavior when you don't set "hiddenFromHomePage" in front matter
|
||||
defaultHiddenFromHomePage = false
|
||||
# Social Info in home page
|
||||
|
||||
# Social config about the author
|
||||
[params.social]
|
||||
GitHub = "xxxx"
|
||||
Linkedin = "xxxx"
|
||||
|
@ -325,145 +349,166 @@ Note that some of these parameters are explained in details in other sections of
|
|||
# Matrix = "xxxx"
|
||||
# Bilibili = "xxxx"
|
||||
|
||||
# Page config
|
||||
# {{< version 0.2.0 changed >}} Page config
|
||||
[params.page]
|
||||
# whether to use lightgallery in the page
|
||||
lightgallery = true
|
||||
# whether to show link to Raw Markdown content of the post
|
||||
# {{< version 0.2.0 >}} whether to hide a page from home page
|
||||
hiddenFromHomePage = false
|
||||
# {{< version 0.2.0 >}} whether to hide a page from search results
|
||||
hiddenFromSearch = false
|
||||
# whether to enable lightgallery
|
||||
lightgallery = false
|
||||
# {{< version 0.2.0 >}} whether to show the copy button of the code block
|
||||
copyCode = true
|
||||
# {{< version 0.2.0 >}} whether to enable the ruby extended syntax
|
||||
ruby = true
|
||||
# {{< version 0.2.0 >}} whether to enable the fraction extended syntax
|
||||
fraction = true
|
||||
# {{< version 0.2.0 >}} whether to enable the fontawesome extended syntax
|
||||
fontawesome = true
|
||||
# whether to show link to Raw Markdown content of the content
|
||||
linkToMarkdown = true
|
||||
# {{< link "https://katex.org/" KaTeX >}} mathematical formulas
|
||||
[params.math]
|
||||
enable = true
|
||||
# default block delimiter is $$ ... $$ and \\[ ... \\]
|
||||
blockLeftDelimiter = ""
|
||||
blockRightDelimiter = ""
|
||||
# default inline delimiter is $ ... $ and \\( ... \\)
|
||||
inlineLeftDelimiter = ""
|
||||
inlineRightDelimiter = ""
|
||||
# KaTeX extension copy_tex
|
||||
copyTex = true
|
||||
# KaTeX extension mhchem
|
||||
mhchem = true
|
||||
# {{< version 0.2.0 >}} {{< link "https://docs.mapbox.com/mapbox-gl-js" "Mapbox GL JS" >}} config
|
||||
[params.mapbox]
|
||||
# access token of Mapbox GL JS
|
||||
accessToken = ""
|
||||
# style for the light theme
|
||||
lightStyle = "mapbox://styles/mapbox/light-v9"
|
||||
# style for the dark theme
|
||||
darkStyle = "mapbox://styles/mapbox/dark-v9"
|
||||
# whether to add {{< link "https://docs.mapbox.com/mapbox-gl-js/api/#navigationcontrol" NavigationControl >}}
|
||||
navigation = true
|
||||
# whether to add {{< link "https://docs.mapbox.com/mapbox-gl-js/api/#geolocatecontrol" GeolocateControl >}}
|
||||
geolocate = true
|
||||
# whether to add {{< link "https://docs.mapbox.com/mapbox-gl-js/api/#scalecontrol" ScaleControl >}}
|
||||
scale = true
|
||||
# whether to add {{< link "https://docs.mapbox.com/mapbox-gl-js/api/#fullscreencontrol" FullscreenControl >}}
|
||||
fullscreen = true
|
||||
# Social Share Links in post page
|
||||
[params.share]
|
||||
enable = true
|
||||
Twitter = true
|
||||
Facebook = true
|
||||
Linkedin = true
|
||||
Whatsapp = true
|
||||
Pinterest = true
|
||||
# Tumblr = true
|
||||
HackerNews = true
|
||||
# Reddit = true
|
||||
# VK = true
|
||||
# Buffer = true
|
||||
# Xing = true
|
||||
# Line = true
|
||||
# Instapaper = true
|
||||
# Pocket = true
|
||||
# Digg = true
|
||||
# Stumbleupon = true
|
||||
# Flipboard = true
|
||||
# Weibo = true
|
||||
# Renren = true
|
||||
# Myspace = true
|
||||
# Blogger = true
|
||||
# Baidu = true
|
||||
# Odnoklassniki = true
|
||||
# Evernote = true
|
||||
# Skype = true
|
||||
# Trello = true
|
||||
# Mix = true
|
||||
# Comment Config
|
||||
[params.comment]
|
||||
enable = true
|
||||
# {{< link "https://disqus.com/" Disqus >}} Comment Config
|
||||
[params.comment.disqus]
|
||||
# {{< version 0.1.1 >}}
|
||||
enable = false
|
||||
# Disqus shortname to use Disqus in posts
|
||||
shortname = ""
|
||||
# {{< link "https://github.com/gitalk/gitalk" Gitalk >}} Comment Config
|
||||
[params.comment.gitalk]
|
||||
# {{< version 0.1.1 >}}
|
||||
enable = false
|
||||
owner = ""
|
||||
repo = ""
|
||||
clientId = ""
|
||||
clientSecret = ""
|
||||
# {{< link "https://github.com/xCss/Valine" Valine >}} Comment Config
|
||||
[params.comment.valine]
|
||||
enable = false
|
||||
appId = ""
|
||||
appKey = ""
|
||||
placeholder = "Your comment ..."
|
||||
notify = false
|
||||
verify = true
|
||||
avatar = "mp"
|
||||
meta= ""
|
||||
pageSize = 10
|
||||
lang = "en"
|
||||
visitor = true
|
||||
recordIP = true
|
||||
# {{< link "https://developers.facebook.com/docs/plugins/comments" "Facebook Comment" >}} Config
|
||||
[params.comment.facebook]
|
||||
enable = false
|
||||
width = "100%"
|
||||
numPosts = 10
|
||||
appId = ""
|
||||
languageCode = "en_US"
|
||||
# {{< version 0.2.0 >}} {{< link "https://comments.app/" "Telegram Comments" >}} Config
|
||||
[params.comment.telegram]
|
||||
enable = false
|
||||
siteID = ""
|
||||
limit = 5
|
||||
height = ""
|
||||
color = ""
|
||||
colorful = true
|
||||
dislikes = false
|
||||
outlined = false
|
||||
# {{< version 0.2.0 >}} Table of the contents config
|
||||
[params.page.toc]
|
||||
# whether to enable the table of the contents
|
||||
enable = true
|
||||
# whether to make the table of the contents automatically collapsed
|
||||
auto = true
|
||||
# {{< version 0.2.0 changed >}} {{< link "https://katex.org/" KaTeX >}} mathematical formulas
|
||||
[params.page.math]
|
||||
enable = true
|
||||
# default block delimiter is $$ ... $$ and \\[ ... \\]
|
||||
blockLeftDelimiter = ""
|
||||
blockRightDelimiter = ""
|
||||
# default inline delimiter is $ ... $ and \\( ... \\)
|
||||
inlineLeftDelimiter = ""
|
||||
inlineRightDelimiter = ""
|
||||
# KaTeX extension copy_tex
|
||||
copyTex = true
|
||||
# KaTeX extension mhchem
|
||||
mhchem = true
|
||||
# {{< version 0.2.0 >}} {{< link "https://docs.mapbox.com/mapbox-gl-js" "Mapbox GL JS" >}} config
|
||||
[params.page.mapbox]
|
||||
# access token of Mapbox GL JS
|
||||
accessToken = ""
|
||||
# style for the light theme
|
||||
lightStyle = "mapbox://styles/mapbox/light-v9"
|
||||
# style for the dark theme
|
||||
darkStyle = "mapbox://styles/mapbox/dark-v9"
|
||||
# whether to add {{< link "https://docs.mapbox.com/mapbox-gl-js/api/#navigationcontrol" NavigationControl >}}
|
||||
navigation = true
|
||||
# whether to add {{< link "https://docs.mapbox.com/mapbox-gl-js/api/#geolocatecontrol" GeolocateControl >}}
|
||||
geolocate = true
|
||||
# whether to add {{< link "https://docs.mapbox.com/mapbox-gl-js/api/#scalecontrol" ScaleControl >}}
|
||||
scale = true
|
||||
# whether to add {{< link "https://docs.mapbox.com/mapbox-gl-js/api/#fullscreencontrol" FullscreenControl >}}
|
||||
fullscreen = true
|
||||
# {{< version 0.2.0 changed >}} social share links in post page
|
||||
[params.page.share]
|
||||
enable = true
|
||||
Twitter = true
|
||||
Facebook = true
|
||||
Linkedin = true
|
||||
Whatsapp = true
|
||||
Pinterest = true
|
||||
# Tumblr = true
|
||||
HackerNews = true
|
||||
# Reddit = true
|
||||
# VK = true
|
||||
# Buffer = true
|
||||
# Xing = true
|
||||
# Line = true
|
||||
# Instapaper = true
|
||||
# Pocket = true
|
||||
# Digg = true
|
||||
# Stumbleupon = true
|
||||
# Flipboard = true
|
||||
# Weibo = true
|
||||
# Renren = true
|
||||
# Myspace = true
|
||||
# Blogger = true
|
||||
# Baidu = true
|
||||
# Odnoklassniki = true
|
||||
# Evernote = true
|
||||
# Skype = true
|
||||
# Trello = true
|
||||
# Mix = true
|
||||
# {{< version 0.2.0 changed >}} Comment config
|
||||
[params.page.comment]
|
||||
enable = true
|
||||
# {{< link "https://disqus.com/" Disqus >}} comment config
|
||||
[params.page.comment.disqus]
|
||||
# {{< version 0.1.1 >}}
|
||||
enable = false
|
||||
# Disqus shortname to use Disqus in posts
|
||||
shortname = ""
|
||||
# {{< link "https://github.com/gitalk/gitalk" Gitalk >}} comment config
|
||||
[params.page.comment.gitalk]
|
||||
# {{< version 0.1.1 >}}
|
||||
enable = false
|
||||
owner = ""
|
||||
repo = ""
|
||||
clientId = ""
|
||||
clientSecret = ""
|
||||
# {{< link "https://github.com/xCss/Valine" Valine >}} comment config
|
||||
[params.page.comment.valine]
|
||||
enable = false
|
||||
appId = ""
|
||||
appKey = ""
|
||||
placeholder = ""
|
||||
notify = false
|
||||
verify = true
|
||||
avatar = "mp"
|
||||
meta= ""
|
||||
pageSize = 10
|
||||
lang = ""
|
||||
visitor = true
|
||||
recordIP = true
|
||||
# {{< link "https://developers.facebook.com/docs/plugins/comments" "Facebook comment" >}} config
|
||||
[params.page.comment.facebook]
|
||||
enable = false
|
||||
width = "100%"
|
||||
numPosts = 10
|
||||
appId = ""
|
||||
languageCode = ""
|
||||
# {{< version 0.2.0 >}} {{< link "https://comments.app/" "Telegram comments" >}} config
|
||||
[params.page.comment.telegram]
|
||||
enable = false
|
||||
siteID = ""
|
||||
limit = 5
|
||||
height = ""
|
||||
color = ""
|
||||
colorful = true
|
||||
dislikes = false
|
||||
outlined = false
|
||||
# {{< version 0.2.0 >}} SEO config
|
||||
[params.page.seo]
|
||||
# Publisher info
|
||||
[params.page.seo.publisher]
|
||||
name = "xxxx"
|
||||
[params.page.seo.publisher.logo]
|
||||
url = "logo.png"
|
||||
width = 127
|
||||
height = 40
|
||||
# Logo info
|
||||
[params.page.seo.logo]
|
||||
url = "logo.png"
|
||||
width = 127
|
||||
height = 40
|
||||
# Image info
|
||||
[params.page.seo.image]
|
||||
url = "cover.png"
|
||||
width = 800
|
||||
height = 600
|
||||
|
||||
# site verification code for Google/Bing/Yandex/Pinterest/Baidu
|
||||
# Site verification code config for Google/Bing/Yandex/Pinterest/Baidu
|
||||
[params.verification]
|
||||
google = ""
|
||||
bing = ""
|
||||
yandex = ""
|
||||
pinterest = ""
|
||||
baidu = ""
|
||||
# Publisher Info just for SEO
|
||||
[params.publisher]
|
||||
name = "xxxx"
|
||||
[params.publisher.logo]
|
||||
url = "logo.png"
|
||||
width = 127
|
||||
height = 40
|
||||
# Website Log Info just for SEO
|
||||
[params.logo]
|
||||
url = "logo.png"
|
||||
width = 127
|
||||
height = 40
|
||||
# Website Image Info just for SEO
|
||||
[params.image]
|
||||
url = "cover.png"
|
||||
width = 800
|
||||
height = 600
|
||||
# CSS and JS Files CDN
|
||||
|
||||
# CSS and JS Files CDN config
|
||||
[params.cdn]
|
||||
# {{< version 0.2.0 >}} {{< link "https://github.com/necolas/normalize.css" "normalize.css" >}}@8.0.1
|
||||
normalizeCSS = ''
|
||||
|
@ -518,7 +563,7 @@ Note that some of these parameters are explained in details in other sections of
|
|||
# {{< link "https://valine.js.org/" "valine" >}}@1.3.10
|
||||
valineJS = ''
|
||||
|
||||
# Markup related configuration in Hugo
|
||||
# Markup related config in Hugo
|
||||
[markup]
|
||||
# {{< link "https://gohugo.io/content-management/syntax-highlighting" "Syntax Highlighting" >}}
|
||||
[markup.highlight]
|
||||
|
@ -547,27 +592,26 @@ Note that some of these parameters are explained in details in other sections of
|
|||
startLevel = 2
|
||||
endLevel = 6
|
||||
|
||||
# Author Info
|
||||
# Author config
|
||||
[author]
|
||||
name = "xxxx"
|
||||
link = ""
|
||||
|
||||
# Sitemap Info
|
||||
# Sitemap config
|
||||
[sitemap]
|
||||
changefreq = "weekly"
|
||||
filename = "sitemap.xml"
|
||||
priority = 0.5
|
||||
|
||||
# {{< link "https://gohugo.io/content-management/urls/#permalinks" "Permalinks Info" >}}
|
||||
# {{< link "https://gohugo.io/content-management/urls/#permalinks" "Permalinks config" >}}
|
||||
[Permalinks]
|
||||
# posts = ":year/:month/:filename"
|
||||
posts = ":filename"
|
||||
|
||||
# {{< link "https://gohugo.io/about/hugo-and-gdpr/" "Privacy Info" >}}
|
||||
# {{< link "https://gohugo.io/about/hugo-and-gdpr/" "Privacy config" >}}
|
||||
[privacy]
|
||||
[privacy.googleAnalytics]
|
||||
anonymizeIP = true
|
||||
|
||||
[privacy.youtube]
|
||||
privacyEnhanced = true
|
||||
|
||||
|
|
|
@ -1,38 +1,21 @@
|
|||
---
|
||||
weight: 1
|
||||
title: "主题文档 - 基本概念"
|
||||
subtitle: ""
|
||||
date: 2020-03-06T21:40:32+08:00
|
||||
lastmod: 2020-03-06T21:40:32+08:00
|
||||
draft: false
|
||||
author: "Dillon"
|
||||
authorLink: "https://dillonzq.com"
|
||||
description: "探索 Hugo - LoveIt 主题的全部内容和背后的核心概念."
|
||||
license: ""
|
||||
|
||||
tags: ["安装", "配置"]
|
||||
categories: ["documentation"]
|
||||
hiddenFromHomePage: false
|
||||
|
||||
featuredImage: "/images/theme-documentation-basics/featured-image.jpg"
|
||||
featuredImagePreview: ""
|
||||
|
||||
toc: true
|
||||
autoCollapseToc: false
|
||||
math: false
|
||||
mapbox:
|
||||
accessToken: ""
|
||||
lightStyle: ""
|
||||
darkStyle: ""
|
||||
navigation: true
|
||||
geolocate: true
|
||||
scale: true
|
||||
fullscreen: true
|
||||
toc:
|
||||
auto: false
|
||||
lightgallery: true
|
||||
linkToMarkdown: true
|
||||
share:
|
||||
enable: true
|
||||
comment: true
|
||||
---
|
||||
|
||||
探索 Hugo - **LoveIt** 主题的全部内容和背后的核心概念.
|
||||
|
@ -105,7 +88,7 @@ theme = "LoveIt"
|
|||
|
||||
[params]
|
||||
# LoveIt 主题版本
|
||||
version = "0.1.X"
|
||||
version = "0.2.X"
|
||||
|
||||
[menu]
|
||||
[[menu.main]]
|
||||
|
@ -148,7 +131,7 @@ hugo new posts/first_post.md
|
|||
通过添加一些示例内容并替换文件开头的标题, 你可以随意编辑文章.
|
||||
|
||||
{{< admonition >}}
|
||||
默认情况下, 所有文章和页面均作为草稿创建. 如果想要渲染这些页面, 请从元数据中删除属性 `draft: true`, 或者设置属性 `draft: false`.
|
||||
默认情况下, 所有文章和页面均作为草稿创建. 如果想要渲染这些页面, 请从元数据中删除属性 `draft: true`, 设置属性 `draft: false` 或者为 `hugo` 命令添加 `-D`/`--buildDrafts` 参数.
|
||||
{{< /admonition >}}
|
||||
|
||||
### 2.5 在本地启动网站
|
||||
|
@ -167,6 +150,15 @@ hugo serve
|
|||
当你运行 `hugo serve` 时, 当文件内容更改时, 页面会随着更改自动刷新.
|
||||
{{< /admonition >}}
|
||||
|
||||
{{< admonition >}}
|
||||
由于本主题使用了 Hugo 中的 `.Scratch` 来实现一些特性,
|
||||
非常建议你为 `hugo server` 命令添加 `--disableFastRender` 参数来实时预览你正在编辑的文章页面.
|
||||
|
||||
```bash
|
||||
hugo serve --disableFastRender
|
||||
```
|
||||
{{< /admonition >}}
|
||||
|
||||
### 2.6 构建网站
|
||||
|
||||
当你准备好部署你的网站时, 运行以下命令:
|
||||
|
@ -194,8 +186,8 @@ hugo
|
|||
|
||||
```toml
|
||||
[params]
|
||||
# LoveIt 主题版本
|
||||
version = "0.1.X"
|
||||
# {{< version 0.2.0 changed >}} LoveIt 主题版本
|
||||
version = "0.2.X"
|
||||
# 网站描述
|
||||
description = "这是我的全新 Hugo 网站"
|
||||
# 网站关键词
|
||||
|
@ -207,34 +199,65 @@ hugo
|
|||
# {{< version 0.1.1 >}} 哪种哈希函数用来 SRI, 为空时表示不使用 SRI
|
||||
# ("sha256", "sha384", "sha512", "md5")
|
||||
fingerprint = ""
|
||||
# {{< version 0.2.0 >}} 搜索
|
||||
# {{< version 0.2.0 >}} 日期格式
|
||||
dateFormat = "2006-01-02"
|
||||
|
||||
# {{< version 0.2.0 >}} 搜索配置
|
||||
[params.search]
|
||||
enable = true
|
||||
# 搜索引擎的类型 ("lunr", "algolia")
|
||||
type = "lunr"
|
||||
# 文章内容索引长度
|
||||
contentLength = 5000
|
||||
# 搜索框的占位提示语
|
||||
placeholder = ""
|
||||
[params.search.algolia]
|
||||
index = ""
|
||||
appID = ""
|
||||
searchKey = ""
|
||||
# 页面头部导航栏信息
|
||||
|
||||
# 页面头部导航栏配置
|
||||
[params.header]
|
||||
# 桌面端导航栏模式 ("fixed", "normal", "auto")
|
||||
desktopMode = "fixed"
|
||||
# 移动端导航栏模式 ("fixed", "normal", "auto")
|
||||
mobileMode = "auto"
|
||||
# 页面底部版权信息设置
|
||||
|
||||
# 页面底部信息配置
|
||||
[params.footer]
|
||||
enable = true
|
||||
# {{< version 0.2.0 >}} 自定义内容 (支持 HTML 格式)
|
||||
custom = ''
|
||||
# {{< version 0.2.0 >}} 是否显示 Hugo 和主题信息
|
||||
hugo = true
|
||||
# {{< version 0.2.0 >}} 是否显示版权信息
|
||||
copyright = true
|
||||
# {{< version 0.2.0 >}} 是否显示作者
|
||||
author = true
|
||||
# 网站创立年份
|
||||
since = 2019
|
||||
# ICP 备案信息,仅在中国使用 (支持 HTML 格式)
|
||||
icp = ""
|
||||
# 许可协议信息 (支持 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>'
|
||||
# 文章页面配置
|
||||
|
||||
# {{< version 0.2.0 >}} Section (所有文章) 页面配置
|
||||
[params.section]
|
||||
# section 页面每页显示文章数量
|
||||
paginate = 20
|
||||
# 日期格式 (月和日)
|
||||
dateFormat = "01-02"
|
||||
|
||||
# {{< version 0.2.0 >}} List (目录或标签) 页面配置
|
||||
[params.list]
|
||||
# list 页面每页显示文章数量
|
||||
paginate = 20
|
||||
# 日期格式 (月和日)
|
||||
dateFormat = "01-02"
|
||||
|
||||
# 主页配置
|
||||
[params.home]
|
||||
# 主页信息设置
|
||||
# 主页个人信息
|
||||
[params.home.profile]
|
||||
enable = true
|
||||
# Gravatar 邮箱,用于优先在主页显示的头像
|
||||
|
@ -254,9 +277,10 @@ hugo
|
|||
enable = true
|
||||
# 主页每页显示文章数量
|
||||
paginate = 6
|
||||
# 当你没有在文章前置参数中设置 "hiddenFromHomePage" 时的默认行为
|
||||
# {{< version 0.2.0 deleted >}} 当你没有在文章前置参数中设置 "hiddenFromHomePage" 时的默认行为
|
||||
defaultHiddenFromHomePage = false
|
||||
# 主页的社交信息设置
|
||||
|
||||
# 作者的社交信息设置
|
||||
[params.social]
|
||||
GitHub = "xxxx"
|
||||
# Linkedin = "xxxx"
|
||||
|
@ -322,119 +346,157 @@ hugo
|
|||
# XMPP = "xxxx"
|
||||
# Matrix = "xxxx"
|
||||
Bilibili = "xxxx"
|
||||
# 文章页面配置
|
||||
|
||||
# {{< version 0.2.0 changed >}} 文章页面配置
|
||||
[params.page]
|
||||
# {{< version 0.2.0 >}} 是否在主页隐藏一篇文章
|
||||
hiddenFromHomePage = false
|
||||
# {{< version 0.2.0 >}} 是否在搜索结果中隐藏一篇文章
|
||||
hiddenFromSearch = false
|
||||
# 是否在文章页面使用 lightgallery
|
||||
lightgallery = true
|
||||
# {{< version 0.2.0 >}} 是否显示代码块的复制按钮
|
||||
copyCode = true
|
||||
# {{< version 0.2.0 >}} 是否使用 ruby 扩展语法
|
||||
ruby = true
|
||||
# {{< version 0.2.0 >}} 是否使用 fraction 扩展语法
|
||||
fraction = true
|
||||
# {{< version 0.2.0 >}} 是否使用 fontawesome 扩展语法
|
||||
fontawesome = true
|
||||
# 是否在文章页面显示原始 Markdown 文档链接
|
||||
linkToMarkdown = true
|
||||
# {{< link "https://katex.org/" KaTeX >}} 数学公式
|
||||
[params.math]
|
||||
enable = true
|
||||
# 默认块定界符是 $$ ... $$ 和 \\[ ... \\]
|
||||
blockLeftDelimiter = ""
|
||||
blockRightDelimiter = ""
|
||||
# 默认内联定界符是 $ ... $ 和 \\( ... \\)
|
||||
inlineLeftDelimiter = ""
|
||||
inlineRightDelimiter = ""
|
||||
# KaTeX 插件 copy_tex
|
||||
copyTex = true
|
||||
# KaTeX 插件 mhchem
|
||||
mhchem = true
|
||||
# {{< version 0.2.0 >}} {{< link "https://docs.mapbox.com/mapbox-gl-js" "Mapbox GL JS" >}} 配置
|
||||
[params.mapbox]
|
||||
# Mapbox GL JS 的 access token
|
||||
accessToken = ""
|
||||
# 浅色主题的地图样式
|
||||
lightStyle = "mapbox://styles/mapbox/light-v9"
|
||||
# 深色主题的地图样式
|
||||
darkStyle = "mapbox://styles/mapbox/dark-v9"
|
||||
# 是否添加 {{< link "https://docs.mapbox.com/mapbox-gl-js/api/#navigationcontrol" NavigationControl >}}
|
||||
navigation = true
|
||||
# 是否添加 {{< link "https://docs.mapbox.com/mapbox-gl-js/api/#geolocatecontrol" GeolocateControl >}}
|
||||
geolocate = true
|
||||
# 是否添加 {{< link "https://docs.mapbox.com/mapbox-gl-js/api/#scalecontrol" ScaleControl >}}
|
||||
scale = true
|
||||
# 是否添加 {{< link "https://docs.mapbox.com/mapbox-gl-js/api/#fullscreencontrol" FullscreenControl >}}
|
||||
fullscreen = true
|
||||
# 文章页面的分享信息设置
|
||||
[params.share]
|
||||
enable = true
|
||||
Twitter = true
|
||||
Facebook = true
|
||||
# Linkedin = true
|
||||
# Whatsapp = true
|
||||
# Pinterest = true
|
||||
# Tumblr = true
|
||||
# HackerNews = true
|
||||
# Reddit = true
|
||||
# VK = true
|
||||
# Buffer = true
|
||||
# Xing = true
|
||||
# Line = true
|
||||
# Instapaper = true
|
||||
# Pocket = true
|
||||
# Digg = true
|
||||
# Stumbleupon = true
|
||||
# Flipboard = true
|
||||
Weibo = true
|
||||
# Renren = true
|
||||
# Myspace = true
|
||||
# Blogger = true
|
||||
# Baidu = true
|
||||
# Odnoklassniki = true
|
||||
Evernote = true
|
||||
# Skype = true
|
||||
# Trello = true
|
||||
# Mix = true
|
||||
# 评论系统设置
|
||||
[params.comment]
|
||||
enable = true
|
||||
# {{< link "https://disqus.com/" Disqus >}} 评论系统设置
|
||||
[params.comment.disqus]
|
||||
# {{< version 0.1.1 >}}
|
||||
enable = false
|
||||
# Disqus 的 shortname,用来在文章中启用 Disqus 评论系统
|
||||
shortname = ""
|
||||
# {{< link "https://github.com/gitalk/gitalk" Gitalk >}} 评论系统设置
|
||||
[params.comment.gitalk]
|
||||
# {{< version 0.1.1 >}}
|
||||
enable = false
|
||||
owner = ""
|
||||
repo = ""
|
||||
clientId = ""
|
||||
clientSecret = ""
|
||||
# {{< link "https://github.com/xCss/Valine" Valine >}} 评论系统设置
|
||||
[params.comment.valine]
|
||||
enable = false
|
||||
appId = ""
|
||||
appKey = ""
|
||||
placeholder = "Your comment ..."
|
||||
notify = false
|
||||
verify = true
|
||||
avatar = "mp"
|
||||
meta= ""
|
||||
pageSize = 10
|
||||
lang = "en"
|
||||
visitor = true
|
||||
recordIP = true
|
||||
# # {{< link "https://developers.facebook.com/docs/plugins/comments" "Facebook 评论系统" >}}设置
|
||||
[params.comment.facebook]
|
||||
enable = false
|
||||
width = "100%"
|
||||
numPosts = 10
|
||||
appId = ""
|
||||
languageCode = "zh_CN"
|
||||
# {{< version 0.2.0 >}} {{< link "https://comments.app/" "Telegram Comments" >}} 评论系统设置
|
||||
[params.comment.telegram]
|
||||
enable = false
|
||||
siteID = ""
|
||||
limit = 5
|
||||
height = ""
|
||||
color = ""
|
||||
colorful = true
|
||||
dislikes = false
|
||||
outlined = false
|
||||
# {{< version 0.2.0 >}} 目录配置
|
||||
[params.page.toc]
|
||||
# 是否使用目录
|
||||
enable = true
|
||||
# 是否使目录自动折叠展开
|
||||
auto = true
|
||||
# {{< version 0.2.0 changed >}} {{< link "https://katex.org/" KaTeX >}} 数学公式
|
||||
[params.page.math]
|
||||
enable = true
|
||||
# 默认块定界符是 $$ ... $$ 和 \\[ ... \\]
|
||||
blockLeftDelimiter = ""
|
||||
blockRightDelimiter = ""
|
||||
# 默认内联定界符是 $ ... $ 和 \\( ... \\)
|
||||
inlineLeftDelimiter = ""
|
||||
inlineRightDelimiter = ""
|
||||
# KaTeX 插件 copy_tex
|
||||
copyTex = true
|
||||
# KaTeX 插件 mhchem
|
||||
mhchem = true
|
||||
# {{< version 0.2.0 >}} {{< link "https://docs.mapbox.com/mapbox-gl-js" "Mapbox GL JS" >}} 配置
|
||||
[params.page.mapbox]
|
||||
# Mapbox GL JS 的 access token
|
||||
accessToken = ""
|
||||
# 浅色主题的地图样式
|
||||
lightStyle = "mapbox://styles/mapbox/light-v9"
|
||||
# 深色主题的地图样式
|
||||
darkStyle = "mapbox://styles/mapbox/dark-v9"
|
||||
# 是否添加 {{< link "https://docs.mapbox.com/mapbox-gl-js/api/#navigationcontrol" NavigationControl >}}
|
||||
navigation = true
|
||||
# 是否添加 {{< link "https://docs.mapbox.com/mapbox-gl-js/api/#geolocatecontrol" GeolocateControl >}}
|
||||
geolocate = true
|
||||
# 是否添加 {{< link "https://docs.mapbox.com/mapbox-gl-js/api/#scalecontrol" ScaleControl >}}
|
||||
scale = true
|
||||
# 是否添加 {{< link "https://docs.mapbox.com/mapbox-gl-js/api/#fullscreencontrol" FullscreenControl >}}
|
||||
fullscreen = true
|
||||
# {{< version 0.2.0 changed >}} 文章页面的分享信息设置
|
||||
[params.page.share]
|
||||
enable = true
|
||||
Twitter = true
|
||||
Facebook = true
|
||||
# Linkedin = true
|
||||
# Whatsapp = true
|
||||
# Pinterest = true
|
||||
# Tumblr = true
|
||||
# HackerNews = true
|
||||
# Reddit = true
|
||||
# VK = true
|
||||
# Buffer = true
|
||||
# Xing = true
|
||||
# Line = true
|
||||
# Instapaper = true
|
||||
# Pocket = true
|
||||
# Digg = true
|
||||
# Stumbleupon = true
|
||||
# Flipboard = true
|
||||
Weibo = true
|
||||
# Renren = true
|
||||
# Myspace = true
|
||||
# Blogger = true
|
||||
# Baidu = true
|
||||
# Odnoklassniki = true
|
||||
Evernote = true
|
||||
# Skype = true
|
||||
# Trello = true
|
||||
# Mix = true
|
||||
# {{< version 0.2.0 changed >}} 评论系统设置
|
||||
[params.page.comment]
|
||||
enable = true
|
||||
# {{< link "https://disqus.com/" Disqus >}} 评论系统设置
|
||||
[params.page.comment.disqus]
|
||||
# {{< version 0.1.1 >}}
|
||||
enable = false
|
||||
# Disqus 的 shortname,用来在文章中启用 Disqus 评论系统
|
||||
shortname = ""
|
||||
# {{< link "https://github.com/gitalk/gitalk" Gitalk >}} 评论系统设置
|
||||
[params.page.comment.gitalk]
|
||||
# {{< version 0.1.1 >}}
|
||||
enable = false
|
||||
owner = ""
|
||||
repo = ""
|
||||
clientId = ""
|
||||
clientSecret = ""
|
||||
# {{< link "https://github.com/xCss/Valine" Valine >}} 评论系统设置
|
||||
[params.page.comment.valine]
|
||||
enable = false
|
||||
appId = ""
|
||||
appKey = ""
|
||||
placeholder = "Your comment ..."
|
||||
notify = false
|
||||
verify = true
|
||||
avatar = "mp"
|
||||
meta= ""
|
||||
pageSize = 10
|
||||
lang = "en"
|
||||
visitor = true
|
||||
recordIP = true
|
||||
# {{< link "https://developers.facebook.com/docs/plugins/comments" "Facebook 评论系统" >}}设置
|
||||
[params.page.comment.facebook]
|
||||
enable = false
|
||||
width = "100%"
|
||||
numPosts = 10
|
||||
appId = ""
|
||||
languageCode = "zh_CN"
|
||||
# {{< version 0.2.0 >}} {{< link "https://comments.app/" "Telegram Comments" >}} 评论系统设置
|
||||
[params.page.comment.telegram]
|
||||
enable = false
|
||||
siteID = ""
|
||||
limit = 5
|
||||
height = ""
|
||||
color = ""
|
||||
colorful = true
|
||||
dislikes = false
|
||||
outlined = false
|
||||
# {{< version 0.2.0 >}} SEO config
|
||||
[params.page.seo]
|
||||
# 出版者信息
|
||||
[params.page.seo.publisher]
|
||||
name = "xxxx"
|
||||
[params.page.seo.publisher.logo]
|
||||
url = "logo.png"
|
||||
width = 127
|
||||
height = 40
|
||||
# Logo 信息
|
||||
[params.page.seo.logo]
|
||||
url = "logo.png"
|
||||
width = 127
|
||||
height = 40
|
||||
# 图片信息
|
||||
[params.page.seo.image]
|
||||
url = "cover.png"
|
||||
width = 800
|
||||
height = 600
|
||||
|
||||
# 网站验证代码,用于 Google/Bing/Yandex/Pinterest/Baidu
|
||||
[params.verification]
|
||||
|
@ -443,23 +505,7 @@ hugo
|
|||
yandex = ""
|
||||
pinterest = ""
|
||||
baidu = ""
|
||||
# 出版者信息,仅用于 SEO
|
||||
[params.publisher]
|
||||
name = "xxxx"
|
||||
[params.publisher.logo]
|
||||
url = "logo.png"
|
||||
width = 127
|
||||
height = 40
|
||||
# 网站 Logo 信息,仅用于 SEO
|
||||
[params.logo]
|
||||
url = "logo.png"
|
||||
width = 127
|
||||
height = 40
|
||||
# 网站图标信息,仅用于 SEO
|
||||
[params.image]
|
||||
url = "cover.png"
|
||||
width = 800
|
||||
height = 600
|
||||
|
||||
# CSS 和 JS 文件的 CDN 设置
|
||||
[params.cdn]
|
||||
# {{< version 0.2.0 >}} {{< link "https://github.com/necolas/normalize.css" "normalize.css" >}}@8.0.1
|
||||
|
@ -544,27 +590,26 @@ hugo
|
|||
startLevel = 2
|
||||
endLevel = 6
|
||||
|
||||
# 作者信息
|
||||
# 作者配置
|
||||
[author]
|
||||
name = "xxxx"
|
||||
link = ""
|
||||
|
||||
# 网站地图信息
|
||||
# 网站地图配置
|
||||
[sitemap]
|
||||
changefreq = "weekly"
|
||||
filename = "sitemap.xml"
|
||||
priority = 0.5
|
||||
|
||||
# {{< link "https://gohugo.io/content-management/urls/#permalinks" "Permalinks 信息" >}}
|
||||
# {{< link "https://gohugo.io/content-management/urls/#permalinks" "Permalinks 配置" >}}
|
||||
[Permalinks]
|
||||
# posts = ":year/:month/:filename"
|
||||
posts = ":filename"
|
||||
|
||||
# {{< link "https://gohugo.io/about/hugo-and-gdpr/" "隐私信息设置" >}}
|
||||
# {{< link "https://gohugo.io/about/hugo-and-gdpr/" "隐私信息配置" >}}
|
||||
[privacy]
|
||||
[privacy.googleAnalytics]
|
||||
anonymizeIP = true
|
||||
|
||||
[privacy.youtube]
|
||||
privacyEnhanced = true
|
||||
|
||||
|
|
|
@ -1,38 +1,19 @@
|
|||
---
|
||||
weight: 3
|
||||
title: "Theme Documentation - Built-in Shortcodes"
|
||||
subtitle: ""
|
||||
date: 2020-03-04T16:29:41+08:00
|
||||
lastmod: 2020-03-04T16:29:41+08:00
|
||||
draft: false
|
||||
author: "Dillon"
|
||||
authorLink: "https://dillonzq.com"
|
||||
description: "Hugo provides multiple built-in shortcodes for author convenience and to keep your markdown content clean."
|
||||
license: ""
|
||||
|
||||
tags: ["shortcodes"]
|
||||
categories: ["documentation"]
|
||||
hiddenFromHomePage: false
|
||||
|
||||
featuredImage: "/images/theme-documentation-built-in-shortcodes/featured-image.png"
|
||||
featuredImagePreview: ""
|
||||
|
||||
toc: true
|
||||
autoCollapseToc: true
|
||||
math: false
|
||||
mapbox:
|
||||
accessToken: ""
|
||||
lightStyle: ""
|
||||
darkStyle: ""
|
||||
navigation: true
|
||||
geolocate: true
|
||||
scale: true
|
||||
fullscreen: true
|
||||
lightgallery: true
|
||||
linkToMarkdown: true
|
||||
share:
|
||||
enable: true
|
||||
comment: true
|
||||
---
|
||||
|
||||
**Hugo** provides multiple built-in shortcodes for author convenience and to keep your markdown content clean.
|
||||
|
@ -48,7 +29,7 @@ A shortcode is a simple snippet that can generate reasonable HTML code and confo
|
|||
|
||||
Hugo ships with a set of predefined shortcodes that represent very common usage. These shortcodes are provided for author convenience and to keep your markdown content clean.
|
||||
|
||||
## `figure` {#figure}
|
||||
## figure {#figure}
|
||||
|
||||
[Documentation of `figure`](https://gohugo.io/content-management/shortcodes/#figure)
|
||||
|
||||
|
@ -73,7 +54,7 @@ The HTML looks like this:
|
|||
</figure>
|
||||
```
|
||||
|
||||
## `gist`
|
||||
## gist
|
||||
|
||||
[Documentation of `gist`](https://gohugo.io/content-management/shortcodes/#gist)
|
||||
|
||||
|
@ -93,7 +74,7 @@ The HTML looks like this:
|
|||
<script type="application/javascript" src="https://gist.github.com/spf13/7896402.js"></script>
|
||||
```
|
||||
|
||||
## `highlight`
|
||||
## highlight
|
||||
|
||||
[Documentation of `highlight`](https://gohugo.io/content-management/shortcodes/#instagram)
|
||||
|
||||
|
@ -125,7 +106,7 @@ The rendered output looks like this:
|
|||
</section>
|
||||
{{< /highlight >}}
|
||||
|
||||
## `instagram`
|
||||
## instagram
|
||||
|
||||
[Documentation of `instagram`](https://gohugo.io/content-management/shortcodes/#instagram)
|
||||
|
||||
|
@ -139,7 +120,7 @@ The rendered output looks like this:
|
|||
|
||||
{{< instagram BWNjjyYFxVx hidecaption >}}
|
||||
|
||||
## `param`
|
||||
## param
|
||||
|
||||
[Documentation of `param`](https://gohugo.io/content-management/shortcodes/#param)
|
||||
|
||||
|
@ -153,11 +134,11 @@ The rendered output looks like this:
|
|||
|
||||
{{< param description >}}
|
||||
|
||||
## `ref` and `relref` {#ref-and-relref}
|
||||
## ref and relref {#ref-and-relref}
|
||||
|
||||
[Documentation of `ref` and `relref`](https://gohugo.io/content-management/shortcodes/#ref-and-relref)
|
||||
|
||||
## `tweet`
|
||||
## tweet
|
||||
|
||||
[Documentation of `tweet`](https://gohugo.io/content-management/shortcodes/#tweet)
|
||||
|
||||
|
@ -171,7 +152,7 @@ The rendered output looks like this:
|
|||
|
||||
{{< tweet 877500564405444608 >}}
|
||||
|
||||
## `vimeo`
|
||||
## vimeo
|
||||
|
||||
[Documentation of `vimeo`](https://gohugo.io/content-management/shortcodes/#vimeo)
|
||||
|
||||
|
@ -185,7 +166,7 @@ The rendered output looks like this:
|
|||
|
||||
{{< vimeo 146022717 >}}
|
||||
|
||||
## `youtube`
|
||||
## youtube
|
||||
|
||||
[Documentation of `youtube`](https://gohugo.io/content-management/shortcodes/#youtube)
|
||||
|
||||
|
|
|
@ -1,38 +1,19 @@
|
|||
---
|
||||
weight: 3
|
||||
title: "Thème Documentation - Built-in Shortcodes"
|
||||
subtitle: ""
|
||||
date: 2020-03-04T16:29:59+08:00
|
||||
lastmod: 2020-03-04T16:29:59+08:00
|
||||
draft: false
|
||||
author: "Dillon"
|
||||
authorLink: "https://dillonzq.com"
|
||||
description: "Hugo fournit plusieurs shortcodes intégrés pour la commodité de l'auteur et pour garder votre contenu de démarque propre."
|
||||
license: ""
|
||||
|
||||
tags: ["shortcodes"]
|
||||
categories: ["documentation"]
|
||||
hiddenFromHomePage: false
|
||||
|
||||
featuredImage: "/images/theme-documentation-built-in-shortcodes/featured-image.png"
|
||||
featuredImagePreview: ""
|
||||
|
||||
toc: true
|
||||
autoCollapseToc: true
|
||||
math: false
|
||||
mapbox:
|
||||
accessToken: ""
|
||||
lightStyle: ""
|
||||
darkStyle: ""
|
||||
navigation: true
|
||||
geolocate: true
|
||||
scale: true
|
||||
fullscreen: true
|
||||
lightgallery: true
|
||||
linkToMarkdown: true
|
||||
share:
|
||||
enable: true
|
||||
comment: true
|
||||
---
|
||||
|
||||
**Hugo** fournit plusieurs shortcodes intégrés pour la commodité de l'auteur et pour garder votre contenu de démarque propre.
|
||||
|
@ -53,7 +34,7 @@ A shortcode is a simple snippet that can generate reasonable HTML code and confo
|
|||
|
||||
Hugo ships with a set of predefined shortcodes that represent very common usage. These shortcodes are provided for author convenience and to keep your markdown content clean.
|
||||
|
||||
## `figure` {#figure}
|
||||
## figure {#figure}
|
||||
|
||||
[Documentation of `figure`](https://gohugo.io/content-management/shortcodes/#figure)
|
||||
|
||||
|
@ -78,7 +59,7 @@ The HTML looks like this:
|
|||
</figure>
|
||||
```
|
||||
|
||||
## `gist`
|
||||
## gist
|
||||
|
||||
[Documentation of `gist`](https://gohugo.io/content-management/shortcodes/#gist)
|
||||
|
||||
|
@ -98,7 +79,7 @@ The HTML looks like this:
|
|||
<script type="application/javascript" src="https://gist.github.com/spf13/7896402.js"></script>
|
||||
```
|
||||
|
||||
## `highlight`
|
||||
## highlight
|
||||
|
||||
[Documentation of `highlight`](https://gohugo.io/content-management/shortcodes/#instagram)
|
||||
|
||||
|
@ -130,7 +111,7 @@ The rendered output looks like this:
|
|||
</section>
|
||||
{{< /highlight >}}
|
||||
|
||||
## `instagram`
|
||||
## instagram
|
||||
|
||||
[Documentation of `instagram`](https://gohugo.io/content-management/shortcodes/#instagram)
|
||||
|
||||
|
@ -144,7 +125,7 @@ The rendered output looks like this:
|
|||
|
||||
{{< instagram BWNjjyYFxVx hidecaption >}}
|
||||
|
||||
## `param`
|
||||
## param
|
||||
|
||||
[Documentation of `param`](https://gohugo.io/content-management/shortcodes/#param)
|
||||
|
||||
|
@ -158,11 +139,11 @@ The rendered output looks like this:
|
|||
|
||||
{{< param description >}}
|
||||
|
||||
## `ref` and `relref` {#ref-and-relref}
|
||||
## ref and relref {#ref-and-relref}
|
||||
|
||||
[Documentation of `ref` and `relref`](https://gohugo.io/content-management/shortcodes/#ref-and-relref)
|
||||
|
||||
## `tweet`
|
||||
## tweet
|
||||
|
||||
[Documentation of `tweet`](https://gohugo.io/content-management/shortcodes/#tweet)
|
||||
|
||||
|
@ -176,7 +157,7 @@ The rendered output looks like this:
|
|||
|
||||
{{< tweet 877500564405444608 >}}
|
||||
|
||||
## `vimeo`
|
||||
## vimeo
|
||||
|
||||
[Documentation of `vimeo`](https://gohugo.io/content-management/shortcodes/#vimeo)
|
||||
|
||||
|
@ -190,7 +171,7 @@ The rendered output looks like this:
|
|||
|
||||
{{< vimeo 146022717 >}}
|
||||
|
||||
## `youtube`
|
||||
## youtube
|
||||
|
||||
[Documentation of `youtube`](https://gohugo.io/content-management/shortcodes/#youtube)
|
||||
|
||||
|
|
|
@ -1,38 +1,19 @@
|
|||
---
|
||||
weight: 3
|
||||
title: "主题文档 - 内置 Shortcodes"
|
||||
subtitle: ""
|
||||
date: 2020-03-04T16:29:59+08:00
|
||||
lastmod: 2020-03-04T16:29:59+08:00
|
||||
draft: false
|
||||
author: "Dillon"
|
||||
authorLink: "https://dillonzq.com"
|
||||
description: "Hugo 提供了多个内置的 Shortcodes, 以方便作者保持 Markdown 内容的整洁."
|
||||
license: ""
|
||||
|
||||
tags: ["shortcodes"]
|
||||
categories: ["documentation"]
|
||||
hiddenFromHomePage: false
|
||||
|
||||
featuredImage: "/images/theme-documentation-built-in-shortcodes/featured-image.png"
|
||||
featuredImagePreview: ""
|
||||
|
||||
toc: true
|
||||
autoCollapseToc: true
|
||||
math: false
|
||||
mapbox:
|
||||
accessToken: ""
|
||||
lightStyle: ""
|
||||
darkStyle: ""
|
||||
navigation: true
|
||||
geolocate: true
|
||||
scale: true
|
||||
fullscreen: true
|
||||
lightgallery: true
|
||||
linkToMarkdown: true
|
||||
share:
|
||||
enable: true
|
||||
comment: true
|
||||
---
|
||||
|
||||
**Hugo** 提供了多个内置的 Shortcodes, 以方便作者保持 Markdown 内容的整洁.
|
||||
|
@ -49,7 +30,7 @@ shortcode 是一个简单代码段, 可以生成合理的 HTML 代码, 并且符
|
|||
Hugo 附带了一组预定义的 shortcodes, 它们实现了一些非常常见的用法.
|
||||
提供这些 shortcodes 是为了方便保持你的 Markdown 内容简洁.
|
||||
|
||||
## `figure` {#figure}
|
||||
## figure {#figure}
|
||||
|
||||
[`figure` 的文档](https://gohugo.io/content-management/shortcodes/#figure)
|
||||
|
||||
|
@ -74,7 +55,7 @@ Hugo 附带了一组预定义的 shortcodes, 它们实现了一些非常常见
|
|||
</figure>
|
||||
```
|
||||
|
||||
## `gist`
|
||||
## gist
|
||||
|
||||
[`gist` 的文档](https://gohugo.io/content-management/shortcodes/#gist)
|
||||
|
||||
|
@ -94,7 +75,7 @@ Hugo 附带了一组预定义的 shortcodes, 它们实现了一些非常常见
|
|||
<script type="application/javascript" src="https://gist.github.com/spf13/7896402.js"></script>
|
||||
```
|
||||
|
||||
## `highlight`
|
||||
## highlight
|
||||
|
||||
[`highlight` 的文档](https://gohugo.io/content-management/shortcodes/#instagram)
|
||||
|
||||
|
@ -126,7 +107,7 @@ Hugo 附带了一组预定义的 shortcodes, 它们实现了一些非常常见
|
|||
</section>
|
||||
{{< /highlight >}}
|
||||
|
||||
## `instagram`
|
||||
## instagram
|
||||
|
||||
[`instagram` 的文档](https://gohugo.io/content-management/shortcodes/#instagram)
|
||||
|
||||
|
@ -140,7 +121,7 @@ Hugo 附带了一组预定义的 shortcodes, 它们实现了一些非常常见
|
|||
|
||||
{{< instagram BWNjjyYFxVx hidecaption >}}
|
||||
|
||||
## `param`
|
||||
## param
|
||||
|
||||
[`param` 的文档](https://gohugo.io/content-management/shortcodes/#param)
|
||||
|
||||
|
@ -154,11 +135,11 @@ Hugo 附带了一组预定义的 shortcodes, 它们实现了一些非常常见
|
|||
|
||||
{{< param description >}}
|
||||
|
||||
## `ref` 和 `relref` {#ref-and-relref}
|
||||
## ref 和 relref {#ref-and-relref}
|
||||
|
||||
[`ref` 和 `relref` 的文档](https://gohugo.io/content-management/shortcodes/#ref-and-relref)
|
||||
|
||||
## `tweet`
|
||||
## tweet
|
||||
|
||||
[`tweet` 的文档](https://gohugo.io/content-management/shortcodes/#tweet)
|
||||
|
||||
|
@ -172,7 +153,7 @@ Hugo 附带了一组预定义的 shortcodes, 它们实现了一些非常常见
|
|||
|
||||
{{< tweet 877500564405444608 >}}
|
||||
|
||||
## `vimeo`
|
||||
## vimeo
|
||||
|
||||
[`vimeo` 的文档](https://gohugo.io/content-management/shortcodes/#vimeo)
|
||||
|
||||
|
@ -186,7 +167,7 @@ Hugo 附带了一组预定义的 shortcodes, 它们实现了一些非常常见
|
|||
|
||||
{{< vimeo 146022717 >}}
|
||||
|
||||
## `youtube`
|
||||
## youtube
|
||||
|
||||
[`youtube` 的文档](https://gohugo.io/content-management/shortcodes/#youtube)
|
||||
|
||||
|
|
|
@ -1,38 +1,23 @@
|
|||
---
|
||||
weight: 2
|
||||
title: "Theme Documentation - Content"
|
||||
subtitle: ""
|
||||
date: 2020-03-05T15:58:26+08:00
|
||||
lastmod: 2020-03-05T15:58:26+08:00
|
||||
draft: false
|
||||
author: "Dillon"
|
||||
authorLink: "https://dillonzq.com"
|
||||
description: "Find out how to create and organize your content quickly and intuitively in LoveIt theme."
|
||||
license: ""
|
||||
|
||||
tags: ["content", "markdown"]
|
||||
categories: ["documentation"]
|
||||
hiddenFromHomePage: false
|
||||
|
||||
featuredImage: "/images/theme-documentation-content/featured-image.jpg"
|
||||
featuredImagePreview: ""
|
||||
|
||||
toc: true
|
||||
autoCollapseToc: false
|
||||
math: true
|
||||
mapbox:
|
||||
accessToken: ""
|
||||
lightStyle: ""
|
||||
darkStyle: ""
|
||||
navigation: true
|
||||
geolocate: true
|
||||
scale: true
|
||||
fullscreen: true
|
||||
lightgallery: true
|
||||
linkToMarkdown: true
|
||||
share:
|
||||
toc:
|
||||
auto: false
|
||||
math:
|
||||
enable: true
|
||||
comment: true
|
||||
lightgallery: true
|
||||
---
|
||||
|
||||
Find out how to create and organize your content quickly and intuitively in **LoveIt** theme.
|
||||
|
@ -51,7 +36,12 @@ A few suggestions to help you get a good looking site quickly:
|
|||
|
||||
**Hugo** allows you to add front matter in `yaml`, `toml` or `json` to your content files.
|
||||
|
||||
Here is a default front matter from the default archetype:
|
||||
{{< admonition >}}
|
||||
**Not all** of the below front matters need to be set in each of your posts.
|
||||
It is necessary only if the front matters and the `page` part in your [site configuration](../theme-documentation-basics/#site-configuration) are inconsistent.
|
||||
{{< /admonition >}}
|
||||
|
||||
Here is a front matter example:
|
||||
|
||||
```yaml
|
||||
---
|
||||
|
@ -67,28 +57,33 @@ license: ""
|
|||
|
||||
tags: []
|
||||
categories: []
|
||||
hiddenFromHomePage: false
|
||||
hiddenFromSearch: false
|
||||
|
||||
featuredImage: ""
|
||||
featuredImagePreview: ""
|
||||
|
||||
toc: false
|
||||
autoCollapseToc: true
|
||||
math: true
|
||||
mapbox:
|
||||
accessToken: ""
|
||||
lightStyle: ""
|
||||
darkStyle: ""
|
||||
navigation: true
|
||||
geolocate: true
|
||||
scale: true
|
||||
fullscreen: true
|
||||
hiddenFromHomePage: false
|
||||
hiddenFromSearch: false
|
||||
lightgallery: true
|
||||
copyCode: true
|
||||
ruby: true
|
||||
fraction: true
|
||||
fontawesome: true
|
||||
linkToMarkdown: true
|
||||
|
||||
toc:
|
||||
enable: true
|
||||
auto: true
|
||||
math:
|
||||
enable: true
|
||||
# ...
|
||||
mapbox:
|
||||
accessToken: ""
|
||||
# ...
|
||||
share:
|
||||
enable: true
|
||||
comment: true
|
||||
# ...
|
||||
comment:
|
||||
enable: true
|
||||
# ...
|
||||
---
|
||||
```
|
||||
|
||||
|
@ -101,24 +96,26 @@ comment: true
|
|||
* **authorLink**: the link of the author.
|
||||
* **description**: the description for the content.
|
||||
* **license**: the special lisence for this content.
|
||||
|
||||
* **tags**: the tags for the content.
|
||||
* **categories**: the categories for the content.
|
||||
* **hiddenFromHomePage**: if `true`, the content will not be shown in the home page, but this behaviour is configurabl in the [site configuration](../theme-documentation-basics/#site-configuration).
|
||||
* **hiddenFromSearch**: {{< version 0.2.0 >}} if `true`, the content will not be shown in the search results.
|
||||
* **featuredImage**: the featured image for the content.
|
||||
* **featuredImagePreview**: the featured image for the content preview in the home page.
|
||||
* **toc**: if `true`, the content will show the table of the contents.
|
||||
* **autoCollapseToc**: if `true`, the table of the contents will be automatically collapsed.
|
||||
* **math**: if `true`, the mathematical formula in the content will be automatically rendered.
|
||||
* **mapbox**: {{< version 0.2.0 >}} the same as `params.mapbox` in the [site configuration](../theme-documentation-basics/#site-configuration).
|
||||
* **lightgallery**: if `true`, images in the content will be shown as the gallery.
|
||||
* **linkToMarkdown**: if `true`, the footer of the content will show the link to the orignal Markdown file.
|
||||
* **share**: the same as `params.share` in the [site configuration](../theme-documentation-basics/#site-configuration).
|
||||
* **comment**: if `true`, the comment will be used.
|
||||
|
||||
{{< admonition tip >}}
|
||||
Not all of the above front matters need to be set in each of your posts. It is necessary only if the front matters and your [site configuration](../theme-documentation-basics/#site-configuration) are inconsistent.
|
||||
{{< /admonition >}}
|
||||
* **hiddenFromHomePage**: if `true`, the content will not be shown in the home page.
|
||||
* **hiddenFromSearch**: {{< version 0.2.0 >}} if `true`, the content will not be shown in the search results.
|
||||
* **copyCode**: {{< version 0.2.0 >}} if `true`, the content will show the copy button of the code block.
|
||||
* **lightgallery**: if `true`, images in the content will be shown as the gallery.
|
||||
* **ruby**: {{< version 0.2.0 >}} if `true`, the content will enable the [ruby extended syntax](#ruby).
|
||||
* **fraction**: {{< version 0.2.0 >}} if `true`, the content will enable the [fraction extended syntax](#fraction).
|
||||
* **fontawesome**: {{< version 0.2.0 >}} if `true`, the content will enable the [Font Awesome extended syntax](#fontawesome).
|
||||
* **linkToMarkdown**: if `true`, the footer of the content will show the link to the orignal Markdown file.
|
||||
|
||||
* **toc**: {{< version 0.2.0 changed >}} the same as the `params.page.toc` part in the [site configuration](../theme-documentation-basics/#site-configuration).
|
||||
* **math**: {{< version 0.2.0 changed >}} the same as the `params.page.math` part in the [site configuration](../theme-documentation-basics/#site-configuration).
|
||||
* **mapbox**: {{< version 0.2.0 >}} the same as the `params.page.mapbox` part in the [site configuration](../theme-documentation-basics/#site-configuration).
|
||||
* **share**: the same as the `params.page.share` part in the [site configuration](../theme-documentation-basics/#site-configuration).
|
||||
* **comment**: {{< version 0.2.0 changed >}} the same as the `params.page.comment` part in the [site configuration](../theme-documentation-basics/#site-configuration).
|
||||
|
||||
## 3 Content Summaries
|
||||
|
||||
|
@ -252,7 +249,7 @@ $$ \ce{CO2 + C -> 2 CO} $$
|
|||
|
||||
$$ \ce{Hg^2+ ->[I-] HgI2 ->[I-] [Hg^{II}I4]^2-} $$
|
||||
|
||||
### Ruby Annotation
|
||||
### Ruby Annotation {#ruby}
|
||||
|
||||
An extended Markdown syntax for **ruby annotation** is supported in **LoveIt** theme:
|
||||
|
||||
|
@ -264,7 +261,7 @@ The rendered output looks like this:
|
|||
|
||||
[Hugo]^(An open-source static site generator)
|
||||
|
||||
### Fraction
|
||||
### Fraction {#fraction}
|
||||
|
||||
{{< version 0.2.0 >}}
|
||||
|
||||
|
@ -282,7 +279,7 @@ The rendered output looks like this:
|
|||
|
||||
[90]/[100]
|
||||
|
||||
### Font Awesome
|
||||
### Font Awesome {#fontawesome}
|
||||
|
||||
**LoveIt** theme uses [Font Awesome](https://fontawesome.com/) as the icon library.
|
||||
You can easily use these icons in your articles.
|
||||
|
|
|
@ -1,38 +1,23 @@
|
|||
---
|
||||
weight: 2
|
||||
title: "Thème Documentation - Contenu"
|
||||
subtitle: ""
|
||||
date: 2020-03-05T16:30:05+08:00
|
||||
lastmod: 2020-03-05T16:30:05+08:00
|
||||
draft: false
|
||||
author: "Dillon"
|
||||
authorLink: "https://dillonzq.com"
|
||||
description: "Découvrez comment créer et organiser votre contenu rapidement et intuitivement dans le thème LoveIt."
|
||||
license: ""
|
||||
|
||||
tags: ["contenu", "markdown"]
|
||||
categories: ["documentation"]
|
||||
hiddenFromHomePage: false
|
||||
|
||||
featuredImage: "/images/theme-documentation-content/featured-image.jpg"
|
||||
featuredImagePreview: ""
|
||||
|
||||
toc: true
|
||||
autoCollapseToc: false
|
||||
math: true
|
||||
mapbox:
|
||||
accessToken: ""
|
||||
lightStyle: ""
|
||||
darkStyle: ""
|
||||
navigation: true
|
||||
geolocate: true
|
||||
scale: true
|
||||
fullscreen: true
|
||||
lightgallery: true
|
||||
linkToMarkdown: true
|
||||
share:
|
||||
toc:
|
||||
auto: false
|
||||
math:
|
||||
enable: true
|
||||
comment: true
|
||||
lightgallery: true
|
||||
---
|
||||
|
||||
Découvrez comment créer et organiser votre contenu rapidement et intuitivement dans le thème **LoveIt**.
|
||||
|
@ -56,7 +41,12 @@ A few suggestions to help you get a good looking site quickly:
|
|||
|
||||
**Hugo** allows you to add front matter in `yaml`, `toml` or `json` to your content files.
|
||||
|
||||
Here is a default front matter from the default archetype:
|
||||
{{< admonition >}}
|
||||
**Not all** of the below front matters need to be set in each of your posts.
|
||||
It is necessary only if the front matters and the `page` part in your [site configuration](../theme-documentation-basics/#site-configuration) are inconsistent.
|
||||
{{< /admonition >}}
|
||||
|
||||
Here is a front matter example:
|
||||
|
||||
```yaml
|
||||
---
|
||||
|
@ -72,28 +62,33 @@ license: ""
|
|||
|
||||
tags: []
|
||||
categories: []
|
||||
hiddenFromHomePage: false
|
||||
hiddenFromSearch: false
|
||||
|
||||
featuredImage: ""
|
||||
featuredImagePreview: ""
|
||||
|
||||
toc: false
|
||||
autoCollapseToc: true
|
||||
math: true
|
||||
mapbox:
|
||||
accessToken: ""
|
||||
lightStyle: ""
|
||||
darkStyle: ""
|
||||
navigation: true
|
||||
geolocate: true
|
||||
scale: true
|
||||
fullscreen: true
|
||||
hiddenFromHomePage: false
|
||||
hiddenFromSearch: false
|
||||
lightgallery: true
|
||||
copyCode: true
|
||||
ruby: true
|
||||
fraction: true
|
||||
fontawesome: true
|
||||
linkToMarkdown: true
|
||||
|
||||
toc:
|
||||
enable: true
|
||||
auto: true
|
||||
math:
|
||||
enable: true
|
||||
# ...
|
||||
mapbox:
|
||||
accessToken: ""
|
||||
# ...
|
||||
share:
|
||||
enable: true
|
||||
comment: true
|
||||
# ...
|
||||
comment:
|
||||
enable: true
|
||||
# ...
|
||||
---
|
||||
```
|
||||
|
||||
|
@ -106,24 +101,26 @@ comment: true
|
|||
* **authorLink**: the link of the author.
|
||||
* **description**: the description for the content.
|
||||
* **license**: the special lisence for this content.
|
||||
|
||||
* **tags**: the tags for the content.
|
||||
* **categories**: the categories for the content.
|
||||
* **hiddenFromHomePage**: if `true`, the content will not be shown in the home page, but this behaviour is configurabl in the [site configuration](../theme-documentation-basics/#site-configuration).
|
||||
* **hiddenFromSearch**: {{< version 0.2.0 >}} if `true`, the content will not be shown in the search results.
|
||||
* **featuredImage**: the featured image for the content.
|
||||
* **featuredImagePreview**: the featured image for the content preview in the home page.
|
||||
* **toc**: if `true`, the content will show the table of the contents.
|
||||
* **autoCollapseToc**: if `true`, the table of the contents will be automatically collapsed.
|
||||
* **math**: if `true`, the mathematical formula in the content will be automatically rendered.
|
||||
* **mapbox**: {{< version 0.2.0 >}} the same as `params.mapbox` in the [site configuration](../theme-documentation-basics/#site-configuration).
|
||||
* **lightgallery**: if `true`, images in the content will be shown as the gallery.
|
||||
* **linkToMarkdown**: if `true`, the footer of the content will show the link to the orignal Markdown file.
|
||||
* **share**: the same as `params.share` in the [site configuration](../theme-documentation-basics/#site-configuration).
|
||||
* **comment**: if `true`, the comment will be used.
|
||||
|
||||
{{< admonition tip >}}
|
||||
Not all of the above front matters need to be set in each of your posts. It is necessary only if the front matters and your [site configuration](../theme-documentation-basics/#site-configuration) are inconsistent.
|
||||
{{< /admonition >}}
|
||||
* **hiddenFromHomePage**: if `true`, the content will not be shown in the home page.
|
||||
* **hiddenFromSearch**: {{< version 0.2.0 >}} if `true`, the content will not be shown in the search results.
|
||||
* **copyCode**: {{< version 0.2.0 >}} if `true`, the content will show the copy button of the code block.
|
||||
* **lightgallery**: if `true`, images in the content will be shown as the gallery.
|
||||
* **ruby**: {{< version 0.2.0 >}} if `true`, the content will enable the [ruby extended syntax](#ruby).
|
||||
* **fraction**: {{< version 0.2.0 >}} if `true`, the content will enable the [fraction extended syntax](#fraction).
|
||||
* **fontawesome**: {{< version 0.2.0 >}} if `true`, the content will enable the [Font Awesome extended syntax](#fontawesome).
|
||||
* **linkToMarkdown**: if `true`, the footer of the content will show the link to the orignal Markdown file.
|
||||
|
||||
* **toc**: {{< version 0.2.0 changed >}} the same as the `params.page.toc` part in the [site configuration](../theme-documentation-basics/#site-configuration).
|
||||
* **math**: {{< version 0.2.0 changed >}} the same as the `params.page.math` part in the [site configuration](../theme-documentation-basics/#site-configuration).
|
||||
* **mapbox**: {{< version 0.2.0 >}} the same as the `params.page.mapbox` part in the [site configuration](../theme-documentation-basics/#site-configuration).
|
||||
* **share**: the same as the `params.page.share` part in the [site configuration](../theme-documentation-basics/#site-configuration).
|
||||
* **comment**: {{< version 0.2.0 changed >}} the same as the `params.page.comment` part in the [site configuration](../theme-documentation-basics/#site-configuration).
|
||||
|
||||
## 3 Content Summaries
|
||||
|
||||
|
@ -257,7 +254,7 @@ $$ \ce{CO2 + C -> 2 CO} $$
|
|||
|
||||
$$ \ce{Hg^2+ ->[I-] HgI2 ->[I-] [Hg^{II}I4]^2-} $$
|
||||
|
||||
### Ruby Annotation
|
||||
### Ruby Annotation {#ruby}
|
||||
|
||||
An extended Markdown syntax for **ruby annotation** is supported in **LoveIt** theme:
|
||||
|
||||
|
@ -269,7 +266,7 @@ The rendered output looks like this:
|
|||
|
||||
[Hugo]^(An open-source static site generator)
|
||||
|
||||
### Fraction
|
||||
### Fraction {#fraction}
|
||||
|
||||
{{< version 0.2.0 >}}
|
||||
|
||||
|
@ -287,7 +284,7 @@ The rendered output looks like this:
|
|||
|
||||
[90]/[100]
|
||||
|
||||
### Font Awesome
|
||||
### Font Awesome {#fontawesome}
|
||||
|
||||
**LoveIt** theme uses [Font Awesome](https://fontawesome.com/) as the icon library.
|
||||
You can easily use these icons in your articles.
|
||||
|
|
|
@ -7,26 +7,17 @@ draft: false
|
|||
author: "Dillon"
|
||||
authorLink: "https://dillonzq.com"
|
||||
description: "了解如何在 LoveIt 主题中快速, 直观地创建和组织内容."
|
||||
license: ""
|
||||
|
||||
tags: ["内容", "markdown"]
|
||||
categories: ["documentation"]
|
||||
|
||||
featuredImage: "/images/theme-documentation-content/featured-image.jpg"
|
||||
|
||||
toc: true
|
||||
autoCollapseToc: false
|
||||
math: true
|
||||
mapbox:
|
||||
navigation: true
|
||||
geolocate: true
|
||||
scale: true
|
||||
fullscreen: true
|
||||
lightgallery: true
|
||||
linkToMarkdown: true
|
||||
share:
|
||||
toc:
|
||||
auto: false
|
||||
math:
|
||||
enable: true
|
||||
comment: true
|
||||
lightgallery: true
|
||||
---
|
||||
|
||||
了解如何在 **LoveIt** 主题中快速, 直观地创建和组织内容.
|
||||
|
@ -45,7 +36,12 @@ comment: true
|
|||
|
||||
**Hugo** 允许你在文章内容前面添加 `yaml`, `toml` 或者 `json` 格式的前置参数.
|
||||
|
||||
这是默认文章模板中的默认前置参数:
|
||||
{{< admonition >}}
|
||||
**不是所有**的上述前置参数都必须在你的每篇文章中设置.
|
||||
只有在文章的参数和你的 [网站设置](../theme-documentation-basics/#site-configuration) 中的 `page` 部分不一致时才有必要这么做.
|
||||
{{< /admonition >}}
|
||||
|
||||
这是一个前置参数例子:
|
||||
|
||||
```yaml
|
||||
---
|
||||
|
@ -61,28 +57,33 @@ license: ""
|
|||
|
||||
tags: []
|
||||
categories: []
|
||||
hiddenFromHomePage: false
|
||||
hiddenFromSearch: false
|
||||
|
||||
featuredImage: ""
|
||||
featuredImagePreview: ""
|
||||
|
||||
toc: false
|
||||
autoCollapseToc: true
|
||||
math: true
|
||||
mapbox:
|
||||
accessToken: ""
|
||||
lightStyle: ""
|
||||
darkStyle: ""
|
||||
navigation: true
|
||||
geolocate: true
|
||||
scale: true
|
||||
fullscreen: true
|
||||
hiddenFromHomePage: false
|
||||
hiddenFromSearch: false
|
||||
lightgallery: true
|
||||
copyCode: true
|
||||
ruby: true
|
||||
fraction: true
|
||||
fontawesome: true
|
||||
linkToMarkdown: true
|
||||
|
||||
toc:
|
||||
enable: true
|
||||
auto: true
|
||||
math:
|
||||
enable: true
|
||||
# ...
|
||||
mapbox:
|
||||
accessToken: ""
|
||||
# ...
|
||||
share:
|
||||
enable: true
|
||||
comment: true
|
||||
# ...
|
||||
comment:
|
||||
enable: true
|
||||
# ...
|
||||
---
|
||||
```
|
||||
|
||||
|
@ -95,25 +96,26 @@ comment: true
|
|||
* **authorLink**: 文章作者的链接.
|
||||
* **description**: 文章内容的描述.
|
||||
* **license**: 这篇文章特殊的许可.
|
||||
|
||||
* **tags**: 文章的标签.
|
||||
* **categories**: 文章所属的类别.
|
||||
* **hiddenFromHomePage**: 如果设为 `true`, 这篇文章将不会显示在主页上, 但是此行为可以在 [网站配置](../theme-documentation-basics/#site-configuration) 中设置的.
|
||||
* **hiddenFromSearch**: {{< version 0.2.0 >}} 如果设为 `true`, 这篇文章将不会显示在搜索结果中.
|
||||
* **featuredImage**: 文章的特色图片.
|
||||
* **featuredImagePreview**: 用在主页预览的文章特色图片.
|
||||
* **toc**: 如果设为 `true`, 这篇文章会显示右侧目录.
|
||||
* **autoCollapseToc**: 如果设为 `true`, 文章目录会自动折叠.
|
||||
* **math**: 如果设为 `true`, 将自动渲染文章中的数学公式.
|
||||
* **mapbox**: {{< version 0.2.0 >}} 和 [网站配置](../theme-documentation-basics/#site-configuration) 中的 `params.mapbox` 对象相同.
|
||||
* **lightgallery**: 如果设为 `true`, 文章中的图片将可以按照画廊形式呈现.
|
||||
* **linkToMarkdown**: 如果设为 `true`, 内容的页脚将显示指向原始 Markdown 文件的链接.
|
||||
* **share**: 和 [网站配置](../theme-documentation-basics/#site-configuration) 中的 `params.share` 对象相同.
|
||||
* **comment**: 如果设为 `true`, 将启用评论系统.
|
||||
|
||||
{{< admonition tip >}}
|
||||
不是所有的上述前置参数都必须在你的每篇文章中设置.
|
||||
只有在文章的参数和你的 [网站设置](../theme-documentation-basics/#site-configuration) 不一致时才有必要这么做.
|
||||
{{< /admonition >}}
|
||||
* **hiddenFromHomePage**: 如果设为 `true`, 这篇文章将不会显示在主页上.
|
||||
* **hiddenFromSearch**: {{< version 0.2.0 >}} 如果设为 `true`, 这篇文章将不会显示在搜索结果中.
|
||||
* **copyCode**: {{< version 0.2.0 >}} 如果设为 `true`, 这篇文章会显示代码块的复制按钮.
|
||||
* **lightgallery**: 如果设为 `true`, 文章中的图片将可以按照画廊形式呈现.
|
||||
* **ruby**: {{< version 0.2.0 >}} 如果设为 `true`, 这篇文章会使用 [上标注释扩展语法](#ruby).
|
||||
* **fraction**: {{< version 0.2.0 >}} 如果设为 `true`, 这篇文章会使用 [分数扩展语法](#fraction).
|
||||
* **fontawesome**: {{< version 0.2.0 >}} 如果设为 `true`, 这篇文章会使用 [Font Awesome 扩展语法](#fontawesome).
|
||||
* **linkToMarkdown**: 如果设为 `true`, 内容的页脚将显示指向原始 Markdown 文件的链接.
|
||||
|
||||
* **toc**: {{< version 0.2.0 changed >}} 和 [网站配置](../theme-documentation-basics/#site-configuration) 中的 `params.page.toc` 部分相同.
|
||||
* **math**: {{< version 0.2.0 changed >}} 和 [网站配置](../theme-documentation-basics/#site-configuration) 中的 `params.page.math` 部分相同.
|
||||
* **mapbox**: {{< version 0.2.0 >}} 和 [网站配置](../theme-documentation-basics/#site-configuration) 中的 `params.page.mapbox` 部分相同.
|
||||
* **share**: 和 [网站配置](../theme-documentation-basics/#site-configuration) 中的 `params.page.share` 部分相同.
|
||||
* **comment**: {{< version 0.2.0 changed >}} 和 [网站配置](../theme-documentation-basics/#site-configuration) 中的 `params.page.comment` 部分相同.
|
||||
|
||||
## 3 内容摘要
|
||||
|
||||
|
@ -247,7 +249,7 @@ $$ \ce{CO2 + C -> 2 CO} $$
|
|||
|
||||
$$ \ce{Hg^2+ ->[I-] HgI2 ->[I-] [Hg^{II}I4]^2-} $$
|
||||
|
||||
### 字符注音或者注释
|
||||
### 字符注音或者注释 {#ruby}
|
||||
|
||||
**LoveIt** 主题支持一种 **字符注音或者注释** Markdown 扩展语法:
|
||||
|
||||
|
@ -259,7 +261,7 @@ $$ \ce{Hg^2+ ->[I-] HgI2 ->[I-] [Hg^{II}I4]^2-} $$
|
|||
|
||||
[Hugo]^(一个开源的静态网站生成工具)
|
||||
|
||||
### 分数
|
||||
### 分数 {#fraction}
|
||||
|
||||
{{< version 0.2.0 >}}
|
||||
|
||||
|
@ -277,7 +279,7 @@ $$ \ce{Hg^2+ ->[I-] HgI2 ->[I-] [Hg^{II}I4]^2-} $$
|
|||
|
||||
[90]/[100]
|
||||
|
||||
### Font Awesome
|
||||
### Font Awesome {#fontawesome}
|
||||
|
||||
**LoveIt** 主题使用 [Font Awesome](https://fontawesome.com/) 作为图标库.
|
||||
你同样可以在文章中轻松使用这些图标.
|
||||
|
|
|
@ -1,45 +1,27 @@
|
|||
---
|
||||
weight: 4
|
||||
title: "Theme Documentation - Extended Shortcodes"
|
||||
subtitle: ""
|
||||
date: 2020-03-03T16:29:41+08:00
|
||||
lastmod: 2020-03-03T16:29:41+08:00
|
||||
draft: false
|
||||
author: "Dillon"
|
||||
authorLink: "https://dillonzq.com"
|
||||
description: "LoveIt theme provides multiple shortcodes on top of built-in ones in Hugo."
|
||||
license: ""
|
||||
|
||||
tags: ["shortcodes"]
|
||||
categories: ["documentation"]
|
||||
hiddenFromHomePage: false
|
||||
|
||||
featuredImage: "/images/theme-documentation-extended-shortcodes/featured-image.jpg"
|
||||
featuredImagePreview: "/images/theme-documentation-extended-shortcodes/featured-image-preview.jpg"
|
||||
|
||||
toc: true
|
||||
autoCollapseToc: true
|
||||
math: false
|
||||
mapbox:
|
||||
accessToken: ""
|
||||
lightStyle: ""
|
||||
darkStyle: ""
|
||||
navigation: true
|
||||
geolocate: true
|
||||
scale: true
|
||||
fullscreen: true
|
||||
lightgallery: true
|
||||
linkToMarkdown: true
|
||||
share:
|
||||
enable: true
|
||||
comment: true
|
||||
---
|
||||
|
||||
**LoveIt** theme provides multiple shortcodes on top of built-in ones in Hugo.
|
||||
|
||||
<!--more-->
|
||||
|
||||
## `style`
|
||||
## style
|
||||
|
||||
`style` is a shortcode to insert custom style in your post.
|
||||
|
||||
|
@ -63,7 +45,7 @@ The rendered output looks like this:
|
|||
This is a right-aligned paragraph.
|
||||
{{< /style >}}
|
||||
|
||||
## `link`
|
||||
## link
|
||||
|
||||
{{< version 0.2.0 >}}
|
||||
|
||||
|
@ -127,7 +109,7 @@ The rendered output looks like this (hover over the link, there should be a tool
|
|||
|
||||
{{< link "https://github.com/upstage/" Upstage "Visit Upstage!" >}}
|
||||
|
||||
## `image`
|
||||
## image
|
||||
|
||||
{{< version 0.2.0 changed >}}
|
||||
|
||||
|
@ -197,7 +179,7 @@ The rendered output looks like this:
|
|||
|
||||
{{< image src="/images/theme-documentation-extended-shortcodes/lighthouse.jpg" caption="Lighthouse (`image`)" src-s="/images/theme-documentation-extended-shortcodes/lighthouse-small.jpg" src-l="/images/theme-documentation-extended-shortcodes/lighthouse-large.jpg" >}}
|
||||
|
||||
## `admonition`
|
||||
## admonition
|
||||
|
||||
The `admonition` shortcode supports **12** types of banners to help you put notice in your page.
|
||||
|
||||
|
@ -283,7 +265,7 @@ The rendered output looks like this:
|
|||
A **tip** banner
|
||||
{{< /admonition >}}
|
||||
|
||||
## `mermaid`
|
||||
## mermaid
|
||||
|
||||
[mermaid](https://mermaidjs.github.io/) is a library helping you to generate diagram and flowcharts from text, in a similar manner as Markdown.
|
||||
|
||||
|
@ -531,7 +513,7 @@ pie
|
|||
"Rats" : 15
|
||||
{{< /mermaid >}}
|
||||
|
||||
## `echarts`
|
||||
## echarts
|
||||
|
||||
[ECharts](https://echarts.apache.org/) is a library helping you to generate interactive data visualization.
|
||||
|
||||
|
@ -919,7 +901,7 @@ The `echarts` shortcode has also the following named parameters:
|
|||
|
||||
{{< version 0.2.0 >}} Height of the data visualization, default value is `30rem`.
|
||||
|
||||
## `mapbox`
|
||||
## mapbox
|
||||
|
||||
{{< version 0.2.0 >}}
|
||||
|
||||
|
@ -993,7 +975,7 @@ The rendered output looks like this:
|
|||
|
||||
{{< mapbox -122.252 37.453 10 false "mapbox://styles/mapbox/navigation-preview-day-v4?optimize=true" "mapbox://styles/mapbox/navigation-preview-night-v4?optimize=true" >}}
|
||||
|
||||
## `music`
|
||||
## music
|
||||
|
||||
The `music` shortcode embeds a responsive music player based on [APlayer](https://github.com/MoePlayer/APlayer) and [MetingJS](https://github.com/metowolf/MetingJS).
|
||||
|
||||
|
@ -1132,7 +1114,7 @@ The `music` shortcode has the following named parameters only applying to the ty
|
|||
|
||||
Max height of the music list, default value is `340px`.
|
||||
|
||||
## `bilibili`
|
||||
## bilibili
|
||||
|
||||
{{< version 0.2.0 changed >}}
|
||||
|
||||
|
@ -1175,7 +1157,7 @@ The rendered output looks like this:
|
|||
|
||||
{{< bilibili id=BV1TJ411C7An p=3 >}}
|
||||
|
||||
## `typeit`
|
||||
## typeit
|
||||
|
||||
The `typeit` shortcode provides typing animation based on [TypeIt](https://typeitjs.com/).
|
||||
|
||||
|
|
|
@ -1,38 +1,20 @@
|
|||
---
|
||||
weight: 4
|
||||
title: "Thème Documentation - Extended Shortcodes"
|
||||
subtitle: ""
|
||||
date: 2020-03-03T16:29:59+08:00
|
||||
lastmod: 2020-03-03T16:29:59+08:00
|
||||
draft: false
|
||||
author: "Dillon"
|
||||
authorLink: "https://dillonzq.com"
|
||||
description: "Le thème LoveIt fournit plusieurs shortcodes en plus de ceux intégrés dans Hugo."
|
||||
license: ""
|
||||
|
||||
tags: ["shortcodes"]
|
||||
categories: ["documentation"]
|
||||
hiddenFromHomePage: false
|
||||
|
||||
featuredImage: "/images/theme-documentation-extended-shortcodes/featured-image.jpg"
|
||||
featuredImagePreview: "/images/theme-documentation-extended-shortcodes/featured-image-preview.jpg"
|
||||
|
||||
toc: true
|
||||
autoCollapseToc: true
|
||||
math: false
|
||||
mapbox:
|
||||
accessToken: ""
|
||||
lightStyle: ""
|
||||
darkStyle: ""
|
||||
navigation: true
|
||||
geolocate: true
|
||||
scale: true
|
||||
fullscreen: true
|
||||
lightgallery: true
|
||||
linkToMarkdown: true
|
||||
share:
|
||||
enable: true
|
||||
comment: true
|
||||
---
|
||||
|
||||
Le thème **LoveIt** fournit plusieurs shortcodes en plus de ceux intégrés dans Hugo.
|
||||
|
@ -44,7 +26,7 @@ Sorry, this article has not been completely translated into **French**.
|
|||
Welcome to take the time to propose a translation by [making a PR](https://github.com/dillonzq/LoveIt/pulls) to the theme!
|
||||
{{< /admonition >}}
|
||||
|
||||
## `style`
|
||||
## style
|
||||
|
||||
`style` is a shortcode to insert custom style in your post.
|
||||
|
||||
|
@ -68,7 +50,7 @@ The rendered output looks like this:
|
|||
This is a right-aligned paragraph.
|
||||
{{< /style >}}
|
||||
|
||||
## `link`
|
||||
## link
|
||||
|
||||
{{< version 0.2.0 >}}
|
||||
|
||||
|
@ -132,7 +114,7 @@ The rendered output looks like this (hover over the link, there should be a tool
|
|||
|
||||
{{< link "https://github.com/upstage/" Upstage "Visit Upstage!" >}}
|
||||
|
||||
## `image`
|
||||
## image
|
||||
|
||||
{{< version 0.2.0 changed >}}
|
||||
|
||||
|
@ -202,7 +184,7 @@ The rendered output looks like this:
|
|||
|
||||
{{< image src="/images/theme-documentation-extended-shortcodes/lighthouse.jpg" caption="Lighthouse (`image`)" src-s="/images/theme-documentation-extended-shortcodes/lighthouse-small.jpg" src-l="/images/theme-documentation-extended-shortcodes/lighthouse-large.jpg" >}}
|
||||
|
||||
## `admonition`
|
||||
## admonition
|
||||
|
||||
The `admonition` shortcode supports **12** types of banners to help you put notice in your page.
|
||||
|
||||
|
@ -288,7 +270,7 @@ The rendered output looks like this:
|
|||
A **tip** banner
|
||||
{{< /admonition >}}
|
||||
|
||||
## `mermaid`
|
||||
## mermaid
|
||||
|
||||
[mermaid](https://mermaidjs.github.io/) is a library helping you to generate diagram and flowcharts from text, in a similar manner as Markdown.
|
||||
|
||||
|
@ -536,7 +518,7 @@ pie
|
|||
"Rats" : 15
|
||||
{{< /mermaid >}}
|
||||
|
||||
## `echarts`
|
||||
## echarts
|
||||
|
||||
[ECharts](https://echarts.apache.org/) is a library helping you to generate interactive data visualization.
|
||||
|
||||
|
@ -924,7 +906,7 @@ The `echarts` shortcode has also the following named parameters:
|
|||
|
||||
{{< version 0.2.0 >}} Height of the data visualization, default value is `30rem`.
|
||||
|
||||
## `mapbox`
|
||||
## mapbox
|
||||
|
||||
{{< version 0.2.0 >}}
|
||||
|
||||
|
@ -998,7 +980,7 @@ The rendered output looks like this:
|
|||
|
||||
{{< mapbox -122.252 37.453 10 false "mapbox://styles/mapbox/navigation-preview-day-v4?optimize=true" "mapbox://styles/mapbox/navigation-preview-night-v4?optimize=true" >}}
|
||||
|
||||
## `music`
|
||||
## music
|
||||
|
||||
The `music` shortcode embeds a responsive music player based on [APlayer](https://github.com/MoePlayer/APlayer) and [MetingJS](https://github.com/metowolf/MetingJS).
|
||||
|
||||
|
@ -1137,7 +1119,7 @@ The `music` shortcode has the following named parameters only applying to the ty
|
|||
|
||||
Max height of the music list, default value is `340px`.
|
||||
|
||||
## `bilibili`
|
||||
## bilibili
|
||||
|
||||
{{< version 0.2.0 changed >}}
|
||||
|
||||
|
@ -1180,7 +1162,7 @@ The rendered output looks like this:
|
|||
|
||||
{{< bilibili id=BV1TJ411C7An p=3 >}}
|
||||
|
||||
## `typeit`
|
||||
## typeit
|
||||
|
||||
The `typeit` shortcode provides typing animation based on [TypeIt](https://typeitjs.com/).
|
||||
|
||||
|
|
|
@ -1,14 +1,12 @@
|
|||
---
|
||||
weight: 4
|
||||
title: "主题文档 - 扩展 Shortcodes"
|
||||
subtitle: ""
|
||||
date: 2020-03-03T16:29:59+08:00
|
||||
lastmod: 2020-03-03T16:29:59+08:00
|
||||
draft: false
|
||||
author: "Dillon"
|
||||
authorLink: "https://dillonzq.com"
|
||||
description: "LoveIt 主题在 Hugo 内置的 shortcode 的基础上提供多个扩展的 shortcode."
|
||||
license: ""
|
||||
|
||||
tags: ["shortcodes"]
|
||||
categories: ["documentation"]
|
||||
|
@ -16,16 +14,14 @@ categories: ["documentation"]
|
|||
featuredImage: "/images/theme-documentation-extended-shortcodes/featured-image.jpg"
|
||||
featuredImagePreview: "/images/theme-documentation-extended-shortcodes/featured-image-preview.jpg"
|
||||
|
||||
toc: true
|
||||
autoCollapseToc: true
|
||||
math: false
|
||||
lightgallery: true
|
||||
---
|
||||
|
||||
**LoveIt** 主题在 Hugo 内置的 shortcode 的基础上提供多个扩展的 shortcode.
|
||||
|
||||
<!--more-->
|
||||
|
||||
## `style`
|
||||
## style
|
||||
|
||||
`style` shortcode 用来在你的文章中插入自定义样式.
|
||||
|
||||
|
@ -49,7 +45,7 @@ This is a right-aligned paragraph.
|
|||
This is a right-aligned paragraph.
|
||||
{{< /style >}}
|
||||
|
||||
## `link`
|
||||
## link
|
||||
|
||||
{{< version 0.2.0 >}}
|
||||
|
||||
|
@ -114,7 +110,7 @@ This is a right-aligned paragraph.
|
|||
|
||||
{{< link "https://github.com/upstage/" Upstage "Visit Upstage!" >}}
|
||||
|
||||
## `image`
|
||||
## image
|
||||
|
||||
{{< version 0.2.0 changed >}}
|
||||
|
||||
|
@ -184,7 +180,7 @@ This is a right-aligned paragraph.
|
|||
|
||||
{{< image src="/images/theme-documentation-extended-shortcodes/lighthouse.jpg" caption="Lighthouse (`image`)" src-s="/images/theme-documentation-extended-shortcodes/lighthouse-small.jpg" src-l="/images/theme-documentation-extended-shortcodes/lighthouse-large.jpg" >}}
|
||||
|
||||
## `admonition`
|
||||
## admonition
|
||||
|
||||
`admonition` shortcode 支持 **12** 种 帮助你在页面中插入提示的横幅.
|
||||
|
||||
|
@ -270,7 +266,7 @@ This is a right-aligned paragraph.
|
|||
一个 **技巧** 横幅
|
||||
{{< /admonition >}}
|
||||
|
||||
## `mermaid`
|
||||
## mermaid
|
||||
|
||||
[mermaid](https://mermaidjs.github.io/) 是一个可以帮助你在文章中生成图表和流程图的库, 类似 Markdown 的语法.
|
||||
|
||||
|
@ -518,7 +514,7 @@ pie
|
|||
"Rats" : 15
|
||||
{{< /mermaid >}}
|
||||
|
||||
## `echarts`
|
||||
## echarts
|
||||
|
||||
[ECharts](https://echarts.apache.org/) 是一个帮助你生成交互式数据可视化的库.
|
||||
|
||||
|
@ -906,7 +902,7 @@ data = [
|
|||
|
||||
{{< version 0.2.0 >}} 数据可视化的高度, 默认值是 `30rem`.
|
||||
|
||||
## `mapbox`
|
||||
## mapbox
|
||||
|
||||
{{< version 0.2.0 >}}
|
||||
|
||||
|
@ -980,7 +976,7 @@ data = [
|
|||
|
||||
{{< mapbox -122.252 37.453 10 false "mapbox://styles/mapbox/navigation-preview-day-v4?optimize=true" "mapbox://styles/mapbox/navigation-preview-night-v4?optimize=true" >}}
|
||||
|
||||
## `music`
|
||||
## music
|
||||
|
||||
`music` shortcode 基于 [APlayer](https://github.com/MoePlayer/APlayer) 和 [MetingJS](https://github.com/metowolf/MetingJS) 提供了一个内嵌的响应式音乐播放器.
|
||||
|
||||
|
@ -1118,7 +1114,7 @@ data = [
|
|||
|
||||
音乐列表的最大高度, 默认值是 `340px`.
|
||||
|
||||
## `bilibili`
|
||||
## bilibili
|
||||
|
||||
{{< version 0.2.0 changed >}}
|
||||
|
||||
|
@ -1160,7 +1156,7 @@ https://www.bilibili.com/video/BV1TJ411C7An?p=3
|
|||
|
||||
{{< bilibili id=BV1TJ411C7An p=3 >}}
|
||||
|
||||
## `typeit`
|
||||
## typeit
|
||||
|
||||
`typeit` shortcode 基于 [TypeIt](https://typeitjs.com/) 提供了打字动画.
|
||||
|
||||
|
|
11
i18n/en.toml
11
i18n/en.toml
|
@ -52,6 +52,17 @@ other = "Powered by %s"
|
|||
other = "Theme"
|
||||
# === partials/footer.html ===
|
||||
|
||||
# === partials/comment.html ===
|
||||
[valineLang]
|
||||
other = "en"
|
||||
|
||||
[valinePlaceholder]
|
||||
other = "Your comment ..."
|
||||
|
||||
[facebookLanguageCode]
|
||||
other = "en_US"
|
||||
# === partials/comment.html ===
|
||||
|
||||
# === partials/assets.html ===
|
||||
[search]
|
||||
other = "Search"
|
||||
|
|
11
i18n/fr.toml
11
i18n/fr.toml
|
@ -52,6 +52,17 @@ other = "Propulsé par %s"
|
|||
other = "Thème"
|
||||
# === partials/footer.html ===
|
||||
|
||||
# === partials/comment.html ===
|
||||
[valineLang]
|
||||
other = "en"
|
||||
|
||||
[valinePlaceholder]
|
||||
other = "Votre commentaire ..."
|
||||
|
||||
[facebookLanguageCode]
|
||||
other = "fr"
|
||||
# === partials/comment.html ===
|
||||
|
||||
# === partials/assets.html ===
|
||||
[search]
|
||||
other = "Chercher"
|
||||
|
|
11
i18n/pl.toml
11
i18n/pl.toml
|
@ -52,6 +52,17 @@ other = "Napędzany przez %s"
|
|||
other = "Szablon"
|
||||
# === partials/footer.html ===
|
||||
|
||||
# === partials/comment.html ===
|
||||
[valineLang]
|
||||
other = "en"
|
||||
|
||||
[valinePlaceholder]
|
||||
other = "Twój komentarz ..."
|
||||
|
||||
[facebookLanguageCode]
|
||||
other = "pl"
|
||||
# === partials/comment.html ===
|
||||
|
||||
# === partials/assets.html ===
|
||||
[search]
|
||||
other = "Szukaj"
|
||||
|
|
|
@ -52,6 +52,17 @@ other = "由 %s 强力驱动"
|
|||
other = "主题"
|
||||
# === partials/footer.html ===
|
||||
|
||||
# === partials/comment.html ===
|
||||
[valineLang]
|
||||
other = "zh-cn"
|
||||
|
||||
[valinePlaceholder]
|
||||
other = "你的评论 ..."
|
||||
|
||||
[facebookLanguageCode]
|
||||
other = "zh_CN"
|
||||
# === partials/comment.html ===
|
||||
|
||||
# === partials/assets.html ===
|
||||
[search]
|
||||
other = "搜索"
|
||||
|
|
|
@ -1,20 +1,26 @@
|
|||
{{- $scratch := newScratch -}}
|
||||
{{- .Scratch.Set "scratch" $scratch -}}
|
||||
{{- if eq hugo.Environment "production" -}}
|
||||
{{- $scratch.Set "CDN" .Site.Params.cdn -}}
|
||||
{{- $scratch.Set "fingerprint" .Site.Params.fingerprint -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- $scratch.Set "major-version" "0.2.X" -}}
|
||||
{{- $scratch.Set "version" "0.2.0" -}}
|
||||
{{- $version := "0.2.X" -}}
|
||||
|
||||
{{- /* LoveIt theme version detection */ -}}
|
||||
{{- if not .Site.Params.version -}}
|
||||
{{- errorf "\n\nYou haven't configured the LoveIt version param correctly yet. See https://hugoloveit.com/theme-documentation-basics/#basic-configuration \n你还没有正确配置 LoveIt 的版本参数 参考 https://hugoloveit.com/zh-cn/theme-documentation-basics/#basic-configuration \n" -}}
|
||||
{{- else if ne .Site.Params.version ($scratch.Get "major-version") -}}
|
||||
{{- errorf (printf "\n\n%s -> %s:\nYou have an incompatible update. See https://github.com/dillonzq/LoveIt/releases \n你进行了一次不兼容的更新 参考 https://github.com/dillonzq/LoveIt/releases \n" .Site.Params.version ($scratch.Get "major-version")) -}}
|
||||
{{- else if ne .Site.Params.version $version -}}
|
||||
{{- errorf (printf "\n\n%s -> %s:\nYou have an incompatible update. See https://github.com/dillonzq/LoveIt/releases \n你进行了一次不兼容的更新 参考 https://github.com/dillonzq/LoveIt/releases \n" .Site.Params.version $version) -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- $params := .Params | merge .Site.Params.page -}}
|
||||
{{- .Scratch.Set "version" "0.2.0" -}}
|
||||
|
||||
{{- if eq hugo.Environment "production" -}}
|
||||
{{- .Scratch.Set "cdn" .Site.Params.cdn -}}
|
||||
{{- .Scratch.Set "fingerprint" .Site.Params.fingerprint -}}
|
||||
{{- else -}}
|
||||
{{- $params = dict "comment" nil | merge $params -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- .Scratch.Set "params" $params -}}
|
||||
{{- $this := dict "desktop" .Site.Params.header.desktopMode "mobile" .Site.Params.header.mobileMode | dict "headerMode" | dict "config" -}}
|
||||
{{- .Scratch.Set "this" $this -}}
|
||||
|
||||
<!DOCTYPE html>
|
||||
<html lang="{{ .Site.LanguageCode }}">
|
||||
<head>
|
||||
|
@ -25,7 +31,7 @@
|
|||
<title>
|
||||
{{- block "title" . }}{{ .Site.Title }}{{ end -}}
|
||||
</title>
|
||||
<meta name="Description" content="{{ .Params.description | default .Site.Params.description }}">
|
||||
<meta name="Description" content="{{ $params.description | default .Site.Params.description }}">
|
||||
|
||||
{{- partial "head/meta.html" . -}}
|
||||
{{- partial "head/link.html" . -}}
|
||||
|
@ -33,8 +39,8 @@
|
|||
</head>
|
||||
<body>
|
||||
{{- /* Check theme isDark before body rendering */ -}}
|
||||
{{- $theme := .Site.Params.defaultTheme -}}
|
||||
<script type="text/javascript">(window.localStorage && localStorage.getItem('theme') ? localStorage.getItem('theme') === 'dark' : ('{{ .Site.Params.defaultTheme }}' === 'auto' ? window.matchMedia('(prefers-color-scheme: dark)').matches : '{{ .Site.Params.defaultTheme }}' === 'dark')) && document.body.classList.add('dark');</script>
|
||||
{{- $theme := .Site.Params.defaulttheme -}}
|
||||
<script type="text/javascript">(window.localStorage && localStorage.getItem('theme') ? localStorage.getItem('theme') === 'dark' : ('{{ $theme }}' === 'auto' ? window.matchMedia('(prefers-color-scheme: dark)').matches : '{{ $theme }}' === 'dark')) && document.body.classList.add('dark');</script>
|
||||
|
||||
<div id="mask"></div>
|
||||
|
||||
|
|
|
@ -10,7 +10,8 @@
|
|||
</h2>
|
||||
|
||||
{{- /* Paginate */ -}}
|
||||
{{- range (.Paginate (.Pages.GroupByDate "2006")).PageGroups -}}
|
||||
{{- $pages := .Pages.GroupByDate "2006" -}}
|
||||
{{- range (.Site.Params.section.paginate | default .Site.Params.paginate | .Paginate $pages).PageGroups -}}
|
||||
<h3>{{ .Key }}</h3>
|
||||
{{- range .Pages -}}
|
||||
<article class="archive-item">
|
||||
|
@ -18,7 +19,7 @@
|
|||
{{- .Title -}}
|
||||
</a>
|
||||
<span class="archive-item-date">
|
||||
{{- .Date.Format (.Site.Params.dateFormatToUse | default "01-02") -}}
|
||||
{{- .Date.Format ($.Site.Params.section.dateFormat | default "01-02") -}}
|
||||
</span>
|
||||
</article>
|
||||
{{- end -}}
|
||||
|
|
|
@ -1,18 +1,21 @@
|
|||
{{- define "title" }}{{ .Title }} | {{ .Site.Title }}{{ end -}}
|
||||
|
||||
{{- define "content" -}}
|
||||
{{- $params := .Scratch.Get "params" -}}
|
||||
<div class="page single special">
|
||||
{{- /* Title */ -}}
|
||||
<h1 class="single-title animated pulse faster">
|
||||
{{- .Title -}}
|
||||
</h1>
|
||||
{{- with .Params.subtitle -}}
|
||||
|
||||
{{- /* Subtitle */ -}}
|
||||
{{- with $params.subtitle -}}
|
||||
<h2 class="single-subtitle">{{ . }}</h2>
|
||||
{{- end -}}
|
||||
|
||||
{{- /* Content */ -}}
|
||||
<div class="content" id="content">
|
||||
{{- partial "function/content.html" .Content | safeHTML -}}
|
||||
{{- dict "content" .Content "ruby" $params.ruby "fraction" $params.fraction "fontawesome" $params.fontawesome | partial "function/content.html" | safeHTML -}}
|
||||
</div>
|
||||
</div>
|
||||
{{- end -}}
|
||||
|
|
|
@ -1,10 +1,9 @@
|
|||
{{- $scratch := .Scratch.Get "scratch" -}}
|
||||
|
||||
{{- $params := .Params | merge .Site.Params.page -}}
|
||||
<article class="single summary" itemscope itemtype="http://schema.org/Article">
|
||||
{{- /* Featured image */ -}}
|
||||
{{- with .Params.featuredImage -}}
|
||||
{{- with $params.featuredimage -}}
|
||||
<div class="featured-image-preview">
|
||||
{{- $image := $.Params.featuredImagePreview | default . -}}
|
||||
{{- $image := $params.featuredimagepreview | default . -}}
|
||||
{{- partial "plugin/image.html" (dict "src" $image "alt" $.Description "large" true) -}}
|
||||
</div>
|
||||
{{- end -}}
|
||||
|
@ -16,19 +15,19 @@
|
|||
|
||||
{{- /* Meta */ -}}
|
||||
<div class="post-meta">
|
||||
{{- $author := .Params.author | default .Site.Author.name | default (T "author") -}}
|
||||
{{- $authorLink := .Params.authorLink | default .Site.Author.link | default (relLangURL "/") -}}
|
||||
{{- $author := $params.author | default .Site.Author.name | default (T "author") -}}
|
||||
{{- $authorLink := $params.authorlink | default .Site.Author.link | default (relLangURL "/") -}}
|
||||
<span class="post-author">
|
||||
{{- $options := dict "class" "author" "href" $authorLink "title" "Author" "rel" "author" "icon" (dict "class" "fas fa-user-circle fa-fw") "content" $author -}}
|
||||
{{- partial "plugin/link.html" $options -}}
|
||||
</span>
|
||||
|
||||
{{- $publish_date := .PublishDate.Format (.Site.Params.dateFormatToUse | default "2006-01-02") -}}
|
||||
{{- $publish_date := .PublishDate.Format (.Site.Params.dateFormat | default "2006-01-02") -}}
|
||||
<span class="post-publish">
|
||||
{{ T "publish" }} <time datetime={{ $publish_date }}>{{ $publish_date }}</time>
|
||||
</span>
|
||||
|
||||
{{- with .Params.categories -}}
|
||||
{{- with $params.categories -}}
|
||||
|
||||
<span class="post-category">
|
||||
{{- T "included" -}}
|
||||
|
@ -45,7 +44,7 @@
|
|||
{{- /* Summary content */ -}}
|
||||
<div class="content">
|
||||
{{- with .Summary -}}
|
||||
{{- partial "function/content.html" . | safeHTML -}}
|
||||
{{- dict "content" . "ruby" $params.ruby "fraction" $params.fraction "fontawesome" $params.fontawesome | partial "function/content.html" | safeHTML -}}
|
||||
{{- else -}}
|
||||
{{- .Description | safeHTML -}}
|
||||
{{- end -}}
|
||||
|
@ -54,7 +53,7 @@
|
|||
{{- /* Footer */ -}}
|
||||
<div class="post-footer">
|
||||
<a href="{{ .RelPermalink }}">{{ T "readMore" }}</a>
|
||||
{{- with .Params.tags -}}
|
||||
{{- with $params.tags -}}
|
||||
<div class="post-tags">
|
||||
<i class="fas fa-tags fa-fw"></i>
|
||||
{{- range $index, $value := . -}}
|
||||
|
|
|
@ -1,25 +1,21 @@
|
|||
{{- define "content" -}}
|
||||
<div class="page home">
|
||||
{{- /* Profile */ -}}
|
||||
{{- if .Site.Params.home.profile.enable -}}
|
||||
{{- if ne .Site.Params.home.profile.enable false -}}
|
||||
{{- partial "home/profile.html" . -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- /* Posts */ -}}
|
||||
{{- if ne .Site.Params.home.posts.enable false -}}
|
||||
{{- /* Paginate */ -}}
|
||||
{{- $paginator := where .Site.RegularPages "Type" "posts" -}}
|
||||
{{- if ne .Site.Params.home.posts.mode.defaultHiddenFromHomePage false -}}
|
||||
{{- $paginator = where $paginator "Params.hiddenfromhomepage" "!=" true -}}
|
||||
{{- $pages := where .Site.RegularPages "Type" "posts" -}}
|
||||
{{- if .Site.Params.page.hiddenFromHomePage -}}
|
||||
{{- $pages = where $pages "Params.hiddenfromhomepage" false -}}
|
||||
{{- else -}}
|
||||
{{- $paginator = where $paginator "Params.hiddenfromhomepage" false -}}
|
||||
{{- $pages = where $pages "Params.hiddenfromhomepage" "!=" true -}}
|
||||
{{- end -}}
|
||||
{{- with .Site.Params.home.posts.paginate -}}
|
||||
{{- $paginator = $.Paginate $paginator . -}}
|
||||
{{- else -}}
|
||||
{{- $paginator = $.Paginate $paginator -}}
|
||||
{{- end -}}
|
||||
{{- range $paginator.Pages -}}
|
||||
{{- $pages = .Site.Params.home.posts.paginate | default .Site.Params.paginate | .Paginate $pages -}}
|
||||
{{- range $pages.Pages -}}
|
||||
{{- .Render "summary" -}}
|
||||
{{- end -}}
|
||||
{{- partial "paginator.html" . -}}
|
||||
|
|
|
@ -1,11 +1,18 @@
|
|||
{{- $index := slice -}}
|
||||
{{- range where .Site.RegularPages ".Params.hiddenfromsearch" "!=" true -}}
|
||||
{{- $pages := .Site.RegularPages -}}
|
||||
{{- if .Site.Params.page.hiddenFromSearch -}}
|
||||
{{- $pages = where $pages "Params.hiddenfromsearch" false -}}
|
||||
{{- else -}}
|
||||
{{- $pages = where $pages "Params.hiddenfromsearch" "!=" true -}}
|
||||
{{- end -}}
|
||||
{{- range $pages -}}
|
||||
{{- $params := .Params | merge $.Site.Params.page -}}
|
||||
{{- $one := dict "uri" .RelPermalink "title" .Title "description" (.Description | default "") -}}
|
||||
{{- $tags := .Params.tags | default slice -}}
|
||||
{{- $tags := $params.tags | default slice -}}
|
||||
{{- $one = delimit $tags "\n" | dict "tags" | merge $one -}}
|
||||
{{- $publish_date := .PublishDate.Format (.Site.Params.dateFormatToUse | default "2006-01-02") -}}
|
||||
{{- $publish_date := .PublishDate.Format (.Site.Params.dateFormat | default "2006-01-02") -}}
|
||||
{{- $one = dict "date" $publish_date | merge $one -}}
|
||||
{{- $content := partial "function/content.html" .Content | plainify -}}
|
||||
{{- $content := dict "content" .Content "ruby" $params.ruby "fraction" $params.fraction "fontawesome" $params.fontawesome | partial "function/content.html" | plainify -}}
|
||||
{{- if gt .Site.Params.search.contentLength 0 -}}
|
||||
{{- $content = substr $content 0 .Site.Params.search.contentLength -}}
|
||||
{{- end -}}
|
||||
|
|
|
@ -1,66 +1,60 @@
|
|||
{{- $scratch := .Scratch.Get "scratch" -}}
|
||||
{{- $CDN := $scratch.Get "CDN" -}}
|
||||
{{- $fingerprint := $scratch.Get "fingerprint" -}}
|
||||
{{- $config := dict "desktopHeaderMode" .Site.Params.header.desktopMode "mobileHeaderMode" .Site.Params.header.mobileMode -}}
|
||||
{{- with $scratch.Get "contentData" -}}
|
||||
{{- $config = dict "content" . | merge $config -}}
|
||||
{{- end -}}
|
||||
{{- with $scratch.Get "comment" -}}
|
||||
{{- $config = dict "comment" . | merge $config -}}
|
||||
{{- end -}}
|
||||
{{- $params := .Scratch.Get "params" -}}
|
||||
{{- $cdn := .Scratch.Get "cdn" | default dict -}}
|
||||
{{- $fingerprint := .Scratch.Get "fingerprint" -}}
|
||||
{{- $config := (.Scratch.Get "this").config -}}
|
||||
|
||||
{{- /* Fork Awesome */ -}}
|
||||
{{- if $scratch.Get "forkawesome" -}}
|
||||
{{- if (.Scratch.Get "this").forkawesome -}}
|
||||
{{- $options := dict "targetPath" "lib/forkawesome/fork-awesome.min.css" -}}
|
||||
{{- dict "source" "lib/forkawesome/fork-awesome.scss" "toCSS" $options "fingerprint" $fingerprint | slice | $scratch.Add "stylesheet" -}}
|
||||
{{- dict "source" "lib/forkawesome/fork-awesome.scss" "toCSS" $options "fingerprint" $fingerprint | dict "scratch" $.Scratch "data" | partial "scratch/stylesheet.html" -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- /* iconfont */ -}}
|
||||
{{- if $scratch.Get "iconfont" -}}
|
||||
{{- with $CDN.iconfontCSS -}}
|
||||
{{- dict "source" . "crossorigin" true | slice | $scratch.Add "stylesheet" -}}
|
||||
{{- if (.Scratch.Get "this").iconfont -}}
|
||||
{{- with $cdn.iconfontCSS -}}
|
||||
{{- dict "source" . "crossorigin" true | dict "scratch" $.Scratch "data" | partial "scratch/stylesheet.html" -}}
|
||||
{{- else -}}
|
||||
{{- dict "source" "lib/iconfont/iconfont.css" "minify" true "fingerprint" $fingerprint | slice | $scratch.Add "stylesheet" -}}
|
||||
{{- dict "source" "lib/iconfont/iconfont.css" "minify" true "fingerprint" $fingerprint | dict "scratch" $.Scratch "data" | partial "scratch/stylesheet.html" -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- /* Smooth Scroll */ -}}
|
||||
{{- with $CDN.smoothScrollJS -}}
|
||||
{{- dict "source" . "crossorigin" true | slice | $scratch.Add "script" -}}
|
||||
{{- with $cdn.smoothScrollJS -}}
|
||||
{{- dict "source" . "crossorigin" true | dict "scratch" $.Scratch "data" | partial "scratch/script.html" -}}
|
||||
{{- else -}}
|
||||
{{- dict "source" "lib/smooth-scroll/smooth-scroll.min.js" "fingerprint" $fingerprint | slice | $scratch.Add "script" -}}
|
||||
{{- dict "source" "lib/smooth-scroll/smooth-scroll.min.js" "fingerprint" $fingerprint | dict "scratch" $.Scratch "data" | partial "scratch/script.html" -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- /* Search */ -}}
|
||||
{{- if .Site.Params.search.enable -}}
|
||||
{{- with $CDN.autocompleteJS -}}
|
||||
{{- dict "source" . "crossorigin" true | slice | $scratch.Add "script" -}}
|
||||
{{- with $cdn.autocompleteJS -}}
|
||||
{{- dict "source" . "crossorigin" true | dict "scratch" $.Scratch "data" | partial "scratch/script.html" -}}
|
||||
{{- else -}}
|
||||
{{- dict "source" "lib/autocomplete/autocomplete.min.js" "fingerprint" $fingerprint | slice | $scratch.Add "script" -}}
|
||||
{{- dict "source" "lib/autocomplete/autocomplete.min.js" "fingerprint" $fingerprint | dict "scratch" $.Scratch "data" | partial "scratch/script.html" -}}
|
||||
{{- end -}}
|
||||
{{- $searchConfig := dict "noResultsFound" (T "noResultsFound") -}}
|
||||
{{- if eq .Site.Params.search.type "lunr" -}}
|
||||
{{- with .Site.Home.OutputFormats.Get "json" -}}
|
||||
{{- $searchConfig = dict "type" "lunr" "lunrIndexURL" .RelPermalink | merge $searchConfig -}}
|
||||
{{- end -}}
|
||||
{{- with $CDN.lunrJS -}}
|
||||
{{- dict "source" . "crossorigin" true | slice | $scratch.Add "script" -}}
|
||||
{{- with $cdn.lunrJS -}}
|
||||
{{- dict "source" . "crossorigin" true | dict "scratch" $.Scratch "data" | partial "scratch/script.html" -}}
|
||||
{{- else -}}
|
||||
{{- dict "source" "lib/lunr/lunr.min.js" "fingerprint" $fingerprint | slice | $scratch.Add "script" -}}
|
||||
{{- dict "source" "lib/lunr/lunr.min.js" "fingerprint" $fingerprint | dict "scratch" $.Scratch "data" | partial "scratch/script.html" -}}
|
||||
{{- end -}}
|
||||
{{- if ne .Language.Lang "en" -}}
|
||||
{{- $searchConfig = T "lunrLanguageCode" | dict "lunrLanguageCode" | merge $searchConfig -}}
|
||||
{{- if eq .Language.Lang "zh-cn" -}}
|
||||
{{- $searchConfig = dict "lunrSegmentitURL" (resources.Get "lib/lunr/lunr.segmentit.js").RelPermalink | merge $searchConfig -}}
|
||||
{{- end -}}
|
||||
{{- dict "source" "lib/lunr/lunr.stemmer.support.js" "minify" true "fingerprint" $fingerprint | slice | $scratch.Add "script" -}}
|
||||
{{- dict "source" (T "lunrLanguageLib") "minify" true "fingerprint" $fingerprint | slice | $scratch.Add "script" -}}
|
||||
{{- 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 .Site.Params.search.type "algolia" -}}
|
||||
{{- with $CDN.algoliasearchJS -}}
|
||||
{{- dict "source" . "crossorigin" true | slice | $scratch.Add "script" -}}
|
||||
{{- with $cdn.algoliasearchJS -}}
|
||||
{{- dict "source" . "crossorigin" true | dict "scratch" $.Scratch "data" | partial "scratch/script.html" -}}
|
||||
{{- else -}}
|
||||
{{- dict "source" "lib/algoliasearch/algoliasearch-lite.umd.min.js" "fingerprint" $fingerprint | slice | $scratch.Add "script" -}}
|
||||
{{- dict "source" "lib/algoliasearch/algoliasearch-lite.umd.min.js" "fingerprint" $fingerprint | dict "scratch" $.Scratch "data" | partial "scratch/script.html" -}}
|
||||
{{- end -}}
|
||||
{{- $searchConfig = dict "type" "algolia" "algoliaIndex" .Site.Params.search.algolia.index "algoliaAppID" .Site.Params.search.algolia.appID "algoliaSearchKey" .Site.Params.search.algolia.searchKey | merge $searchConfig -}}
|
||||
{{- end -}}
|
||||
|
@ -68,61 +62,63 @@
|
|||
{{- end -}}
|
||||
|
||||
{{- /* lazysizes */ -}}
|
||||
{{- with $CDN.lazysizesJS -}}
|
||||
{{- dict "source" . "crossorigin" true | slice | $scratch.Add "script" -}}
|
||||
{{- with $cdn.lazysizesJS -}}
|
||||
{{- dict "source" . "crossorigin" true | dict "scratch" $.Scratch "data" | partial "scratch/script.html" -}}
|
||||
{{- else -}}
|
||||
{{- dict "source" "lib/lazysizes/lazysizes.min.js" "fingerprint" $fingerprint | slice | $scratch.Add "script" -}}
|
||||
{{- dict "source" "lib/lazysizes/lazysizes.min.js" "fingerprint" $fingerprint | dict "scratch" $.Scratch "data" | partial "scratch/script.html" -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- /* lightgallery.js */ -}}
|
||||
{{- if ne .Site.Params.page.lightgallery false | and (ne .Params.lightgallery false) -}}
|
||||
{{- with $CDN.lightgalleryCSS -}}
|
||||
{{- dict "source" . "crossorigin" true | slice | $scratch.Add "stylesheet" -}}
|
||||
{{- if $params.lightgallery -}}
|
||||
{{- with $cdn.lightgalleryCSS -}}
|
||||
{{- dict "source" . "crossorigin" true | dict "scratch" $.Scratch "data" | partial "scratch/stylesheet.html" -}}
|
||||
{{- else -}}
|
||||
{{- dict "source" "lib/lightgallery/lightgallery.min.css" "fingerprint" $fingerprint | slice | $scratch.Add "stylesheet" -}}
|
||||
{{- dict "source" "lib/lightgallery/lightgallery.min.css" "fingerprint" $fingerprint | dict "scratch" $.Scratch "data" | partial "scratch/stylesheet.html" -}}
|
||||
{{- end -}}
|
||||
{{- with $CDN.lightgalleryJS -}}
|
||||
{{- dict "source" . "crossorigin" true | slice | $scratch.Add "script" -}}
|
||||
{{- with $cdn.lightgalleryJS -}}
|
||||
{{- dict "source" . "crossorigin" true | dict "scratch" $.Scratch "data" | partial "scratch/script.html" -}}
|
||||
{{- else -}}
|
||||
{{- dict "source" "lib/lightgallery/lightgallery.min.js" "fingerprint" $fingerprint | slice | $scratch.Add "script" -}}
|
||||
{{- dict "source" "lib/lightgallery/lightgallery.min.js" "fingerprint" $fingerprint | dict "scratch" $.Scratch "data" | partial "scratch/script.html" -}}
|
||||
{{- end -}}
|
||||
{{- with $CDN.lightgalleryThumbnailJS -}}
|
||||
{{- dict "source" . "crossorigin" true | slice | $scratch.Add "script" -}}
|
||||
{{- with $cdn.lightgalleryThumbnailJS -}}
|
||||
{{- dict "source" . "crossorigin" true | dict "scratch" $.Scratch "data" | partial "scratch/script.html" -}}
|
||||
{{- else -}}
|
||||
{{- dict "source" "lib/lightgallery/lg-thumbnail.min.js" "fingerprint" $fingerprint | slice | $scratch.Add "script" -}}
|
||||
{{- dict "source" "lib/lightgallery/lg-thumbnail.min.js" "fingerprint" $fingerprint | dict "scratch" $.Scratch "data" | partial "scratch/script.html" -}}
|
||||
{{- end -}}
|
||||
{{- with $CDN.lightgalleryZoomJS -}}
|
||||
{{- dict "source" . "crossorigin" true | slice | $scratch.Add "script" -}}
|
||||
{{- with $cdn.lightgalleryZoomJS -}}
|
||||
{{- dict "source" . "crossorigin" true | dict "scratch" $.Scratch "data" | partial "scratch/script.html" -}}
|
||||
{{- else -}}
|
||||
{{- dict "source" "lib/lightgallery/lg-zoom.min.js" "fingerprint" $fingerprint | slice | $scratch.Add "script" -}}
|
||||
{{- dict "source" "lib/lightgallery/lg-zoom.min.js" "fingerprint" $fingerprint | dict "scratch" $.Scratch "data" | partial "scratch/script.html" -}}
|
||||
{{- end -}}
|
||||
{{- $lightGalleryConfig := dict "selector" ".lightgallery" "speed" 400 "hideBarsDelay" 2000 "thumbnail" true "exThumbImage" "data-thumbnail" "thumbWidth" 80 "thumbContHeight" 80 "actualSize" false -}}
|
||||
{{- $config = dict "lightGallery" $lightGalleryConfig | merge $config -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- /* clipboard.js */ -}}
|
||||
{{- with $CDN.clipboardJS -}}
|
||||
{{- dict "source" . "crossorigin" true | slice | $scratch.Add "script" -}}
|
||||
{{- else -}}
|
||||
{{- dict "source" "lib/clipboard/clipboard.min.js" "fingerprint" $fingerprint | slice | $scratch.Add "script" -}}
|
||||
{{- if ne $params.copycode false -}}
|
||||
{{- with $cdn.clipboardJS -}}
|
||||
{{- dict "source" . "crossorigin" true | dict "scratch" $.Scratch "data" | partial "scratch/script.html" -}}
|
||||
{{- else -}}
|
||||
{{- dict "source" "lib/clipboard/clipboard.min.js" "fingerprint" $fingerprint | dict "scratch" $.Scratch "data" | partial "scratch/script.html" -}}
|
||||
{{- end -}}
|
||||
{{- $config = T "copyToClipboard" | dict "title" | dict "clipboard" | merge $config -}}
|
||||
{{- end -}}
|
||||
{{- $config = T "copyToClipboard" | dict "title" | dict "clipboard" | merge $config -}}
|
||||
|
||||
{{- /* Sharer.js */ -}}
|
||||
{{- if $scratch.Get "share" -}}
|
||||
{{- with $CDN.sharerJS -}}
|
||||
{{- dict "source" . "crossorigin" true | slice | $scratch.Add "script" -}}
|
||||
{{- if $params.share.enable -}}
|
||||
{{- with $cdn.sharerJS -}}
|
||||
{{- dict "source" . "crossorigin" true | dict "scratch" $.Scratch "data" | partial "scratch/script.html" -}}
|
||||
{{- else -}}
|
||||
{{- dict "source" "lib/sharer/sharer.min.js" "fingerprint" $fingerprint | slice | $scratch.Add "script" -}}
|
||||
{{- dict "source" "lib/sharer/sharer.min.js" "fingerprint" $fingerprint | dict "scratch" $.Scratch "data" | partial "scratch/script.html" -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- /* TypeIt */ -}}
|
||||
{{- with $scratch.Get "typeitMap" -}}
|
||||
{{- with $CDN.typeitJS -}}
|
||||
{{- dict "source" . "crossorigin" true | slice | $scratch.Add "script" -}}
|
||||
{{- with (.Scratch.Get "this").typeitMap -}}
|
||||
{{- with $cdn.typeitJS -}}
|
||||
{{- dict "source" . "crossorigin" true | dict "scratch" $.Scratch "data" | partial "scratch/script.html" -}}
|
||||
{{- else -}}
|
||||
{{- dict "source" "lib/typeit/typeit.min.js" "fingerprint" $fingerprint | slice | $scratch.Add "script" -}}
|
||||
{{- dict "source" "lib/typeit/typeit.min.js" "fingerprint" $fingerprint | dict "scratch" $.Scratch "data" | partial "scratch/script.html" -}}
|
||||
{{- end -}}
|
||||
{{- $typeitConfig := slice -}}
|
||||
{{- range $key, $val := . -}}
|
||||
|
@ -132,40 +128,40 @@
|
|||
{{- end -}}
|
||||
|
||||
{{- /* KaTeX */ -}}
|
||||
{{- if ne .Site.Params.math.enable false | and .Params.math -}}
|
||||
{{- with $CDN.katexCSS -}}
|
||||
{{- dict "source" . "crossorigin" true | slice | $scratch.Add "stylesheet" -}}
|
||||
{{- if $params.math.enable -}}
|
||||
{{- with $cdn.katexCSS -}}
|
||||
{{- dict "source" . "crossorigin" true | dict "scratch" $.Scratch "data" | partial "scratch/stylesheet.html" -}}
|
||||
{{- else -}}
|
||||
{{- dict "source" "lib/katex/katex.min.css" "fingerprint" $fingerprint | slice | $scratch.Add "stylesheet" -}}
|
||||
{{- dict "source" "lib/katex/katex.min.css" "fingerprint" $fingerprint | dict "scratch" $.Scratch "data" | partial "scratch/stylesheet.html" -}}
|
||||
{{- end -}}
|
||||
{{- with $CDN.katexJS -}}
|
||||
{{- dict "source" . "crossorigin" true | slice | $scratch.Add "script" -}}
|
||||
{{- with $cdn.katexJS -}}
|
||||
{{- dict "source" . "crossorigin" true | dict "scratch" $.Scratch "data" | partial "scratch/script.html" -}}
|
||||
{{- else -}}
|
||||
{{- dict "source" "lib/katex/katex.min.js" "fingerprint" $fingerprint | slice | $scratch.Add "script" -}}
|
||||
{{- dict "source" "lib/katex/katex.min.js" "fingerprint" $fingerprint | dict "scratch" $.Scratch "data" | partial "scratch/script.html" -}}
|
||||
{{- end -}}
|
||||
{{- with $CDN.katexAutoRenderJS -}}
|
||||
{{- dict "source" . "crossorigin" true | slice | $scratch.Add "script" -}}
|
||||
{{- with $cdn.katexAutoRenderJS -}}
|
||||
{{- dict "source" . "crossorigin" true | dict "scratch" $.Scratch "data" | partial "scratch/script.html" -}}
|
||||
{{- else -}}
|
||||
{{- dict "source" "lib/katex/auto-render.min.js" "fingerprint" $fingerprint | slice | $scratch.Add "script" -}}
|
||||
{{- dict "source" "lib/katex/auto-render.min.js" "fingerprint" $fingerprint | dict "scratch" $.Scratch "data" | partial "scratch/script.html" -}}
|
||||
{{- end -}}
|
||||
{{- $math := .Site.Params.math -}}
|
||||
{{- $math := $params.math -}}
|
||||
{{- if $math.copyTex -}}
|
||||
{{- with $CDN.katexCopyTexCSS -}}
|
||||
{{- dict "source" . "crossorigin" true | slice | $scratch.Add "stylesheet" -}}
|
||||
{{- with $cdn.katexCopyTexCSS -}}
|
||||
{{- dict "source" . "crossorigin" true | dict "scratch" $.Scratch "data" | partial "scratch/stylesheet.html" -}}
|
||||
{{- else -}}
|
||||
{{- dict "source" "lib/katex/copy-tex.min.css" "fingerprint" $fingerprint | slice | $scratch.Add "stylesheet" -}}
|
||||
{{- dict "source" "lib/katex/copy-tex.min.css" "fingerprint" $fingerprint | dict "scratch" $.Scratch "data" | partial "scratch/stylesheet.html" -}}
|
||||
{{- end -}}
|
||||
{{- with $CDN.katexCopyTexJS -}}
|
||||
{{- dict "source" . "crossorigin" true | slice | $scratch.Add "script" -}}
|
||||
{{- with $cdn.katexCopyTexJS -}}
|
||||
{{- dict "source" . "crossorigin" true | dict "scratch" $.Scratch "data" | partial "scratch/script.html" -}}
|
||||
{{- else -}}
|
||||
{{- dict "source" "lib/katex/copy-tex.min.js" "fingerprint" $fingerprint | slice | $scratch.Add "script" -}}
|
||||
{{- dict "source" "lib/katex/copy-tex.min.js" "fingerprint" $fingerprint | dict "scratch" $.Scratch "data" | partial "scratch/script.html" -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
{{- if $math.mhchem -}}
|
||||
{{- with $CDN.katexMhchemJS -}}
|
||||
{{- dict "source" . "crossorigin" true | slice | $scratch.Add "script" -}}
|
||||
{{- with $cdn.katexMhchemJS -}}
|
||||
{{- dict "source" . "crossorigin" true | dict "scratch" $.Scratch "data" | partial "scratch/script.html" -}}
|
||||
{{- else -}}
|
||||
{{- dict "source" "lib/katex/mhchem.min.js" "fingerprint" $fingerprint | slice | $scratch.Add "script" -}}
|
||||
{{- dict "source" "lib/katex/mhchem.min.js" "fingerprint" $fingerprint | dict "scratch" $.Scratch "data" | partial "scratch/script.html" -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
{{- $mathConfig := dict "strict" false -}}
|
||||
|
@ -182,91 +178,86 @@
|
|||
{{- end -}}
|
||||
|
||||
{{- /* mermaid */ -}}
|
||||
{{- if $scratch.Get "mermaid" -}}
|
||||
{{- with $CDN.mermaidJS -}}
|
||||
{{- dict "source" . "crossorigin" true | slice | $scratch.Add "script" -}}
|
||||
{{- if (.Scratch.Get "this").mermaid -}}
|
||||
{{- with $cdn.mermaidJS -}}
|
||||
{{- dict "source" . "crossorigin" true | dict "scratch" $.Scratch "data" | partial "scratch/script.html" -}}
|
||||
{{- else -}}
|
||||
{{- dict "source" "lib/mermaid/mermaid.min.js" "fingerprint" $fingerprint | slice | $scratch.Add "script" -}}
|
||||
{{- dict "source" "lib/mermaid/mermaid.min.js" "fingerprint" $fingerprint | dict "scratch" $.Scratch "data" | partial "scratch/script.html" -}}
|
||||
{{- end -}}
|
||||
{{- $options := dict "targetPath" "lib/mermaid/mermaid.min.css" -}}
|
||||
{{- dict "source" "lib/mermaid/mermaid.scss" "toCSS" $options "fingerprint" $fingerprint | slice | $scratch.Add "stylesheet" -}}
|
||||
{{- dict "source" "lib/mermaid/mermaid.scss" "toCSS" $options "fingerprint" $fingerprint | dict "scratch" $.Scratch "data" | partial "scratch/stylesheet.html" -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- /* ECharts */ -}}
|
||||
{{- if $scratch.Get "echarts" -}}
|
||||
{{- with $CDN.echartsJS -}}
|
||||
{{- dict "source" . "crossorigin" true | slice | $scratch.Add "script" -}}
|
||||
{{- if (.Scratch.Get "this").echarts -}}
|
||||
{{- with $cdn.echartsJS -}}
|
||||
{{- dict "source" . "crossorigin" true | dict "scratch" $.Scratch "data" | partial "scratch/script.html" -}}
|
||||
{{- else -}}
|
||||
{{- dict "source" "lib/echarts/echarts.min.js" "fingerprint" $fingerprint | slice | $scratch.Add "script" -}}
|
||||
{{- dict "source" "lib/echarts/echarts.min.js" "fingerprint" $fingerprint | dict "scratch" $.Scratch "data" | partial "scratch/script.html" -}}
|
||||
{{- end -}}
|
||||
{{- with $CDN.echartsMacaronsJS -}}
|
||||
{{- dict "source" . "crossorigin" true | slice | $scratch.Add "script" -}}
|
||||
{{- with $cdn.echartsMacaronsJS -}}
|
||||
{{- dict "source" . "crossorigin" true | dict "scratch" $.Scratch "data" | partial "scratch/script.html" -}}
|
||||
{{- else -}}
|
||||
{{- dict "source" "lib/echarts/macarons.js" "minify" true "fingerprint" $fingerprint | slice | $scratch.Add "script" -}}
|
||||
{{- dict "source" "lib/echarts/macarons.js" "minify" true "fingerprint" $fingerprint | dict "scratch" $.Scratch "data" | partial "scratch/script.html" -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- /* Mapbox GL */ -}}
|
||||
{{- if $scratch.Get "mapbox" -}}
|
||||
{{- with $CDN.mapboxGLCSS -}}
|
||||
{{- dict "source" . "crossorigin" true | slice | $scratch.Add "stylesheet" -}}
|
||||
{{- if (.Scratch.Get "this").mapbox -}}
|
||||
{{- with $cdn.mapboxGLCSS -}}
|
||||
{{- dict "source" . "crossorigin" true | dict "scratch" $.Scratch "data" | partial "scratch/stylesheet.html" -}}
|
||||
{{- else -}}
|
||||
{{- dict "source" "lib/mapbox-gl/mapbox-gl.min.css" "fingerprint" $fingerprint | slice | $scratch.Add "stylesheet" -}}
|
||||
{{- dict "source" "lib/mapbox-gl/mapbox-gl.min.css" "fingerprint" $fingerprint | dict "scratch" $.Scratch "data" | partial "scratch/stylesheet.html" -}}
|
||||
{{- end -}}
|
||||
{{- with $CDN.mapboxGLJS -}}
|
||||
{{- dict "source" . "crossorigin" true | slice | $scratch.Add "script" -}}
|
||||
{{- with $cdn.mapboxGLJS -}}
|
||||
{{- dict "source" . "crossorigin" true | dict "scratch" $.Scratch "data" | partial "scratch/script.html" -}}
|
||||
{{- else -}}
|
||||
{{- dict "source" "lib/mapbox-gl/mapbox-gl.min.js" "fingerprint" $fingerprint | slice | $scratch.Add "script" -}}
|
||||
{{- dict "source" "lib/mapbox-gl/mapbox-gl.min.js" "fingerprint" $fingerprint | dict "scratch" $.Scratch "data" | partial "scratch/script.html" -}}
|
||||
{{- end -}}
|
||||
{{- dict "source" "lib/mapbox-gl/mapbox-gl-language.js" "minify" true "fingerprint" $fingerprint | slice | $scratch.Add "script" -}}
|
||||
{{- $mapbox := dict "accessToken" (.Params.mapbox.accessToken | default .Site.Params.mapbox.accessToken) "RTLTextPlugin" "https://api.mapbox.com/mapbox-gl-js/plugins/mapbox-gl-rtl-text/v0.2.0/mapbox-gl-rtl-text.js" -}}
|
||||
{{- $config = dict "mapbox" $mapbox | merge $config -}}
|
||||
{{- 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 "music" -}}
|
||||
{{- if (.Scratch.Get "this").music -}}
|
||||
{{- /* APlayer */ -}}
|
||||
{{- with $CDN.aplayerCSS -}}
|
||||
{{- dict "source" . "crossorigin" true | slice | $scratch.Add "stylesheet" -}}
|
||||
{{- with $cdn.aplayerCSS -}}
|
||||
{{- dict "source" . "crossorigin" true | dict "scratch" $.Scratch "data" | partial "scratch/stylesheet.html" -}}
|
||||
{{- else -}}
|
||||
{{- dict "source" "lib/aplayer/APlayer.min.css" "fingerprint" $fingerprint | slice | $scratch.Add "stylesheet" -}}
|
||||
{{- dict "source" "lib/aplayer/APlayer.min.css" "fingerprint" $fingerprint | dict "scratch" $.Scratch "data" | partial "scratch/stylesheet.html" -}}
|
||||
{{- end -}}
|
||||
{{- $options := dict "targetPath" "lib/aplayer/dark.min.css" -}}
|
||||
{{- dict "source" "lib/aplayer/dark.scss" "toCSS" $options "fingerprint" $fingerprint | slice | $scratch.Add "stylesheet" -}}
|
||||
{{- with $CDN.aplayerJS -}}
|
||||
{{- dict "source" . "crossorigin" true | slice | $scratch.Add "script" -}}
|
||||
{{- dict "source" "lib/aplayer/dark.scss" "toCSS" $options "fingerprint" $fingerprint | dict "scratch" $.Scratch "data" | partial "scratch/stylesheet.html" -}}
|
||||
{{- with $cdn.aplayerJS -}}
|
||||
{{- dict "source" . "crossorigin" true | dict "scratch" $.Scratch "data" | partial "scratch/script.html" -}}
|
||||
{{- else -}}
|
||||
{{- dict "source" "lib/aplayer/APlayer.min.js" "fingerprint" $fingerprint | slice | $scratch.Add "script" -}}
|
||||
{{- dict "source" "lib/aplayer/APlayer.min.js" "fingerprint" $fingerprint | dict "scratch" $.Scratch "data" | partial "scratch/script.html" -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- /* MetingJS */ -}}
|
||||
{{- with $CDN.metingJS -}}
|
||||
{{- dict "source" . "crossorigin" true | slice | $scratch.Add "script" -}}
|
||||
{{- with $cdn.metingJS -}}
|
||||
{{- dict "source" . "crossorigin" true | dict "scratch" $.Scratch "data" | partial "scratch/script.html" -}}
|
||||
{{- else -}}
|
||||
{{- dict "source" "lib/meting/Meting.min.js" "fingerprint" $fingerprint | slice | $scratch.Add "script" -}}
|
||||
{{- dict "source" "lib/meting/Meting.min.js" "fingerprint" $fingerprint | dict "scratch" $.Scratch "data" | partial "scratch/script.html" -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- /* Dev feature */ -}}
|
||||
{{- if .Params.dev -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- /* Theme script */ -}}
|
||||
{{- dict "source" "js/theme.min.js" "fingerprint" $fingerprint | slice | $scratch.Add "script" -}}
|
||||
{{- dict "source" "js/theme.min.js" "fingerprint" $fingerprint | dict "scratch" $.Scratch "data" | partial "scratch/script.html" -}}
|
||||
{{- $_ := (resources.Get "js/theme.min.js.map").RelPermalink -}}
|
||||
|
||||
{{- range $scratch.Get "stylesheet" -}}
|
||||
{{- range (.Scratch.Get "this").stylesheet -}}
|
||||
{{- partial "plugin/stylesheet.html" . -}}
|
||||
{{- end -}}
|
||||
|
||||
<script type="text/javascript">
|
||||
window.config = {{ jsonify $config | safeJS }};
|
||||
window.config = {{ $config | jsonify | safeJS }};
|
||||
</script>
|
||||
|
||||
{{- /* Polyfill.io */ -}}
|
||||
{{- partial "plugin/script.html" (dict "source" "https://polyfill.io/v3/polyfill.min.js?features=Element.prototype.closest%2CrequestAnimationFrame%2CCustomEvent%2CPromise%2CObject.entries%2CObject.assign%2CObject.values%2Cfetch%2CElement.prototype.after") -}}
|
||||
|
||||
{{- range $scratch.Get "script" -}}
|
||||
{{- range (.Scratch.Get "this").script -}}
|
||||
{{- partial "plugin/script.html" . -}}
|
||||
{{- end -}}
|
||||
|
||||
|
|
|
@ -1,112 +1,106 @@
|
|||
{{- $scratch := .Scratch.Get "scratch" -}}
|
||||
{{- $CDN := $scratch.Get "CDN" -}}
|
||||
{{- $fingerprint := $scratch.Get "fingerprint" -}}
|
||||
{{- $cdn := .Scratch.Get "cdn" | default dict -}}
|
||||
{{- $fingerprint := .Scratch.Get "fingerprint" -}}
|
||||
{{- $comment := (.Scratch.Get "params").comment | default dict -}}
|
||||
{{- $commentConfig := dict -}}
|
||||
|
||||
{{- if eq hugo.Environment "production" | and (ne .Site.Params.comment.enable false) | and (ne .Params.comment false) -}}
|
||||
{{- if $comment.enable -}}
|
||||
<div id="comments">
|
||||
{{- /* Disqus Comment System */ -}}
|
||||
{{- if .Site.Params.comment.disqus.enable -}}
|
||||
{{- if $comment.disqus.enable -}}
|
||||
<div id="disqus_thread" class="comment"></div>
|
||||
{{- $source := printf "https://%s.disqus.com/embed.js" .Site.Params.comment.disqus.shortname -}}
|
||||
{{- dict "source" $source "defer" true "crossorigin" true | slice | $scratch.Add "script" -}}
|
||||
{{- $source := printf "https://%s.disqus.com/embed.js" $comment.disqus.shortname -}}
|
||||
{{- dict "source" $source "defer" true "crossorigin" true | dict "scratch" $.Scratch "data" | partial "scratch/script.html" -}}
|
||||
<noscript>
|
||||
Please enable JavaScript to view the comments powered by <a href="https://disqus.com/?ref_noscript">Disqus</a>.
|
||||
</noscript>
|
||||
{{- end -}}
|
||||
|
||||
{{- /* Gitalk Comment System */ -}}
|
||||
{{- if .Site.Params.comment.gitalk.enable -}}
|
||||
{{- $gitalk := .Site.Params.comment.gitalk -}}
|
||||
{{- if $comment.gitalk.enable -}}
|
||||
<div id="gitalk" class="comment"></div>
|
||||
{{- with $CDN.gitalkCSS -}}
|
||||
{{- dict "source" . "crossorigin" true | slice | $scratch.Add "stylesheet" -}}
|
||||
{{- with $cdn.gitalkCSS -}}
|
||||
{{- dict "source" . "crossorigin" true | dict "scratch" $.Scratch "data" | partial "scratch/stylesheet.html" -}}
|
||||
{{- else -}}
|
||||
{{- dict "source" "lib/gitalk/gitalk.css" "minify" true "fingerprint" $fingerprint | slice | $scratch.Add "stylesheet" -}}
|
||||
{{- dict "source" "lib/gitalk/gitalk.css" "minify" true "fingerprint" $fingerprint | dict "scratch" $.Scratch "data" | partial "scratch/stylesheet.html" -}}
|
||||
{{- end -}}
|
||||
{{- with $CDN.gitalkJS -}}
|
||||
{{- dict "source" . "crossorigin" true | slice | $scratch.Add "script" -}}
|
||||
{{- with $cdn.gitalkJS -}}
|
||||
{{- dict "source" . "crossorigin" true | dict "scratch" $.Scratch "data" | partial "scratch/script.html" -}}
|
||||
{{- else -}}
|
||||
{{- dict "source" "lib/gitalk/gitalk.min.js" "fingerprint" $fingerprint | slice | $scratch.Add "script" -}}
|
||||
{{- dict "source" "lib/gitalk/gitalk.min.js" "fingerprint" $fingerprint | dict "scratch" $.Scratch "data" | partial "scratch/script.html" -}}
|
||||
{{- end -}}
|
||||
{{- $gitalkConfig := dict "id" .Date "title" .Title "clientID" $gitalk.clientId "clientSecret" $gitalk.clientSecret "repo" $gitalk.repo "owner" $gitalk.owner "admin" (slice $gitalk.owner) -}}
|
||||
{{- $scratch.SetInMap "comment" "gitalk" $gitalkConfig -}}
|
||||
{{- $commentConfig = dict "id" .Date "title" .Title "clientID" $comment.gitalk.clientId "clientSecret" $comment.gitalk.clientSecret "repo" $comment.gitalk.repo "owner" $comment.gitalk.owner "admin" (slice $comment.gitalk.owner) | dict "gitalk" | merge $commentConfig -}}
|
||||
<noscript>
|
||||
Please enable JavaScript to view the comments powered by <a href="https://github.com/gitalk/gitalk"></a>Gitalk</a>.
|
||||
</noscript>
|
||||
{{- end -}}
|
||||
|
||||
{{- /* Valine Comment System */ -}}
|
||||
{{- if .Site.Params.comment.valine.enable -}}
|
||||
{{- $valine := .Site.Params.comment.valine -}}
|
||||
{{- if $comment.valine.enable -}}
|
||||
<div id="valine" class="comment"></div>
|
||||
{{- $options := dict "targetPath" "lib/valine/valine.min.css" -}}
|
||||
{{- dict "source" "lib/valine/valine.scss" "toCSS" $options | slice | $scratch.Add "stylesheet" -}}
|
||||
{{- with $CDN.valineJS -}}
|
||||
{{- dict "source" . "crossorigin" true | slice | $scratch.Add "script" -}}
|
||||
{{- dict "source" "lib/valine/valine.scss" "toCSS" $options | dict "scratch" $.Scratch "data" | partial "scratch/stylesheet.html" -}}
|
||||
{{- with $cdn.valineJS -}}
|
||||
{{- dict "source" . "crossorigin" true | dict "scratch" $.Scratch "data" | partial "scratch/script.html" -}}
|
||||
{{- else -}}
|
||||
{{- dict "source" "lib/valine/Valine.min.js" "fingerprint" $fingerprint | slice | $scratch.Add "script" -}}
|
||||
{{- dict "source" "lib/valine/Valine.min.js" "fingerprint" $fingerprint | dict "scratch" $.Scratch "data" | partial "scratch/script.html" -}}
|
||||
{{- end -}}
|
||||
{{- $valineConfig := dict "el" "#valine" "appId" $valine.appId "appKey" $valine.appKey "lang" ($valine.lang | default "en") "notify" $valine.notify "verify" $valine.verify "visitor" $valine.visitor "recordIP" $valine.recordIP -}}
|
||||
{{- with $valine.placeholder -}}
|
||||
{{- $valineConfig = dict "placeholder" . | merge $valineConfig -}}
|
||||
{{- $commentConfig = dict "el" "#valine" "appId" $comment.valine.appId "appKey" $comment.valine.appKey "lang" ($comment.valine.lang | default (T "valineLang")) "notify" $comment.valine.notify "verify" $comment.valine.verify "visitor" $comment.valine.visitor "recordIP" $comment.valine.recordIP "placeholder" ($comment.valine.placeholder | default (T "valinePlaceholder")) | dict "valine" | merge $commentConfig -}}
|
||||
{{- with $comment.valine.avatar -}}
|
||||
{{- $commentConfig = dict "avatar" . | dict "valine" | merge $commentConfig -}}
|
||||
{{- end -}}
|
||||
{{- with $valine.avatar -}}
|
||||
{{- $valineConfig = dict "avatar" . | merge $valineConfig -}}
|
||||
{{- with $comment.valine.meta -}}
|
||||
{{- $commentConfig = dict "meta" . | dict "valine" | merge $commentConfig -}}
|
||||
{{- end -}}
|
||||
{{- with $valine.meta -}}
|
||||
{{- $valineConfig = dict "meta" . | merge $valineConfig -}}
|
||||
{{- with $comment.valine.pageSize -}}
|
||||
{{- $commentConfig = dict "pageSize" . | dict "valine" | merge $commentConfig -}}
|
||||
{{- end -}}
|
||||
{{- with $valine.pageSize -}}
|
||||
{{- $valineConfig = dict "pageSize" . | merge $valineConfig -}}
|
||||
{{- end -}}
|
||||
{{- $scratch.SetInMap "comment" "valine" $valineConfig -}}
|
||||
<noscript>
|
||||
Please enable JavaScript to view the comments powered by <a href="https://valine.js.org/">Valine</a>.
|
||||
</noscript>
|
||||
{{- end -}}
|
||||
|
||||
{{- /* Facebook Comment System */ -}}
|
||||
{{- if .Site.Params.comment.facebook.enable -}}
|
||||
{{- $facebook := .Site.Params.comment.facebook -}}
|
||||
{{- if $comment.facebook.enable -}}
|
||||
<div id="fb-root" class="comment"></div>
|
||||
<div
|
||||
class="fb-comments"
|
||||
data-href="{{ .Site.Params.baseURL }}{{ .Permalink | absURL }}"
|
||||
data-width="{{ $facebook.width }}"
|
||||
data-numposts="{{ $facebook.numPosts }}"
|
||||
data-href="{{ .Permalink | absURL }}"
|
||||
data-width="{{ $comment.facebook.width }}"
|
||||
data-numposts="{{ $comment.facebook.numPosts }}"
|
||||
></div>
|
||||
{{- $source := printf "https://connect.facebook.net/%s/sdk.js#xfbml=1&version=v5.0&appId=%s&autoLogAppEvents=1" $facebook.languageCode $facebook.appId -}}
|
||||
{{- dict "source" $source "defer" true "crossorigin" true | slice | $scratch.Add "script" -}}
|
||||
{{- $source := printf "https://connect.facebook.net/%s/sdk.js#xfbml=1&version=v5.0&appId=%s&autoLogAppEvents=1" ($comment.facebook.languageCode | default (T "facebookLanguageCode")) $comment.facebook.appId -}}
|
||||
{{- dict "source" $source "defer" true "crossorigin" true | dict "scratch" $.Scratch "data" | partial "scratch/script.html" -}}
|
||||
<noscript>
|
||||
Please enable JavaScript to view the comments powered by <a href="https://developers.facebook.com/docs/plugins/comments/"></a>Facebook</a>.
|
||||
</noscript>
|
||||
{{- end -}}
|
||||
|
||||
{{- /* Telegram Comments System */ -}}
|
||||
{{- if .Site.Params.comment.telegram.enable -}}
|
||||
{{- $telegram := .Site.Params.comment.telegram -}}
|
||||
{{- if $comment.telegram.enable -}}
|
||||
<div id="telegram-comments" class="comment"></div>
|
||||
{{- $attr := printf `data-comments-app-website="%s"` $telegram.siteID -}}
|
||||
{{- $attr = printf `%s data-limit="%s"` $attr ($telegram.limit | default 5) -}}
|
||||
{{- with $telegram.height -}}
|
||||
{{- $attr := printf `data-comments-app-website="%s"` $comment.telegram.siteID -}}
|
||||
{{- $attr = printf `%s data-limit="%s"` $attr ($comment.telegram.limit | default 5) -}}
|
||||
{{- with $comment.telegram.height -}}
|
||||
{{- $attr = printf `%s data-height="%s"` $attr . -}}
|
||||
{{- end -}}
|
||||
{{- with $telegram.color -}}
|
||||
{{- with $comment.telegram.color -}}
|
||||
{{- $attr = printf `%s data-color="%s"` $attr . -}}
|
||||
{{- end -}}
|
||||
{{- if $telegram.colorful -}}
|
||||
{{- if $comment.telegram.colorful -}}
|
||||
{{- $attr = printf `%s data-colorful="1"` $attr -}}
|
||||
{{- end -}}
|
||||
{{- if $telegram.dislikes -}}
|
||||
{{- if $comment.telegram.dislikes -}}
|
||||
{{- $attr = printf `%s data-dislikes="1"` $attr -}}
|
||||
{{- end -}}
|
||||
{{- if $telegram.outlined -}}
|
||||
{{- if $comment.telegram.outlined -}}
|
||||
{{- $attr = printf `%s data-outlined="1"` $attr -}}
|
||||
{{- end -}}
|
||||
{{- dict "source" "https://comments.app/js/widget.js?2" "defer" true "crossorigin" true "attr" $attr | slice | $scratch.Add "script" -}}
|
||||
{{- dict "source" "https://comments.app/js/widget.js?2" "defer" true "crossorigin" true "attr" $attr | dict "scratch" $.Scratch "data" | partial "scratch/script.html" -}}
|
||||
<noscript>
|
||||
Please enable JavaScript to view the comments powered by <a href="https://comments.app/">Telegram Comments</a>.
|
||||
</noscript>
|
||||
{{- end -}}
|
||||
</div>
|
||||
{{- end -}}
|
||||
|
||||
{{- dict "comment" $commentConfig | dict "config" | merge (.Scratch.Get "this") | .Scratch.Set "this" -}}
|
||||
|
|
|
@ -1,39 +1,50 @@
|
|||
{{- $scratch := .Scratch.Get "scratch" -}}
|
||||
{{- if ne .Site.Params.footer.enable false -}}
|
||||
<footer class="footer">
|
||||
<div class="footer-container">
|
||||
{{- /* Custom Content */ -}}
|
||||
{{- with .Site.Params.footer.custom -}}
|
||||
<div class="footer-line">
|
||||
{{- safeHTML . -}}
|
||||
</div>
|
||||
{{- end -}}
|
||||
|
||||
<footer class="footer">
|
||||
<div class="copyright">
|
||||
{{- /* Hugo and LoveIt */ -}}
|
||||
<div class="copyright-line">
|
||||
{{- $hugo := printf `<a href="https://gohugo.io/" target="_blank" rel="noopener noreffer" title="Hugo %s">Hugo</a>` hugo.Version -}}
|
||||
{{- printf (T "poweredBySome") $hugo | safeHTML }} | {{ T "theme" }} - <a href="https://github.com/dillonzq/LoveIt" target="_blank" rel="noopener noreffer" title="LoveIt {{ $scratch.Get "version" }}"><i class="far fa-heart fa-fw"></i> LoveIt</a>
|
||||
{{- /* Hugo and LoveIt */ -}}
|
||||
{{- if ne .Site.Params.footer.hugo false -}}
|
||||
<div class="footer-line">
|
||||
{{- $hugo := printf `<a href="https://gohugo.io/" target="_blank" rel="noopener noreffer" title="Hugo %s">Hugo</a>` hugo.Version -}}
|
||||
{{- printf (T "poweredBySome") $hugo | safeHTML }} | {{ T "theme" }} - <a href="https://github.com/dillonzq/LoveIt" target="_blank" rel="noopener noreffer" title="LoveIt {{ .Scratch.Get `version` }}"><i class="far fa-heart fa-fw"></i> LoveIt</a>
|
||||
</div>
|
||||
{{- end -}}
|
||||
|
||||
<div class="footer-line">
|
||||
{{- /* Copyright year */ -}}
|
||||
{{- if ne .Site.Params.footer.copyright false -}}
|
||||
<i class="far fa-copyright fa-fw"></i>
|
||||
{{- with .Site.Params.footer.since -}}
|
||||
<span itemprop="copyrightYear">
|
||||
{{- if lt . now.Year }}{{ . }} - {{ end }}{{ now.Year -}}
|
||||
</span>
|
||||
{{- else -}}
|
||||
<span itemprop="copyrightYear">{{ now.Year }}</span>
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- /* Author */ -}}
|
||||
{{- if ne .Site.Params.footer.author false -}}
|
||||
<span class="author" itemprop="copyrightHolder"> <a href="{{ $.Site.Author.link | default (relLangURL `/`) }}" target="_blank">{{ .Site.Author.name }}</a></span>
|
||||
{{- end -}}
|
||||
|
||||
{{- /* License */ -}}
|
||||
{{- with .Site.Params.footer.license -}}
|
||||
| <span class="license">{{ . | safeHTML }}</span>
|
||||
{{- end -}}
|
||||
|
||||
{{- /* ICP */ -}}
|
||||
{{- with .Site.Params.footer.icp -}}
|
||||
<span class="icp-splitter"> | </span><br class="icp-br"/>
|
||||
<span class="icp">{{ . | safeHTML }}</span>
|
||||
{{- end -}}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="copyright-line">
|
||||
{{- /* Copyright year */ -}}
|
||||
<i class="far fa-copyright fa-fw"></i>
|
||||
{{- with .Site.Params.footer.since -}}
|
||||
<span itemprop="copyrightYear">
|
||||
{{- if lt . now.Year }}{{ . }} - {{ end }}{{ now.Year -}}
|
||||
</span>
|
||||
{{- else -}}
|
||||
<span itemprop="copyrightYear">{{ now.Year }}</span>
|
||||
{{- end -}}
|
||||
|
||||
{{- /* Author */ -}}
|
||||
{{- with .Site.Author.name -}}
|
||||
<span class="author" itemprop="copyrightHolder"> <a href="{{ $.Site.Author.link | default (relLangURL `/`) }}" target="_blank">{{ . }}</a></span>
|
||||
{{- end -}}
|
||||
|
||||
{{- /* License */ -}}
|
||||
{{- with .Site.Params.footer.license -}}
|
||||
| <span class="license">{{ . | safeHTML }}</span>
|
||||
{{- end -}}
|
||||
|
||||
{{- /* ICP */ -}}
|
||||
{{- with .Site.Params.footer.icp -}}
|
||||
<span class="icp-splitter"> | </span><br class="icp-br"/>
|
||||
<span class="icp">{{ . | safeHTML }}</span>
|
||||
{{- end -}}
|
||||
</div>
|
||||
</div>
|
||||
</footer>
|
||||
</footer>
|
||||
{{- end -}}
|
||||
|
|
|
@ -1,10 +1,16 @@
|
|||
{{- $content := . -}}
|
||||
{{- $content := .content -}}
|
||||
|
||||
{{- $content = partial "function/ruby.html" $content -}}
|
||||
{{- if .ruby -}}
|
||||
{{- $content = partial "function/ruby.html" $content -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- $content = partial "function/fraction.html" $content -}}
|
||||
{{- if .fraction -}}
|
||||
{{- $content = partial "function/fraction.html" $content -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- $content = partial "function/fontawesome.html" $content -}}
|
||||
{{- if .fontawesome -}}
|
||||
{{- $content = partial "function/fontawesome.html" $content -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- $content = partial "function/checkbox.html" $content -}}
|
||||
|
||||
|
|
|
@ -3,6 +3,6 @@
|
|||
{{- /* shuffle md5 as id */ -}}
|
||||
{{- $id := delimit (split (md5 now.Unix) "" | shuffle | first 6) "" | printf "id-%s" -}}
|
||||
{{- with .scratch -}}
|
||||
{{- .SetInMap "contentData" $id $.content -}}
|
||||
{{- dict $id $.content | dict "data" | dict "config" | merge (.Get "this") | .Set "this" -}}
|
||||
{{- end -}}
|
||||
{{- return $id -}}
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
{{- $scratch := .Scratch.Get "scratch" -}}
|
||||
{{- $CDN := $scratch.Get "CDN" -}}
|
||||
{{- $fingerprint := $scratch.Get "fingerprint" -}}
|
||||
{{- $cdn := .Scratch.Get "cdn" | default dict -}}
|
||||
{{- $fingerprint := .Scratch.Get "fingerprint" -}}
|
||||
|
||||
<link rel="canonical" href="{{ .Permalink }}" />
|
||||
<link rel="shortcut icon" type="image/x-icon" href="/favicon.ico" />
|
||||
|
@ -23,7 +22,7 @@
|
|||
{{- end -}}
|
||||
|
||||
{{- /* normalize.css */ -}}
|
||||
{{- $source := $CDN.normalizeCSS | default "lib/normalize/normalize.min.css" -}}
|
||||
{{- $source := $cdn.normalizeCSS | default "lib/normalize/normalize.min.css" -}}
|
||||
{{- $stylesheet := dict "source" $source "fingerprint" $fingerprint -}}
|
||||
{{- partial "plugin/stylesheet.html" $stylesheet -}}
|
||||
|
||||
|
@ -34,11 +33,11 @@
|
|||
{{- partial "plugin/stylesheet.html" $stylesheet -}}
|
||||
|
||||
{{- /* Font Awesome */ -}}
|
||||
{{- $source := $CDN.fontawesomeFreeCSS | default "lib/fontawesome-free/all.min.css" -}}
|
||||
{{- $source := $cdn.fontawesomeFreeCSS | default "lib/fontawesome-free/all.min.css" -}}
|
||||
{{- $stylesheet := dict "source" $source "fingerprint" $fingerprint -}}
|
||||
{{- partial "plugin/stylesheet.html" $stylesheet -}}
|
||||
|
||||
{{- /* Animate.css */ -}}
|
||||
{{- $source := $CDN.animateCSS | default "lib/animate/animate.min.css" -}}
|
||||
{{- $source := $cdn.animateCSS | default "lib/animate/animate.min.css" -}}
|
||||
{{- $stylesheet := dict "source" $source "fingerprint" $fingerprint -}}
|
||||
{{- partial "plugin/stylesheet.html" $stylesheet -}}
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
{{- $params := .Scratch.Get "params" -}}
|
||||
|
||||
{{- with .Site.Params.verification.google -}}
|
||||
<meta name="google-site-verification" content="{{ . }}" />
|
||||
{{- end -}}
|
||||
|
@ -33,10 +35,10 @@
|
|||
{{- with .Site.Params.description -}}
|
||||
"description": "{{ . | safeJS }}",
|
||||
{{- end -}}
|
||||
{{- with .Site.Params.image -}}
|
||||
{{- with $params.seo.image -}}
|
||||
"image": "{{ .url | absURL }}",
|
||||
{{- end -}}
|
||||
{{- with .Site.Params.logo -}}
|
||||
{{- with $params.seo.logo -}}
|
||||
"thumbnailUrl": "{{ .url | absURL }}",
|
||||
{{- end -}}
|
||||
{{- with .Site.Copyright -}}
|
||||
|
@ -58,12 +60,12 @@
|
|||
"@type": "WebPage",
|
||||
"@id": "{{ .Permalink }}"
|
||||
},
|
||||
{{- if ge .Site.Params.image.width 696 -}}
|
||||
{{- if ge $params.seo.image.width 696 -}}
|
||||
"image": {
|
||||
"@type": "ImageObject",
|
||||
"url": "{{ .Site.Params.image.url | absURL }}",
|
||||
"width": {{ .Site.Params.image.width }},
|
||||
"height": {{ .Site.Params.image.height }}
|
||||
"url": "{{ $params.seo.image.url | absURL }}",
|
||||
"width": {{ $params.seo.image.width }},
|
||||
"height": {{ $params.seo.image.height }}
|
||||
},
|
||||
{{- end -}}
|
||||
"genre": "{{ .Type }}",
|
||||
|
@ -83,7 +85,7 @@
|
|||
{{- with .Site.Copyright -}}
|
||||
"license": "{{ . | safeJS }}",
|
||||
{{- end -}}
|
||||
{{- with .Site.Params.publisher -}}
|
||||
{{- with $params.seo.publisher -}}
|
||||
"publisher": {
|
||||
"@type": "Organization",
|
||||
"name": "{{ .name | safeJS }}",
|
||||
|
|
|
@ -36,7 +36,7 @@
|
|||
{{- end -}}
|
||||
{{- if .Site.Params.search.enable -}}
|
||||
<span class="menu-item search" id="search-desktop">
|
||||
<input type="text" placeholder="{{ T `searchPlaceholder` }}" id="search-input-desktop">
|
||||
<input type="text" placeholder="{{ .Site.Params.search.placeholder | default (T `searchPlaceholder`) }}" id="search-input-desktop">
|
||||
<a href="javascript:void(0);" class="search-button search-toggle" id="search-toggle-desktop" title="{{ T `search` }}">
|
||||
<i class="fas fa-search fa-fw"></i>
|
||||
</a>
|
||||
|
@ -73,7 +73,7 @@
|
|||
{{- if .Site.Params.search.enable -}}
|
||||
<div class="search-wrapper">
|
||||
<div class="search mobile" id="search-mobile">
|
||||
<input type="text" placeholder="{{ T `searchPlaceholder` }}" id="search-input-mobile">
|
||||
<input type="text" placeholder="{{ .Site.Params.search.placeholder | default (T `searchPlaceholder`) }}" id="search-input-mobile">
|
||||
<a href="javascript:void(0);" class="search-button search-toggle" id="search-toggle-mobile" title="{{ T `search` }}">
|
||||
<i class="fas fa-search fa-fw"></i>
|
||||
</a>
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
{{- $scratch := .Scratch.Get "scratch" -}}
|
||||
|
||||
<div class="home-profile">
|
||||
{{- $avatar := .Site.Params.home.profile.avatarURL -}}
|
||||
{{- with .Site.Params.home.profile.gravatarEmail -}}
|
||||
|
@ -16,9 +14,9 @@
|
|||
{{- with .Site.Params.home.profile.subtitle -}}
|
||||
<h2 class="home-subtitle">
|
||||
{{- if $.Site.Params.home.profile.typeit -}}
|
||||
{{- $id := partial "function/id.html" (dict "content" . "scratch" $scratch) -}}
|
||||
{{- $id := partial "function/id.html" (dict "content" . "scratch" $.Scratch) -}}
|
||||
<div id="{{ $id }}" class="typeit"></div>
|
||||
{{- $scratch.SetInMap "typeitMap" $id (slice $id) -}}
|
||||
{{- dict $id (slice $id) | dict "typeitMap" | merge ($.Scratch.Get "this") | $.Scratch.Set "this" -}}
|
||||
{{- else -}}
|
||||
{{- . -}}
|
||||
{{- end -}}
|
||||
|
@ -26,7 +24,7 @@
|
|||
{{- end -}}
|
||||
|
||||
{{- if .Site.Params.home.profile.social -}}
|
||||
{{- partial "plugin/social.html" (dict "social" .Site.Params.social "scratch" $scratch) -}}
|
||||
{{- partial "plugin/social.html" (dict "social" .Site.Params.social "scratch" $.Scratch) -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- with .Site.Params.home.profile.disclaimer -}}
|
||||
|
|
|
@ -12,14 +12,14 @@
|
|||
{{- end -}}
|
||||
{{- $classList = $newClassList -}}
|
||||
{{- with .scratch -}}
|
||||
{{- .Set "forkawesome" true -}}
|
||||
{{- dict "forkawesome" true | merge (.Get "this") | .Set "this" -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- /* default is Font Awesome */ -}}
|
||||
{{- /* Others */ -}}
|
||||
{{- else if ne $type "fa" -}}
|
||||
{{- with .scratch -}}
|
||||
{{- .Set "iconfont" true -}}
|
||||
{{- dict "iconfont" true | merge (.Get "this") | .Set "this" -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
<i class="{{ delimit $classList ` ` }}"></i>
|
|
@ -1,199 +1,197 @@
|
|||
{{- $scratch := .Scratch.Get "scratch" -}}
|
||||
|
||||
{{- if ne .Site.Params.share.enable false | and (ne .Params.share.enable false) -}}
|
||||
{{- $scratch.Set "share" true -}}
|
||||
{{- $share := (.Scratch.Get "params").page.share | default dict -}}
|
||||
|
||||
{{- if $share.enable -}}
|
||||
{{- /* 001: Twitter */ -}}
|
||||
{{- if .Params.Share.Twitter | default .Site.Params.Share.Twitter | eq true -}}
|
||||
{{- if $share.Twitter -}}
|
||||
<a href="javascript:void(0);" title="{{ T `shareOn` }} Twitter" data-sharer="twitter" data-url="{{ .Permalink }}" data-title="{{ .Title }}"{{ with .Site.Params.Social.Twitter }} data-via="{{ . }}"{{ end }}{{ with .Params.tags }} data-hashtags="{{ delimit . `,` }}"{{ end }}>
|
||||
{{- partial "plugin/icon.html" (dict "class" "fab fa-twitter fa-fw") -}}
|
||||
</a>
|
||||
{{- end -}}
|
||||
|
||||
{{- /* 002: Facebook */ -}}
|
||||
{{- if .Params.Share.Facebook | default .Site.Params.Share.Facebook | eq true -}}
|
||||
{{- if $share.Facebook -}}
|
||||
<a href="javascript:void(0);" title="{{ T `shareOn` }} Facebook" data-sharer="facebook" data-url="{{ .Permalink }}"{{ with .Params.tags }} data-hashtag="{{ index . 0 }}"{{ end }}>
|
||||
{{- partial "plugin/icon.html" (dict "class" "fab fa-facebook-square fa-fw") -}}
|
||||
</a>
|
||||
{{- end -}}
|
||||
|
||||
{{- /* 003: Linkedin */ -}}
|
||||
{{- if .Params.Share.Linkedin | default .Site.Params.Share.Linkedin | eq true -}}
|
||||
{{- if $share.Linkedin -}}
|
||||
<a href="javascript:void(0);" title="{{ T `shareOn` }} Linkedin" data-sharer="linkedin" data-url="{{ .Permalink }}">
|
||||
{{- partial "plugin/icon.html" (dict "class" "fab fa-linkedin fa-fw") -}}
|
||||
</a>
|
||||
{{- end -}}
|
||||
|
||||
{{- /* 004: WhatsApp */ -}}
|
||||
{{- if .Params.Share.Whatsapp | default .Site.Params.Share.Whatsapp | eq true -}}
|
||||
{{- if $share.Whatsapp -}}
|
||||
<a href="javascript:void(0);" title="{{ T `shareOn` }} WhatsApp" data-sharer="whatsapp" data-url="{{ .Permalink }}" data-title="{{ .Title }}" data-web>
|
||||
{{- partial "plugin/icon.html" (dict "class" "fab fa-whatsapp fa-fw") -}}
|
||||
</a>
|
||||
{{- end -}}
|
||||
|
||||
{{- /* 005: Viber */ -}}
|
||||
{{- if .Params.Share.Viber | default .Site.Params.Share.Viber | eq true -}}
|
||||
{{- if $share.Viber -}}
|
||||
<a href="javascript:void(0);" title="{{ T `shareOn` }} Viber" data-sharer="viber" data-url="{{ .Permalink }}" data-title="{{ .Title }}">
|
||||
{{- partial "plugin/icon.html" (dict "class" "fab fa-viber fa-fw") -}}
|
||||
</a>
|
||||
{{- end -}}
|
||||
|
||||
{{- /* 006: Pinterest */ -}}
|
||||
{{- if .Params.Share.Pinterest | default .Site.Params.Share.Pinterest | eq true -}}
|
||||
{{- if $share.Pinterest -}}
|
||||
<a href="javascript:void(0);" title="{{ T `shareOn` }} Pinterest" data-sharer="pinterest" data-url="{{ .Permalink }}"{{ with .Description }} data-description="{{ . }}"{{ end }}{{ with .Params.featuredImage }} data-image="{{ . }}"{{ end }}>
|
||||
{{- partial "plugin/icon.html" (dict "class" "fab fa-pinterest fa-fw") -}}
|
||||
</a>
|
||||
{{- end -}}
|
||||
|
||||
{{- /* 007: Tumblr */ -}}
|
||||
{{- if .Params.Share.Tumblr | default .Site.Params.Share.Tumblr | eq true -}}
|
||||
{{- if $share.Tumblr -}}
|
||||
<a href="javascript:void(0);" title="{{ T `shareOn` }} Tumblr" data-sharer="tumblr" data-url="{{ .Permalink }}" data-title="{{ .Title }}"{{ with .Description }} data-caption="{{ . }}"{{ end }}{{ with .Params.tags }} data-tags="{{ delimit . `,` }}"{{ end }}>
|
||||
{{- partial "plugin/icon.html" (dict "class" "fab fa-tumblr fa-fw") -}}
|
||||
</a>
|
||||
{{- end -}}
|
||||
|
||||
{{- /* 008: Hacker News */ -}}
|
||||
{{- if .Params.Share.Hackernews | default .Site.Params.Share.Hackernews | eq true -}}
|
||||
{{- if $share.Hackernews -}}
|
||||
<a href="javascript:void(0);" title="{{ T `shareOn` }} Hacker News" data-sharer="hackernews" data-url="{{ .Permalink }}" data-title="{{ .Title }}">
|
||||
{{- partial "plugin/icon.html" (dict "class" "fab fa-hacker-news fa-fw") -}}
|
||||
</a>
|
||||
{{- end -}}
|
||||
|
||||
{{- /* 009: Reddit */ -}}
|
||||
{{- if .Params.Share.Reddit | default .Site.Params.Share.Reddit | eq true -}}
|
||||
{{- if $share.Reddit -}}
|
||||
<a href="javascript:void(0);" title="{{ T `shareOn` }} Reddit" data-sharer="reddit" data-url="{{ .Permalink }}">
|
||||
{{- partial "plugin/icon.html" (dict "class" "fab fa-reddit fa-fw") -}}
|
||||
</a>
|
||||
{{- end -}}
|
||||
|
||||
{{- /* 010: VK */ -}}
|
||||
{{- if .Params.Share.VK | default .Site.Params.Share.VK | eq true -}}
|
||||
{{- if $share.VK -}}
|
||||
<a href="javascript:void(0);" title="{{ T `shareOn` }} VK" data-sharer="vk" data-url="{{ .Permalink }}" data-title="{{ .Title }}"{{ with .Description }} data-caption="{{ . }}"{{ end }}{{ with .Params.featuredImage }} data-image="{{ . }}"{{ end }}>
|
||||
{{- partial "plugin/icon.html" (dict "class" "fab fa-vk fa-fw") -}}
|
||||
</a>
|
||||
{{- end -}}
|
||||
|
||||
{{- /* 011: Buffer */ -}}
|
||||
{{- if .Params.Share.Buffer | default .Site.Params.Share.Buffer | eq true -}}
|
||||
{{- if $share.Buffer -}}
|
||||
<a href="javascript:void(0);" title="{{ T `shareOn` }} Buffer" data-sharer="buffer" data-url="{{ .Permalink }}" data-title="{{ .Title }}"{{ with .Site.Params.Social.Twitter }} data-via="{{ . }}"{{ end }}{{ with .Params.featuredImage }} data-picture="{{ . }}"{{ end }}>
|
||||
{{- partial "plugin/icon.html" (dict "class" "fab fa-buffer fa-fw") -}}
|
||||
</a>
|
||||
{{- end -}}
|
||||
|
||||
{{- /* 012: Xing */ -}}
|
||||
{{- if .Params.Share.Xing | default .Site.Params.Share.Xing | eq true -}}
|
||||
{{- if $share.Xing -}}
|
||||
<a href="javascript:void(0);" title="{{ T `shareOn` }} Xing" data-sharer="xing" data-url="{{ .Permalink }}" data-title="{{ .Title }}">
|
||||
{{- partial "plugin/icon.html" (dict "class" "fab fa-xing fa-fw") -}}
|
||||
</a>
|
||||
{{- end -}}
|
||||
|
||||
{{- /* 013: Line */ -}}
|
||||
{{- if .Params.Share.Line | default .Site.Params.Share.Line | eq true -}}
|
||||
{{- if $share.Line -}}
|
||||
<a href="javascript:void(0);" title="{{ T `shareOn` }} Line" data-sharer="line" data-url="{{ .Permalink }}" data-title="{{ .Title }}">
|
||||
{{- partial "plugin/icon.html" (dict "class" "fab fa-line fa-fw") -}}
|
||||
</a>
|
||||
{{- end -}}
|
||||
|
||||
{{- /* 014: Instapaper */ -}}
|
||||
{{- if .Params.Share.Instapaper | default .Site.Params.Share.Instapaper | eq true -}}
|
||||
{{- if $share.Instapaper -}}
|
||||
<a href="javascript:void(0);" title="{{ T `shareOn` }} Instapaper" data-sharer="instapaper" data-url="{{ .Permalink }}" data-title="{{ .Title }}" data-description="{{ .Description }}">
|
||||
{{- partial "plugin/icon.html" (dict "class" "loveit it-instapaper-fill" "type" "other" "scratch" $scratch) -}}
|
||||
{{- partial "plugin/icon.html" (dict "class" "loveit it-instapaper-fill" "type" "other" "scratch" .Scratch) -}}
|
||||
</a>
|
||||
{{- end -}}
|
||||
|
||||
{{- /* 015: Pocket */ -}}
|
||||
{{- if .Params.Share.Pocket | default .Site.Params.Share.Pocket | eq true -}}
|
||||
{{- if $share.Pocket -}}
|
||||
<a href="javascript:void(0);" title="{{ T `shareOn` }} Pocket" data-sharer="pocket" data-url="{{ .Permalink }}">
|
||||
{{- partial "plugin/icon.html" (dict "class" "fab fa-get-pocket fa-fw") -}}
|
||||
</a>
|
||||
{{- end -}}
|
||||
|
||||
{{- /* 016: Digg */ -}}
|
||||
{{- if .Params.Share.Digg | default .Site.Params.Share.Digg | eq true -}}
|
||||
{{- if $share.Digg -}}
|
||||
<a href="javascript:void(0);" title="{{ T `shareOn` }} Digg" data-sharer="digg" data-url="{{ .Permalink }}">
|
||||
{{- partial "plugin/icon.html" (dict "class" "fab fa-digg fa-fw") -}}
|
||||
</a>
|
||||
{{- end -}}
|
||||
|
||||
{{- /* 017: StumbleUpon */ -}}
|
||||
{{- if .Params.Share.Stumbleupon | default .Site.Params.Share.Stumbleupon | eq true -}}
|
||||
{{- if $share.Stumbleupon -}}
|
||||
<a href="javascript:void(0);" title="{{ T `shareOn` }} StumbleUpon" data-sharer="stumbleupon" data-url="{{ .Permalink }}" data-title="{{ .Title }}">
|
||||
{{- partial "plugin/icon.html" (dict "class" "fab fa-stumbleupon fa-fw") -}}
|
||||
</a>
|
||||
{{- end -}}
|
||||
|
||||
{{- /* 018: Flipboard */ -}}
|
||||
{{- if .Params.Share.Flipboard | default .Site.Params.Share.Flipboard | eq true -}}
|
||||
{{- if $share.Flipboard -}}
|
||||
<a href="javascript:void(0);" title="{{ T `shareOn` }} Flipboard" data-sharer="flipboard" data-url="{{ .Permalink }}" data-title="{{ .Title }}">
|
||||
{{- partial "plugin/icon.html" (dict "class" "fab fa-flipboard fa-fw") -}}
|
||||
</a>
|
||||
{{- end -}}
|
||||
|
||||
{{- /* 019: 微博 */ -}}
|
||||
{{- if .Params.Share.Weibo | default .Site.Params.Share.Weibo | eq true -}}
|
||||
{{- if $share.Weibo -}}
|
||||
<a href="javascript:void(0);" title="{{ T `shareOn` }} 微博" data-sharer="weibo" data-url="{{ .Permalink }}" data-title="{{ .Title }}"{{ with .Params.featuredImage }} data-image="{{ . }}"{{ end }}{{ with .Site.Params.Social.Weibo }} data-ralateuid="{{ . }}"{{ end }}>
|
||||
{{- partial "plugin/icon.html" (dict "class" "fab fa-weibo fa-fw") -}}
|
||||
</a>
|
||||
{{- end -}}
|
||||
|
||||
{{- /* 020: 人人 */ -}}
|
||||
{{- if .Params.Share.Renren | default .Site.Params.Share.Renren | eq true -}}
|
||||
{{- if $share.Renren -}}
|
||||
<a href="javascript:void(0);" title="{{ T `shareOn` }} 人人" data-sharer="renren" data-url="{{ .Permalink }}">
|
||||
{{- partial "plugin/icon.html" (dict "class" "fab fa-renren fa-fw") -}}
|
||||
</a>
|
||||
{{- end -}}
|
||||
|
||||
{{- /* 021: Myspace */ -}}
|
||||
{{- if .Params.Share.Myspace | default .Site.Params.Share.Myspace | eq true -}}
|
||||
{{- if $share.Myspace -}}
|
||||
<a href="javascript:void(0);" title="{{ T `shareOn` }} Myspace" data-sharer="myspace" data-url="{{ .Permalink }}" data-title="{{ .Title }}" data-description="{{ .Description }}">
|
||||
{{- partial "plugin/icon.html" (dict "class" "loveit it-myspace-fill" "type" "other" "scratch" $scratch) -}}
|
||||
{{- partial "plugin/icon.html" (dict "class" "loveit it-myspace-fill" "type" "other" "scratch" .Scratch) -}}
|
||||
</a>
|
||||
{{- end -}}
|
||||
|
||||
{{- /* 022: Blogger */ -}}
|
||||
{{- if .Params.Share.Blogger | default .Site.Params.Share.Blogger | eq true -}}
|
||||
{{- if $share.Blogger -}}
|
||||
<a href="javascript:void(0);" title="{{ T `shareOn` }} Blogger" data-sharer="blogger" data-url="{{ .Permalink }}" data-title="{{ .Title }}" data-description="{{ .Description }}">
|
||||
{{- partial "plugin/icon.html" (dict "class" "fab fa-blogger fa-fw") -}}
|
||||
</a>
|
||||
{{- end -}}
|
||||
|
||||
{{- /* 023: 百度 */ -}}
|
||||
{{- if .Params.Share.Baidu | default .Site.Params.Share.Baidu | eq true -}}
|
||||
{{- if $share.Baidu -}}
|
||||
<a href="javascript:void(0);" title="{{ T `shareOn` }} 百度" data-sharer="baidu" data-url="{{ .Permalink }}" data-title="{{ .Title }}">
|
||||
{{- partial "plugin/icon.html" (dict "class" "loveit it-baidu-fill" "type" "other" "scratch" $scratch) -}}
|
||||
{{- partial "plugin/icon.html" (dict "class" "loveit it-baidu-fill" "type" "other" "scratch" .Scratch) -}}
|
||||
</a>
|
||||
{{- end -}}
|
||||
|
||||
{{- /* 024: OK.RU */ -}}
|
||||
{{- if .Params.Share.Odnoklassniki | default .Site.Params.Share.Odnoklassniki | eq true -}}
|
||||
{{- if $share.Odnoklassniki -}}
|
||||
<a href="javascript:void(0);" title="{{ T `shareOn` }} OK.RU" data-sharer="okru" data-url="{{ .Permalink }}" data-title="{{ .Title }}">
|
||||
{{- partial "plugin/icon.html" (dict "class" "fab fa-odnoklassniki fa-fw") -}}
|
||||
</a>
|
||||
{{- end -}}
|
||||
|
||||
{{- /* 025: Evernote */ -}}
|
||||
{{- if .Params.Share.Evernote | default .Site.Params.Share.Evernote | eq true -}}
|
||||
{{- if $share.Evernote -}}
|
||||
<a href="javascript:void(0);" title="{{ T `shareOn` }} Evernote" data-sharer="evernote" data-url="{{ .Permalink }}" data-title="{{ .Title }}">
|
||||
{{- partial "plugin/icon.html" (dict "class" "fab fa-evernote fa-fw") -}}
|
||||
</a>
|
||||
{{- end -}}
|
||||
|
||||
{{- /* 026: Skype */ -}}
|
||||
{{- if .Params.Share.Skype | default .Site.Params.Share.Skype | eq true -}}
|
||||
{{- if $share.Skype -}}
|
||||
<a href="javascript:void(0);" title="{{ T `shareOn` }} Skype" data-sharer="skype" data-url="{{ .Permalink }}" data-title="{{ .Title }}">
|
||||
{{- partial "plugin/icon.html" (dict "class" "fab fa-skype fa-fw") -}}
|
||||
</a>
|
||||
{{- end -}}
|
||||
|
||||
{{- /* 027: Trello */ -}}
|
||||
{{- if .Params.Share.Trello | default .Site.Params.Share.Trello | eq true -}}
|
||||
{{- if $share.Trello -}}
|
||||
<a href="javascript:void(0);" title="{{ T `shareOn` }} Trello" data-sharer="trello" data-url="{{ .Permalink }}" data-title="{{ .Title }}" data-description="{{ .Description }}">
|
||||
{{- partial "plugin/icon.html" (dict "class" "fab fa-trello fa-fw") -}}
|
||||
</a>
|
||||
{{- end -}}
|
||||
|
||||
{{- /* 028: Mix */ -}}
|
||||
{{- if .Params.Share.Mix | default .Site.Params.Share.Mix | eq true -}}
|
||||
{{- if $share.Mix -}}
|
||||
<a href="//mix.com/add?url={{ .Permalink }}&description={{ .Title }}" target="_blank" title="{{ T `shareOn` }} Mix">
|
||||
{{- partial "plugin/icon.html" (dict "class" "fab fa-mix fa-fw") -}}
|
||||
</a>
|
||||
|
|
4
layouts/partials/scratch/script.html
Normal file
4
layouts/partials/scratch/script.html
Normal file
|
@ -0,0 +1,4 @@
|
|||
{{- $this := .scratch.Get "this" -}}
|
||||
{{- $script := $this.script | default slice -}}
|
||||
{{- $script = $script | append (slice .data) -}}
|
||||
{{- .scratch.SetInMap "this" "script" $script -}}
|
4
layouts/partials/scratch/stylesheet.html
Normal file
4
layouts/partials/scratch/stylesheet.html
Normal file
|
@ -0,0 +1,4 @@
|
|||
{{- $this := .scratch.Get "this" -}}
|
||||
{{- $stylesheet := $this.stylesheet | default slice -}}
|
||||
{{- $stylesheet = $stylesheet | append (slice .data) -}}
|
||||
{{- .scratch.SetInMap "this" "stylesheet" $stylesheet -}}
|
|
@ -1,4 +1,5 @@
|
|||
{{- $modify_date := .Lastmod.Format (.Site.Params.dateFormatToUse | default "2006-01-02") -}}
|
||||
{{- $params := .Scratch.Get "params" -}}
|
||||
{{- $modify_date := .Lastmod.Format (.Site.Params.dateformat | default "2006-01-02") -}}
|
||||
<div class="post-footer" id="post-footer">
|
||||
<div class="post-info">
|
||||
<div class="post-info-line">
|
||||
|
@ -14,16 +15,16 @@
|
|||
</span>
|
||||
</div>
|
||||
<div class="post-info-license">
|
||||
{{- if .Params.license -}}
|
||||
{{- with $params.license -}}
|
||||
<span>
|
||||
{{- printf (T "license") .Params.license | safeHTML -}}
|
||||
{{- printf (T "license") . | safeHTML -}}
|
||||
</span>
|
||||
{{- end -}}
|
||||
</div>
|
||||
</div>
|
||||
<div class="post-info-line">
|
||||
<div class="post-info-md">
|
||||
{{- if ne .Site.Params.page.linkToMarkdown false | and (ne .Params.linkToMarkdown false) -}}
|
||||
{{- if $params.linktomarkdown -}}
|
||||
{{- with .OutputFormats.Get "markdown" -}}
|
||||
<span>
|
||||
<a class="link-to-markdown" href="{{ .RelPermalink }}" target="_blank">
|
||||
|
@ -43,7 +44,7 @@
|
|||
|
||||
<div class="post-info-more">
|
||||
<section class="post-tags">
|
||||
{{- with .Params.tags -}}
|
||||
{{- with $params.tags -}}
|
||||
<i class="fas fa-tags fa-fw"></i>
|
||||
{{- range $index, $value := . -}}
|
||||
{{- if gt $index 0 }}, {{ end -}}
|
||||
|
|
|
@ -1,35 +1,36 @@
|
|||
{{- define "title" }}{{ .Title }} | {{ .Site.Title }}{{ end -}}
|
||||
|
||||
{{- define "content" -}}
|
||||
{{- $scratch := .Scratch.Get "scratch" -}}
|
||||
{{- $params := .Scratch.Get "params" -}}
|
||||
|
||||
{{- /* Auto TOC */ -}}
|
||||
{{- if or .Params.toc (and .Site.Params.toc (ne .Params.toc false)) -}}
|
||||
{{- if ne $params.toc.enable false -}}
|
||||
<div class="toc" id="toc-auto">
|
||||
<h2 class="toc-title">{{ T "contents" }}</h2>
|
||||
{{- $globalAutoCollapseToc := .Site.Params.autoCollapseToc | default true }}
|
||||
<div class="toc-content{{ if not (and $globalAutoCollapseToc (ne .Params.autoCollapseToc false)) }} always-active{{ end }}" id="toc-content-auto"></div>
|
||||
<div class="toc-content{{ if eq $params.toc.auto false }} always-active{{ end }}" id="toc-content-auto"></div>
|
||||
</div>
|
||||
{{- end -}}
|
||||
|
||||
<article class="page single">
|
||||
{{- /* Title */ -}}
|
||||
<h1 class="single-title animated flipInX">{{ .Title }}</h1>
|
||||
{{- with .Params.subtitle -}}
|
||||
|
||||
{{- /* Subtitle */ -}}
|
||||
{{- with $params.subtitle -}}
|
||||
<h2 class="single-subtitle">{{ . }}</h2>
|
||||
{{- end -}}
|
||||
|
||||
{{- /* Meta */ -}}
|
||||
<div class="post-meta">
|
||||
<div class="post-meta-line">
|
||||
{{- $author := .Params.author | default .Site.Author.name | default (T "author") -}}
|
||||
{{- $authorLink := .Params.authorLink | default .Site.Author.link | default (relLangURL "/") -}}
|
||||
{{- $author := $params.author | default .Site.Author.name | default (T "author") -}}
|
||||
{{- $authorLink := $params.authorlink | default .Site.Author.link | default (relLangURL "/") -}}
|
||||
<span class="post-author">
|
||||
{{- $options := dict "class" "author" "href" $authorLink "title" "Author" "rel" "author" "icon" (dict "class" "fas fa-user-circle fa-fw") "content" $author -}}
|
||||
{{- partial "plugin/link.html" $options -}}
|
||||
</span>
|
||||
|
||||
{{- with .Params.categories -}}
|
||||
{{- with $params.categories -}}
|
||||
|
||||
<span class="post-category">
|
||||
{{- T "included" -}}
|
||||
|
@ -43,11 +44,12 @@
|
|||
{{- end -}}
|
||||
</div>
|
||||
<div class="post-meta-line">
|
||||
{{- $publish_date := .PublishDate.Format (.Site.Params.dateFormatToUse | default "2006-01-02") -}}
|
||||
{{- $publish_date := .PublishDate.Format (.Site.Params.dateformat | default "2006-01-02") -}}
|
||||
<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="far fa-clock fa-fw"></i>{{ T "readingTime" .ReadingTime }}
|
||||
{{- if eq hugo.Environment "production" | and .Site.Params.comment.valine.enable | and .Site.Params.comment.valine.visitor -}}
|
||||
{{- $comment := $params.comment | default dict -}}
|
||||
{{- if $comment.enable | and $comment.valine.enable | and $comment.valine.visitor -}}
|
||||
<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" }}
|
||||
</span>
|
||||
|
@ -56,14 +58,14 @@
|
|||
</div>
|
||||
|
||||
{{- /* Featured image */ -}}
|
||||
{{- with .Params.featuredImage -}}
|
||||
{{- with $params.featuredimage -}}
|
||||
<div class="featured-image">
|
||||
{{- partial "plugin/image.html" (dict "src" . "alt" $.Description "large" true) -}}
|
||||
</div>
|
||||
{{- end -}}
|
||||
|
||||
{{- /* Static TOC */ -}}
|
||||
{{- if or .Params.toc (and .Site.Params.toc (ne .Params.toc false)) -}}
|
||||
{{- if $params.toc.enable -}}
|
||||
<div class="toc" id="toc-static">
|
||||
<details>
|
||||
<summary>
|
||||
|
@ -84,15 +86,13 @@
|
|||
|
||||
{{- /* Content */ -}}
|
||||
<div class="content" id="content">
|
||||
{{- partial "function/content.html" .Content | safeHTML -}}
|
||||
{{- dict "content" .Content "ruby" $params.ruby "fraction" $params.fraction "fontawesome" $params.fontawesome | partial "function/content.html" | safeHTML -}}
|
||||
</div>
|
||||
|
||||
{{- /* Footer */ -}}
|
||||
{{- partial "single/footer.html" . -}}
|
||||
|
||||
{{- /* Comment */ -}}
|
||||
{{- if ( .Params.comment | default true ) -}}
|
||||
{{- partial "comment.html" . -}}
|
||||
{{- end -}}
|
||||
{{- partial "comment.html" . -}}
|
||||
</article>
|
||||
{{- end -}}
|
||||
|
|
|
@ -1,8 +1,6 @@
|
|||
{{- $scratch := .Page.Scratch.Get "scratch" -}}
|
||||
|
||||
{{- $content := .Inner | transform.Unmarshal | jsonify -}}
|
||||
{{- $id := partial "function/id.html" (dict "content" $content "scratch" $scratch) -}}
|
||||
{{- $id := partial "function/id.html" (dict "content" $content "scratch" .Page.Scratch) -}}
|
||||
{{- $width := cond .IsNamedParams (.Get "width") (.Get 0) | default "100%" -}}
|
||||
{{- $height := cond .IsNamedParams (.Get "height") (.Get 1) | default "30rem" -}}
|
||||
<div class="echarts" id="{{ $id }}" style="width: {{ $width }}; height: {{ $height }};"></div>
|
||||
{{- $scratch.Set "echarts" true -}}
|
||||
{{- dict "echarts" true | merge (.Page.Scratch.Get "this") | .Page.Scratch.Set "this" -}}
|
||||
|
|
|
@ -1,15 +1,15 @@
|
|||
{{- $scratch := .Page.Scratch.Get "scratch" -}}
|
||||
{{- $mapbox := (.Page.Scratch.Get "params").page.mapbox | default dict -}}
|
||||
|
||||
{{- $lng := cond .IsNamedParams (.Get "lng") (.Get 0) -}}
|
||||
{{- $lat := cond .IsNamedParams (.Get "lat") (.Get 1) -}}
|
||||
{{- $zoom := cond .IsNamedParams (.Get "zoom") (.Get 2) | default 10 -}}
|
||||
{{- $marked := cond .IsNamedParams (.Get "marked") (.Get 3) | ne false -}}
|
||||
{{- $lightStyle := .Page.Params.mapbox.lightStyle | default .Page.Site.Params.mapbox.lightStyle -}}
|
||||
{{- $darkStyle := .Page.Params.mapbox.darkStyle | default .Page.Site.Params.mapbox.darkStyle -}}
|
||||
{{- $navigation := ne .Page.Params.mapbox.navigation false | and (ne .Page.Site.Params.mapbox.navigation false) -}}
|
||||
{{- $geolocate := ne .Page.Params.mapbox.geolocate false | and (ne .Page.Site.Params.mapbox.geolocate false) -}}
|
||||
{{- $scale := ne .Page.Params.mapbox.scale false | and (ne .Page.Site.Params.mapbox.scale false) -}}
|
||||
{{- $fullscreen := ne .Page.Params.mapbox.fullscreen false | and (ne .Page.Site.Params.mapbox.fullscreen false) -}}
|
||||
{{- $lightStyle := $mapbox.lightStyle -}}
|
||||
{{- $darkStyle := $mapbox.darkStyle -}}
|
||||
{{- $navigation := $mapbox.navigation -}}
|
||||
{{- $geolocate := $mapbox.geolocate -}}
|
||||
{{- $scale := $mapbox.scale -}}
|
||||
{{- $fullscreen := $mapbox.fullscreen -}}
|
||||
{{- $width := "100%" -}}
|
||||
{{- $height := "20rem" -}}
|
||||
|
||||
|
@ -28,6 +28,6 @@
|
|||
{{- end -}}
|
||||
{{- $darkStyle = $darkStyle | default $lightStyle -}}
|
||||
{{- $options := dict "lng" $lng "lat" $lat "zoom" $zoom "marked" $marked "lightStyle" $lightStyle "darkStyle" $darkStyle "geolocate" $geolocate "navigation" $navigation "scale" $scale "fullscreen" $fullscreen -}}
|
||||
{{- $id := partial "function/id.html" (dict "content" $options "scratch" $scratch) -}}
|
||||
{{- $id := partial "function/id.html" (dict "content" $options "scratch" .Page.Scratch) -}}
|
||||
<div class="mapbox" id="{{ $id }}" style="width: {{ $width }}; height: {{ $height }};"></div>
|
||||
{{- $scratch.Set "mapbox" true -}}
|
||||
{{- dict "mapbox" true | merge (.Page.Scratch.Get "this") | .Page.Scratch.Set "this" -}}
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
{{- $scratch := .Page.Scratch.Get "scratch" -}}
|
||||
|
||||
{{- $id := partial "function/id.html" (dict "content" (trim .Inner "\n") "scratch" $scratch) -}}
|
||||
{{- $id := partial "function/id.html" (dict "content" (trim .Inner "\n") "scratch" .Page.Scratch) -}}
|
||||
<div class="mermaid" id="{{ $id }}"></div>
|
||||
{{- $scratch.Set "mermaid" true -}}
|
||||
{{- dict "mermaid" true | merge (.Page.Scratch.Get "this") | .Page.Scratch.Set "this" -}}
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
{{- $scratch := .Page.Scratch.Get "scratch" -}}
|
||||
|
||||
{{- $theme := "#448aff" -}}
|
||||
{{- if .IsNamedParams -}}
|
||||
{{- $theme = .Get "theme" | default $theme -}}
|
||||
|
@ -41,4 +39,4 @@
|
|||
{{- else -}}
|
||||
<meting-js server="{{ .Get 0 }}" type="{{ .Get 1 }}" id="{{ .Get 2 }}" theme="{{ $theme }}"></meting-js>
|
||||
{{- end -}}
|
||||
{{- $scratch.Set "music" true -}}
|
||||
{{- dict "music" true | merge (.Page.Scratch.Get "this") | .Page.Scratch.Set "this" -}}
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
{{- $scratch := .Page.Scratch.Get "scratch" -}}
|
||||
|
||||
{{- $content := .Inner -}}
|
||||
{{- $classList := .Get "class" | slice -}}
|
||||
{{- $tag := .Get "tag" | default "div" -}}
|
||||
|
@ -22,11 +20,11 @@
|
|||
|
||||
{{- /* trim the newline */ -}}
|
||||
{{- $content = trim $content "\n" -}}
|
||||
{{- $id := partial "function/id.html" (dict "content" $content "scratch" $scratch) -}}
|
||||
{{- $key := .Get "group" | default $id -}}
|
||||
{{- $group := index ($scratch.Get "typeitMap" | default dict) $key -}}
|
||||
{{- $id := partial "function/id.html" (dict "content" $content "scratch" .Page.Scratch) -}}
|
||||
{{- $key := .Get "group" | string | default $id -}}
|
||||
{{- $group := index ((.Page.Scratch.Get "this").typeitMap | default dict) $key -}}
|
||||
{{- $group = $group | default slice | append $id -}}
|
||||
{{- $scratch.SetInMap "typeitMap" $key $group -}}
|
||||
{{- dict $key $group | dict "typeitMap" | merge (.Page.Scratch.Get "this") | .Page.Scratch.Set "this" -}}
|
||||
|
||||
<div class="typeit">
|
||||
{{- printf `<%s id="%s" class="%s"></%s>` $tag $id (delimit $classList " ") $tag | safeHTML -}}
|
||||
|
|
|
@ -12,12 +12,13 @@
|
|||
{{- else if eq $taxonomy "tag" -}}
|
||||
<i class="fas fa-tag fa-fw"></i> {{ humanize .Title }}
|
||||
{{- else -}}
|
||||
{{- printf "%s - %s" (T $taxonomy | default (humanize $taxonomy)) .Title -}}
|
||||
{{- printf "%s - %s" (T $taxonomy | default (humanize $taxonomy)) .Title -}}
|
||||
{{- end -}}
|
||||
</h2>
|
||||
|
||||
{{- /* Paginate */ -}}
|
||||
{{- range (.Paginate (.Pages.GroupByDate "2006")).PageGroups -}}
|
||||
{{- $pages := .Pages.GroupByDate "2006" -}}
|
||||
{{- range (.Site.Params.list.paginate | default .Site.Params.paginate | .Paginate $pages).PageGroups -}}
|
||||
<h3>{{ .Key }}</h3>
|
||||
{{- range .Pages -}}
|
||||
<article class="archive-item">
|
||||
|
@ -25,7 +26,7 @@
|
|||
{{- .Title -}}
|
||||
</a>
|
||||
<span class="archive-item-date">
|
||||
{{- .Date.Format (.Site.Params.dateFormatToUse | default "01-02") -}}
|
||||
{{- .Date.Format ($.Site.Params.list.dateFormat | default "01-02") -}}
|
||||
</span>
|
||||
</article>
|
||||
{{- end -}}
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -31,7 +31,7 @@ class Util {
|
|||
class Theme {
|
||||
constructor() {
|
||||
this.config = window.config;
|
||||
this.contentData = this.config.content;
|
||||
this.data = this.config.data;
|
||||
this.isDark = document.body.classList.contains('dark');
|
||||
this.util = new Util();
|
||||
this.newScrollTop = this.util.getScrollTop();
|
||||
|
@ -356,7 +356,7 @@ class Theme {
|
|||
const $tocLinkElements = $tocCore.getElementsByTagName('a');
|
||||
const $tocLiElements = $tocCore.getElementsByTagName('li');
|
||||
const $headerLinkElements = document.getElementsByClassName('headerLink');
|
||||
const headerIsFixed = this.config.desktopHeaderMode !== 'normal';
|
||||
const headerIsFixed = this.config.headerMode.desktop !== 'normal';
|
||||
const headerHeight = document.getElementById('header-desktop').offsetHeight;
|
||||
const TOP_SPACING = 20 + (headerIsFixed ? headerHeight : 0);
|
||||
const minTocTop = $toc.offsetTop;
|
||||
|
@ -412,7 +412,7 @@ class Theme {
|
|||
if ($mermaidElements.length) {
|
||||
mermaid.initialize({startOnLoad: false, theme: 'null'});
|
||||
this.util.forEach($mermaidElements, $mermaid => {
|
||||
mermaid.mermaidAPI.render('svg-' + $mermaid.id, this.contentData[$mermaid.id], svgCode => {
|
||||
mermaid.mermaidAPI.render('svg-' + $mermaid.id, this.data[$mermaid.id], svgCode => {
|
||||
$mermaid.innerHTML = svgCode;
|
||||
}, $mermaid);
|
||||
});
|
||||
|
@ -428,7 +428,7 @@ class Theme {
|
|||
this._echartsArr = [];
|
||||
this.util.forEach(document.getElementsByClassName('echarts'), $echarts => {
|
||||
const chart = echarts.init($echarts, this.isDark ? 'dark' : 'macarons', {renderer: 'svg'});
|
||||
chart.setOption(JSON.parse(this.contentData[$echarts.id]));
|
||||
chart.setOption(JSON.parse(this.data[$echarts.id]));
|
||||
this._echartsArr.push(chart);
|
||||
});
|
||||
});
|
||||
|
@ -448,7 +448,7 @@ class Theme {
|
|||
mapboxgl.setRTLTextPlugin(this.config.mapbox.RTLTextPlugin);
|
||||
this._mapboxArr = this._mapboxArr || [];
|
||||
this.util.forEach(document.getElementsByClassName('mapbox'), $mapbox => {
|
||||
const { lng, lat, zoom, lightStyle, darkStyle, marked, navigation, geolocate, scale, fullscreen } = this.contentData[$mapbox.id];
|
||||
const { lng, lat, zoom, lightStyle, darkStyle, marked, navigation, geolocate, scale, fullscreen } = this.data[$mapbox.id];
|
||||
const mapbox = new mapboxgl.Map({
|
||||
container: $mapbox,
|
||||
center: [lng, lat],
|
||||
|
@ -484,7 +484,7 @@ class Theme {
|
|||
this._mapboxOnSwitchTheme = this._mapboxOnSwitchTheme || (() => {
|
||||
this.util.forEach(this._mapboxArr, mapbox => {
|
||||
const $mapbox = mapbox.getContainer();
|
||||
const { lightStyle, darkStyle } = this.contentData[$mapbox.id];
|
||||
const { lightStyle, darkStyle } = this.data[$mapbox.id];
|
||||
mapbox.setStyle(this.isDark ? darkStyle : lightStyle);
|
||||
mapbox.addControl(new MapboxLanguage());
|
||||
});
|
||||
|
@ -495,26 +495,25 @@ class Theme {
|
|||
|
||||
initTypeit() {
|
||||
if (this.config.typeit) {
|
||||
const typeitData = this.config.typeit;
|
||||
for (let i = 0; i < typeitData.length; i++) {
|
||||
const group = typeitData[i];
|
||||
((i) => {
|
||||
this.config.typeit.forEach(group => {
|
||||
const typeone = (i) => {
|
||||
const id = group[i];
|
||||
if (i === group.length - 1) {
|
||||
new TypeIt(`#${id}`, {
|
||||
strings: this.contentData[id],
|
||||
strings: this.data[id],
|
||||
}).go();
|
||||
return;
|
||||
}
|
||||
let instance = new TypeIt(`#${id}`, {
|
||||
strings: this.contentData[id],
|
||||
strings: this.data[id],
|
||||
afterComplete: () => {
|
||||
instance.destroy();
|
||||
typeone(i + 1);
|
||||
},
|
||||
}).go();
|
||||
})(0);
|
||||
}
|
||||
};
|
||||
typeone(0);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -528,8 +527,8 @@ class Theme {
|
|||
}
|
||||
|
||||
initSmoothScroll() {
|
||||
if ((!this.util.isMobile() && this.config.desktopHeaderMode === 'normal')
|
||||
|| (this.util.isMobile() && this.config.mobileHeaderMode === 'normal')) {
|
||||
if ((!this.util.isMobile() && this.config.headerMode.desktop === 'normal')
|
||||
|| (this.util.isMobile() && this.config.headerMode.mobile === 'normal')) {
|
||||
new SmoothScroll('[href^="#"]', {speed: 300, speedAsDuration: true});
|
||||
} else {
|
||||
new SmoothScroll('[href^="#"]', {speed: 300, speedAsDuration: true, header: '#header-desktop'});
|
||||
|
@ -538,8 +537,8 @@ class Theme {
|
|||
|
||||
onScroll() {
|
||||
const $headers = [];
|
||||
if (this.config.desktopHeaderMode === 'auto') $headers.push(document.getElementById('header-desktop'));
|
||||
if (this.config.mobileHeaderMode === 'auto') $headers.push(document.getElementById('header-mobile'));
|
||||
if (this.config.headerMode.desktop === 'auto') $headers.push(document.getElementById('header-desktop'));
|
||||
if (this.config.headerMode.mobile === 'auto') $headers.push(document.getElementById('header-mobile'));
|
||||
if (document.getElementById('comments')) {
|
||||
const $viewComments = document.getElementById('view-comments');
|
||||
$viewComments.href = `#comments`;
|
||||
|
@ -606,14 +605,14 @@ class Theme {
|
|||
this.initHighlight();
|
||||
this.initTable();
|
||||
this.initHeaderLink();
|
||||
this.initMath();
|
||||
this.initMermaid();
|
||||
this.initEcharts();
|
||||
this.initMapbox();
|
||||
this.initTypeit();
|
||||
this.initToc();
|
||||
this.initComment();
|
||||
this.initSmoothScroll();
|
||||
this.initMath();
|
||||
this.initMermaid();
|
||||
this.initEcharts();
|
||||
this.initTypeit();
|
||||
this.initMapbox();
|
||||
|
||||
this.onScroll();
|
||||
this.onResize();
|
||||
|
|
Loading…
Reference in a new issue