mirror of
https://github.com/dillonzq/LoveIt.git
synced 2024-11-21 22:36:16 +01:00
feat(image): add image lightgallery
This commit is contained in:
parent
fbfcbaebca
commit
72a2e9bdcf
50 changed files with 478 additions and 353 deletions
|
@ -17,6 +17,7 @@ featuredImagePreview: ""
|
|||
|
||||
toc: false
|
||||
autoCollapseToc: true
|
||||
lightgallery: true
|
||||
math: false
|
||||
comment: true
|
||||
---
|
||||
|
|
|
@ -168,26 +168,35 @@
|
|||
|
||||
figure {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.image-caption:not(:empty) {
|
||||
min-width: 20%;
|
||||
max-width: 80%;
|
||||
display: inline-block;
|
||||
padding: .625rem;
|
||||
margin: 0 auto;
|
||||
border-bottom: 1px solid #d9d9d9;
|
||||
font-size: .875rem;
|
||||
color: #969696;
|
||||
line-height: 1.7;
|
||||
.image-caption:not(:empty) {
|
||||
min-width: 20%;
|
||||
max-width: 80%;
|
||||
display: inline-block;
|
||||
padding: .625rem;
|
||||
margin: 0 auto;
|
||||
border-bottom: 1px solid #d9d9d9;
|
||||
font-size: .875rem;
|
||||
color: #969696;
|
||||
line-height: 1.7;
|
||||
}
|
||||
|
||||
a.lightgallery:hover img {
|
||||
transform: scale(1.02);
|
||||
}
|
||||
}
|
||||
|
||||
img {
|
||||
display: block;
|
||||
max-width: 100%;
|
||||
max-width: 90%;
|
||||
height: auto;
|
||||
margin: 0 auto;
|
||||
overflow: hidden;
|
||||
transition: all 0.2s ease-in-out;
|
||||
}
|
||||
|
||||
.lazyloading {
|
||||
object-fit: none;
|
||||
}
|
||||
|
||||
blockquote {
|
||||
|
|
|
@ -6,3 +6,4 @@ aplayer@1.10.1
|
|||
animate.css@3.7.2
|
||||
mermaid@8.4.2
|
||||
valine@1.3.10
|
||||
lightgallery@1.1.3
|
||||
|
|
1
assets/css/lib/lightgallery/lightgallery.min.css
vendored
Normal file
1
assets/css/lib/lightgallery/lightgallery.min.css
vendored
Normal file
File diff suppressed because one or more lines are too long
|
@ -1,6 +1,6 @@
|
|||
gitalk@1.5.0
|
||||
valine@1.3.10
|
||||
lazysizes@5.1.2
|
||||
lazysizes@5.2.0
|
||||
katex@0.11.1
|
||||
mermaid@8.4.2
|
||||
echarts@4.5.0
|
||||
|
@ -9,3 +9,4 @@ aplayer@1.10.1
|
|||
meting@2.0.1
|
||||
smooth-scroll@16.1.2
|
||||
sharer@0.4.0
|
||||
lightgallery@1.1.3 lg-thumbnail@1.1.0 lg-zoom@1.1.0
|
||||
|
|
4
assets/js/lib/lazysizes/lazysizes.min.js
vendored
4
assets/js/lib/lazysizes/lazysizes.min.js
vendored
File diff suppressed because one or more lines are too long
2
assets/js/lib/lazysizes/ls.native-loading.min.js
vendored
Normal file
2
assets/js/lib/lazysizes/ls.native-loading.min.js
vendored
Normal file
|
@ -0,0 +1,2 @@
|
|||
/*! lazysizes - v5.2.0 */
|
||||
!function(a,b){var c=function(){b(a.lazySizes),a.removeEventListener("lazyunveilread",c,!0)};b=b.bind(null,a,a.document),"object"==typeof module&&module.exports?b(require("lazysizes")):a.lazySizes?c():a.addEventListener("lazyunveilread",c,!0)}(window,function(a,b,c){"use strict";function d(){var d=c.loader,e=d.checkElems,f=function(){setTimeout(function(){a.removeEventListener("scroll",d._aLSL,!0)},1e3)},g="object"==typeof j.nativeLoading.disableListeners?j.nativeLoading.disableListeners:k;g.scroll&&(a.addEventListener("load",f),f(),a.removeEventListener("scroll",e,!0)),g.resize&&a.removeEventListener("resize",e,!0),Object.keys(g).forEach(function(a){g[a]&&b.removeEventListener(a,e,!0)})}function e(){h||(h=!0,f&&g&&j.nativeLoading.disableListeners&&(!0===j.nativeLoading.disableListeners&&(j.nativeLoading.setLoadingAttribute=!0),d()),j.nativeLoading.setLoadingAttribute&&a.addEventListener("lazybeforeunveil",function(a){var b=a.target;"loading"in b&&!b.getAttribute("loading")&&b.setAttribute("loading","lazy")},!0))}var f="loading"in HTMLImageElement.prototype,g="loading"in HTMLIFrameElement.prototype,h=!1,i=c.prematureUnveil,j=c.cfg,k={focus:1,mouseover:1,click:1,load:1,transitionend:1,animationend:1,scroll:1,resize:1};j.nativeLoading||(j.nativeLoading={}),a.addEventListener&&a.MutationObserver&&(f||g)&&(c.prematureUnveil=function(a){return h||e(),!(!("loading"in a&&(j.nativeLoading.setLoadingAttribute||a.getAttribute("loading")))||"auto"==a.getAttribute("data-sizes")&&!a.offsetWidth)||(i?i(a):void 0)})});
|
7
assets/js/lib/lightgallery/lg-thumbnail.min.js
vendored
Normal file
7
assets/js/lib/lightgallery/lg-thumbnail.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
7
assets/js/lib/lightgallery/lg-zoom.min.js
vendored
Normal file
7
assets/js/lib/lightgallery/lg-zoom.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
7
assets/js/lib/lightgallery/lightgallery.min.js
vendored
Normal file
7
assets/js/lib/lightgallery/lightgallery.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
32
assets/svg/loading.small.svg
Normal file
32
assets/svg/loading.small.svg
Normal file
|
@ -0,0 +1,32 @@
|
|||
<!-- By Sam Herbert (@sherb), for everyone. More @ http://goo.gl/7AJzbL -->
|
||||
<svg width="69" height="69" viewBox="-31 -31 100 100" xmlns="http://www.w3.org/2000/svg">
|
||||
<defs>
|
||||
<linearGradient x1="8.042%" y1="0%" x2="65.682%" y2="23.865%" id="a">
|
||||
<stop stop-color="#fff" stop-opacity="0" offset="0%"/>
|
||||
<stop stop-color="#fff" stop-opacity=".631" offset="63.146%"/>
|
||||
<stop stop-color="#fff" offset="100%"/>
|
||||
</linearGradient>
|
||||
</defs>
|
||||
<g fill="none" fill-rule="evenodd">
|
||||
<g transform="translate(1 1)">
|
||||
<path d="M36 18c0-9.94-8.06-18-18-18" id="Oval-2" stroke="url(#a)" stroke-width="2">
|
||||
<animateTransform
|
||||
attributeName="transform"
|
||||
type="rotate"
|
||||
from="0 18 18"
|
||||
to="360 18 18"
|
||||
dur="0.9s"
|
||||
repeatCount="indefinite" />
|
||||
</path>
|
||||
<circle fill="#fff" cx="36" cy="18" r="1">
|
||||
<animateTransform
|
||||
attributeName="transform"
|
||||
type="rotate"
|
||||
from="0 18 18"
|
||||
to="360 18 18"
|
||||
dur="0.9s"
|
||||
repeatCount="indefinite" />
|
||||
</circle>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
After Width: | Height: | Size: 1.3 KiB |
|
@ -66,8 +66,6 @@ enableEmoji = true
|
|||
url = "/zh/"
|
||||
weight = 5
|
||||
[languages.en.params]
|
||||
# LoveIt theme version
|
||||
version = "0.1.X"
|
||||
# site description
|
||||
description = "About LoveIt Theme"
|
||||
# site keywords
|
||||
|
@ -76,20 +74,6 @@ enableEmoji = true
|
|||
defaultTheme = "auto"
|
||||
# public git repo url to link lastmod git commit only then enableGitInfo is true
|
||||
gitRepo = ""
|
||||
# Header info
|
||||
[languages.en.params.header]
|
||||
# desktop header mode ("fixed", "normal", "auto")
|
||||
desktopMode = "fixed"
|
||||
# mobile header mode ("fixed", "normal", "auto")
|
||||
mobileMode = "auto"
|
||||
# Footer Copyright Info
|
||||
[languages.en.params.footer]
|
||||
# Site creation time
|
||||
since = 2019
|
||||
# ICP info only in China (HTML format is allowed)
|
||||
icp = ""
|
||||
# license info (HTML format is allowed)
|
||||
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
|
||||
[languages.en.params.home]
|
||||
# Home Page Profile
|
||||
|
@ -98,7 +82,7 @@ enableEmoji = true
|
|||
# Gravatar Email for preferred avatar in home page
|
||||
gravatarEmail = ""
|
||||
# URL of avatar shown in home page
|
||||
avatarURL = "images/avatar.png"
|
||||
avatarURL = "/images/avatar.png"
|
||||
# subtitle shown in home page
|
||||
subtitle = "A Clean, Elegant but Advanced Hugo Theme"
|
||||
# whether to use typeit animation for subtitle
|
||||
|
@ -178,12 +162,6 @@ enableEmoji = true
|
|||
# XMPP = "xxxx"
|
||||
# Matrix = "xxxx"
|
||||
# Bilibili = "xxxx"
|
||||
# Page config
|
||||
[languages.en.params.page]
|
||||
# whether to show social share links in post page
|
||||
socialShare = true
|
||||
# whether to show link to Raw Markdown content of the post
|
||||
linkToMarkdown = true
|
||||
# Social Share Links in post page
|
||||
[languages.en.params.share]
|
||||
enable = true
|
||||
|
@ -214,67 +192,6 @@ enableEmoji = true
|
|||
# Skype = true
|
||||
# Trello = true
|
||||
# Mix = true
|
||||
# mathematical formulas (KaTeX)
|
||||
[languages.en.params.math]
|
||||
enable = true
|
||||
# default inline delimiter is $ ... $ and \\( ... \\)
|
||||
inlineLeftDelimiter = ""
|
||||
inlineRightDelimiter = ""
|
||||
# default block delimiter is $$ ... $$ and \\[ ... \\]
|
||||
blockLeftDelimiter = ""
|
||||
blockRightDelimiter = ""
|
||||
# KaTeX extension copy_tex
|
||||
copyTex = true
|
||||
# KaTeX extension mhchem
|
||||
mhchem = true
|
||||
# CSS and JS Files CDN
|
||||
[languages.en.params.cdn]
|
||||
## for example '<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free@5.10.1/css/all.min.css" integrity="sha256-fdcFNFiBMrNfWL6OcAGQz6jDgNTRxnrLEd4vJYFWScE=" crossorigin="anonymous">'
|
||||
fontawesomeFreeCSS = ''
|
||||
animateCSS = ''
|
||||
gitalkCSS = ''
|
||||
gitalkJS = ''
|
||||
valineJS = ''
|
||||
lazysizesJS = ''
|
||||
smoothScrollJS = ''
|
||||
sharerJS = ''
|
||||
katexCSS = ''
|
||||
katexJS = ''
|
||||
katexAutoRenderJS = ''
|
||||
katexCopyTexCSS = ''
|
||||
katexCopyTexJS = ''
|
||||
katexMhchemJS = ''
|
||||
mermaidJS = ''
|
||||
echartsJS = ''
|
||||
echartsMacaronsJS = ''
|
||||
typeitJS = ''
|
||||
aplayerCSS = ''
|
||||
aplayerJS = ''
|
||||
metingJS = ''
|
||||
# site verification code for Google/Bing/Yandex/Pinterest/Baidu
|
||||
[languages.en.params.verification]
|
||||
google = ""
|
||||
bing = ""
|
||||
yandex = ""
|
||||
pinterest = ""
|
||||
baidu = ""
|
||||
# Publisher Info just for SEO
|
||||
[languages.en.params.publisher]
|
||||
name = "xxxx"
|
||||
[languages.en.params.publisher.logo]
|
||||
url = "logo.png"
|
||||
width = 127
|
||||
height = 40
|
||||
# Website Log Info just for SEO
|
||||
[languages.en.params.logo]
|
||||
url = "logo.png"
|
||||
width = 127
|
||||
height = 40
|
||||
# Website Image Info just for SEO
|
||||
[languages.en.params.image]
|
||||
url = "cover.png"
|
||||
width = 800
|
||||
height = 600
|
||||
# Comment Config
|
||||
[languages.en.params.comment]
|
||||
enable = true
|
||||
|
@ -355,8 +272,6 @@ enableEmoji = true
|
|||
url = "../"
|
||||
weight = 5
|
||||
[languages.zh.params]
|
||||
# LoveIt 主题版本
|
||||
version = "0.1.X"
|
||||
# 网站描述
|
||||
description = "关于 LoveIt 主题"
|
||||
# 网站关键词
|
||||
|
@ -365,20 +280,6 @@ enableEmoji = true
|
|||
defaultTheme = "auto"
|
||||
# 用于生成文章上次修改时间的公共 git 仓库路径,仅在 enableGitInfo 设为 true 时有效
|
||||
gitRepo = ""
|
||||
# 页面头部导航栏信息
|
||||
[languages.zh.params.header]
|
||||
# 桌面端导航栏模式 ("fixed", "normal", "auto")
|
||||
desktopMode = "fixed"
|
||||
# 移动端导航栏模式 ("fixed", "normal", "auto")
|
||||
mobileMode = "auto"
|
||||
# 页面底部版权信息设置
|
||||
[languages.zh.params.footer]
|
||||
# 网站创立年份
|
||||
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>'
|
||||
# 主页信息设置
|
||||
[languages.zh.params.home]
|
||||
# 主页个人信息
|
||||
|
@ -387,7 +288,7 @@ enableEmoji = true
|
|||
# Gravatar 邮箱,用于优先在主页显示的头像
|
||||
gravatarEmail = ""
|
||||
# 主页显示头像的 URL
|
||||
avatarURL = "images/avatar.png"
|
||||
avatarURL = "/images/avatar.png"
|
||||
# 主页显示的网站副标题
|
||||
subtitle = "一个简洁、优雅且高效的 Hugo 主题"
|
||||
# 是否为副标题显示打字机动画
|
||||
|
@ -467,12 +368,6 @@ enableEmoji = true
|
|||
# XMPP = "xxxx@example.com"
|
||||
# Matrix = "xxxx"
|
||||
Bilibili = "xxxx"
|
||||
# 文章页面配置
|
||||
[languages.zh.params.page]
|
||||
# 在文章页面是否使用分享功能
|
||||
socialShare = true
|
||||
# 是否在文章页面显示原始 Markdown 文档链接
|
||||
linkToMarkdown = true
|
||||
# 文章页面的分享信息设置
|
||||
[languages.zh.params.share]
|
||||
enable = true
|
||||
|
@ -503,67 +398,6 @@ enableEmoji = true
|
|||
# Skype = true
|
||||
# Trello = true
|
||||
# Mix = true
|
||||
# 数学公式 (KaTeX https://katex.org/)
|
||||
[languages.zh.params.math]
|
||||
enable = true
|
||||
# 默认内联定界符是 $ ... $ 和 \\( ... \\)
|
||||
inlineLeftDelimiter = ""
|
||||
inlineRightDelimiter = ""
|
||||
# 默认块定界符是 $$ ... $$ 和 \\[ ... \\]
|
||||
blockLeftDelimiter = ""
|
||||
blockRightDelimiter = ""
|
||||
# KaTeX 插件 copy_tex
|
||||
copyTex = true
|
||||
# KaTeX 插件 mhchem
|
||||
mhchem = true
|
||||
# CSS 和 JS 文件的 CDN 设置
|
||||
[languages.zh.params.cdn]
|
||||
## 例如 '<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free@5.10.1/css/all.min.css" integrity="sha256-fdcFNFiBMrNfWL6OcAGQz6jDgNTRxnrLEd4vJYFWScE=" crossorigin="anonymous">'
|
||||
fontawesomeFreeCSS = ''
|
||||
animateCSS = ''
|
||||
gitalkCSS = ''
|
||||
gitalkJS = ''
|
||||
valineJS = ''
|
||||
lazysizesJS = ''
|
||||
smoothScrollJS = ''
|
||||
sharerJS = ''
|
||||
katexCSS = ''
|
||||
katexJS = ''
|
||||
katexAutoRenderJS = ''
|
||||
katexCopyTexCSS = ''
|
||||
katexCopyTexJS = ''
|
||||
katexMhchemJS = ''
|
||||
mermaidJS = ''
|
||||
echartsJS = ''
|
||||
echartsMacaronsJS = ''
|
||||
typeitJS = ''
|
||||
aplayerCSS = ''
|
||||
aplayerJS = ''
|
||||
metingJS = ''
|
||||
# 网站验证代码,用于 Google/Bing/Yandex/Pinterest/Baidu
|
||||
[languages.zh.params.verification]
|
||||
google = ""
|
||||
bing = ""
|
||||
yandex = ""
|
||||
pinterest = ""
|
||||
baidu = ""
|
||||
# 出版者信息,仅用于 SEO
|
||||
[languages.zh.params.publisher]
|
||||
name = "xxxx"
|
||||
[languages.zh.params.publisher.logo]
|
||||
url = "logo.png"
|
||||
width = 127
|
||||
height = 40
|
||||
# 网站图标信息,仅用于 SEO
|
||||
[languages.zh.params.logo]
|
||||
url = "logo.png"
|
||||
width = 127
|
||||
height = 40
|
||||
# 网站图标信息,仅用于 SEO
|
||||
[languages.zh.params.image]
|
||||
url = "cover.png"
|
||||
width = 800
|
||||
height = 600
|
||||
# 评论系统设置
|
||||
[languages.zh.params.comment]
|
||||
enable = true
|
||||
|
@ -598,6 +432,118 @@ enableEmoji = true
|
|||
appId = ""
|
||||
languageCode = "en_US"
|
||||
|
||||
[params]
|
||||
# LoveIt theme version
|
||||
# LoveIt 主题版本
|
||||
version = "0.1.X"
|
||||
# Header info
|
||||
# 页面头部导航栏信息
|
||||
[params.header]
|
||||
# desktop header mode ("fixed", "normal", "auto")
|
||||
# 桌面端导航栏模式 ("fixed", "normal", "auto")
|
||||
desktopMode = "fixed"
|
||||
# mobile header mode ("fixed", "normal", "auto")
|
||||
# 移动端导航栏模式 ("fixed", "normal", "auto")
|
||||
mobileMode = "auto"
|
||||
# Footer Copyright Info
|
||||
# 页面底部版权信息设置
|
||||
[params.footer]
|
||||
# Site creation time
|
||||
# 网站创立年份
|
||||
since = 2019
|
||||
# ICP info only in China (HTML format is allowed)
|
||||
# ICP 备案信息,仅在中国使用 (允许使用 HTML 格式)
|
||||
icp = ""
|
||||
# license info (HTML format is allowed)
|
||||
# 许可协议信息 (允许使用 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>'
|
||||
# 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 文档链接
|
||||
linkToMarkdown = true
|
||||
# mathematical formulas (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
|
||||
# site verification code for Google/Bing/Yandex/Pinterest/Baidu
|
||||
# 网站验证代码,用于 Google/Bing/Yandex/Pinterest/Baidu
|
||||
[params.verification]
|
||||
google = ""
|
||||
bing = ""
|
||||
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]
|
||||
## for example '<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free@5.10.1/css/all.min.css" integrity="sha256-fdcFNFiBMrNfWL6OcAGQz6jDgNTRxnrLEd4vJYFWScE=" crossorigin="anonymous">'
|
||||
## 例如 '<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free@5.10.1/css/all.min.css" integrity="sha256-fdcFNFiBMrNfWL6OcAGQz6jDgNTRxnrLEd4vJYFWScE=" crossorigin="anonymous">'
|
||||
fontawesomeFreeCSS = ''
|
||||
animateCSS = ''
|
||||
gitalkCSS = ''
|
||||
gitalkJS = ''
|
||||
valineJS = ''
|
||||
lazysizesJS = ''
|
||||
lazysizesNativeLoadingJS = ''
|
||||
lightgalleryCSS = ''
|
||||
lightgalleryJS = ''
|
||||
lightgalleryThumbnailJS = ''
|
||||
lightgalleryZoomJS = ''
|
||||
smoothScrollJS = ''
|
||||
sharerJS = ''
|
||||
katexCSS = ''
|
||||
katexJS = ''
|
||||
katexAutoRenderJS = ''
|
||||
katexCopyTexCSS = ''
|
||||
katexCopyTexJS = ''
|
||||
katexMhchemJS = ''
|
||||
mermaidJS = ''
|
||||
echartsJS = ''
|
||||
echartsMacaronsJS = ''
|
||||
typeitJS = ''
|
||||
aplayerCSS = ''
|
||||
aplayerJS = ''
|
||||
metingJS = ''
|
||||
|
||||
# Markup related configuration in Hugo
|
||||
# Hugo 解析文档的配置
|
||||
[markup]
|
||||
|
|
|
@ -2,6 +2,8 @@
|
|||
title: "About LoveIt"
|
||||
date: 2019-08-02T11:04:49+08:00
|
||||
draft: false
|
||||
|
||||
lightgallery: true
|
||||
---
|
||||
|
||||
[LoveIt :(far fa-heart):](https://github.com/dillonzq/LoveIt) is a **clean**, **elegant** but **advanced** blog theme for [Hugo](https://gohugo.io/) developed by [Dillon](https://dillonzq.com).
|
||||
|
|
|
@ -2,6 +2,8 @@
|
|||
title: "关于 LoveIt"
|
||||
date: 2019-08-02T11:04:49+08:00
|
||||
draft: false
|
||||
|
||||
lightgallery: true
|
||||
---
|
||||
|
||||
[LoveIt :(far fa-heart):](https://github.com/dillonzq/LoveIt) 是一个由 [Dillon](https://dillonzq.com) 开发的**简洁**、**优雅**且**高效**的 [Hugo](https://gohugo.io/) 博客主题。
|
||||
|
|
|
@ -17,6 +17,7 @@ featuredImagePreview: ""
|
|||
|
||||
toc: true
|
||||
autoCollapseToc: true
|
||||
lightgallery: true
|
||||
math: true
|
||||
comment: true
|
||||
---
|
||||
|
@ -688,22 +689,6 @@ function doIt() {
|
|||
| ~~橙色~~ | 橘子 | **胡萝卜** |
|
||||
| 绿色 | ~~***梨子***~~ | 菠菜 |
|
||||
|
||||
Class or Enum | Year | Month | Day | Hours | Minutes | Seconds* | Zone Offset | Zone ID | toString Output | Where Discussed
|
||||
----------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- |:-------------------------------------------------------------------------------------:|:-------------------------------------------------------------------------------------:|:-------------------------------------------------------------------------------------:| ------------------------------------------------------------------------------------- |:-------------------------------------------------------------------------------------:|:-------------------------------------------------------------------------------------:| -------------------------------------------------- | ---------------------------------------------------------------------------------------------------
|
||||
`Instant` | | | | | | <center>![checked](/favicon-16x16.png)</center> | | | `2013-08-20T15:16:26.355Z` | [Instant Class](https://docs.oracle.com/javase/tutorial/datetime/iso/instant.html)
|
||||
`LocalDate` | <center>![checked](/favicon-16x16.png)</center> | <center>![checked](/favicon-16x16.png)</center> | <center>![checked](/favicon-16x16.png)</center> | | | | | | `2013-08-20` | [Date Classes](https://docs.oracle.com/javase/tutorial/datetime/iso/date.html)
|
||||
`LocalDateTime` | <center>![checked](/favicon-16x16.png)</center> | <center>![checked](/favicon-16x16.png)</center> | <center>![checked](/favicon-16x16.png)</center> | <center>![checked](/favicon-16x16.png)</center> | <center>![checked](/favicon-16x16.png)</center> | <center>![checked](/favicon-16x16.png)</center> | | | `2013-08-20T08:16:26.937` | [Date and Time Classes](https://docs.oracle.com/javase/tutorial/datetime/iso/datetime.html)
|
||||
`ZonedDateTime` | <center>![checked](/favicon-16x16.png)</center> | <center>![checked](/favicon-16x16.png)</center> | <center>![checked](/favicon-16x16.png)</center> | <center>![checked](/favicon-16x16.png)</center> | <center>![checked](/favicon-16x16.png)</center> | <center>![checked](/favicon-16x16.png)</center> | <center>![checked](/favicon-16x16.png)</center> | <center>![checked](/favicon-16x16.png)</center> | `2013-08-21T00:16:26.941+09:00[Asia/Tokyo]` | [Time Zone and Offset Classes](https://docs.oracle.com/javase/tutorial/datetime/iso/timezones.html)
|
||||
`LocalTime` | | | | <center>![checked](/favicon-16x16.png)</center> | <center>![checked](/favicon-16x16.png)</center> | <center>![checked](/favicon-16x16.png)</center> | | | `08:16:26.943` | [Date and Time Classes](https://docs.oracle.com/javase/tutorial/datetime/iso/datetime.html)
|
||||
`MonthDay` | | <center>![checked](/favicon-16x16.png)</center> | <center>![checked](/favicon-16x16.png)</center> | | | | | | `--08-20` | [Date Classes](https://docs.oracle.com/javase/tutorial/datetime/iso/date.html)
|
||||
`Year` | <center>![checked](/favicon-16x16.png)</center> | | | | | | | | `2013` | [Date Classes](https://docs.oracle.com/javase/tutorial/datetime/iso/date.html)
|
||||
`YearMonth` | <center>![checked](/favicon-16x16.png)</center> | <center>![checked](/favicon-16x16.png)</center> | | | | | | | `2013-08` | [Date Classes](https://docs.oracle.com/javase/tutorial/datetime/iso/date.html)
|
||||
`Month` | | <center>![checked](/favicon-16x16.png)</center> | | | | | | | `AUGUST` | [DayOfWeek and Month Enums](https://docs.oracle.com/javase/tutorial/datetime/iso/enum.html)
|
||||
`OffsetDateTime` | <center>![checked](/favicon-16x16.png)</center> | <center>![checked](/favicon-16x16.png)</center> | <center>![checked](/favicon-16x16.png)</center> | <center>![checked](/favicon-16x16.png)</center> | <center>![checked](/favicon-16x16.png)</center> | <center>![checked](/favicon-16x16.png)</center> | <center>![checked](/favicon-16x16.png)</center> | | `2013-08-20T08:16:26.954-07:00` | [Time Zone and Offset Classes](https://docs.oracle.com/javase/tutorial/datetime/iso/timezones.html)
|
||||
`OffsetTime` | | | | <center>![checked](/favicon-16x16.png)</center> | <center>![checked](/favicon-16x16.png)</center> | <center>![checked](/favicon-16x16.png)</center> | <center>![checked](/favicon-16x16.png)</center> | | `08:16:26.957-07:00` | [Time Zone and Offset Classes](https://docs.oracle.com/javase/tutorial/datetime/iso/timezones.html)
|
||||
`Duration` | | | \** | \** | \** | <center>![checked](/favicon-16x16.png)</center> | | | `PT20H` (20 hours) | [Period and Duration](https://docs.oracle.com/javase/tutorial/datetime/iso/period.html)
|
||||
`Period` | <center>![checked](/favicon-16x16.png)</center> | <center>![checked](/favicon-16x16.png)</center> | <center>![checked](/favicon-16x16.png)</center> | | | | \*** | \*** | `P10D` (10 days) | [Period and Duration](https://docs.oracle.com/javase/tutorial/datetime/iso/period.html)
|
||||
|
||||
## Smart Strong
|
||||
|
||||
```
|
||||
|
|
|
@ -17,34 +17,9 @@ featuredImagePreview: ""
|
|||
|
||||
toc: false
|
||||
autoCollapseToc: true
|
||||
lightgallery: true
|
||||
math: false
|
||||
comment: true
|
||||
---
|
||||
|
||||
<!--more-->
|
||||
|
||||
```
|
||||
content
|
||||
├── level-one
|
||||
│ ├── level-two
|
||||
│ │ ├── level-three
|
||||
│ │ │ ├── level-four
|
||||
│ │ │ │ ├── _index.md <-- /level-one/level-two/level-three/level-four
|
||||
│ │ │ │ ├── page-4-a.md <-- /level-one/level-two/level-three/level-four/page-4-a
|
||||
│ │ │ │ ├── page-4-b.md <-- /level-one/level-two/level-three/level-four/page-4-b
|
||||
│ │ │ │ └── page-4-c.md <-- /level-one/level-two/level-three/level-four/page-4-c
|
||||
│ │ │ ├── _index.md <-- /level-one/level-two/level-three
|
||||
│ │ │ ├── page-3-a.md <-- /level-one/level-two/level-three/page-3-a
|
||||
│ │ │ ├── page-3-b.md <-- /level-one/level-two/level-three/page-3-b
|
||||
│ │ │ └── page-3-c.md <-- /level-one/level-two/level-three/page-3-c
|
||||
│ │ ├── _index.md <-- /level-one/level-two
|
||||
│ │ ├── page-2-a.md <-- /level-one/level-two/page-2-a
|
||||
│ │ ├── page-2-b.md <-- /level-one/level-two/page-2-b
|
||||
│ │ └── page-2-c.md <-- /level-one/level-two/page-2-c
|
||||
│ ├── _index.md <-- /level-one
|
||||
│ ├── page-1-a.md <-- /level-one/page-1-a
|
||||
│ ├── page-1-b.md <-- /level-one/page-1-b
|
||||
│ └── page-1-c.md <-- /level-one/page-1-c
|
||||
├── _index.md <-- /
|
||||
└── page-top.md <-- /page-top
|
||||
```
|
||||
|
|
|
@ -17,6 +17,7 @@ featuredImagePreview: ""
|
|||
|
||||
toc: false
|
||||
autoCollapseToc: true
|
||||
lightgallery: true
|
||||
math: false
|
||||
comment: true
|
||||
---
|
||||
|
|
|
@ -17,6 +17,7 @@ featuredImagePreview: ""
|
|||
|
||||
toc: false
|
||||
autoCollapseToc: true
|
||||
lightgallery: true
|
||||
math: false
|
||||
comment: true
|
||||
---
|
||||
|
|
|
@ -17,6 +17,7 @@ featuredImagePreview: ""
|
|||
|
||||
toc: true
|
||||
autoCollapseToc: true
|
||||
lightgallery: true
|
||||
math: true
|
||||
comment: true
|
||||
---
|
||||
|
|
|
@ -17,6 +17,7 @@ featuredImagePreview: ""
|
|||
|
||||
toc: false
|
||||
autoCollapseToc: true
|
||||
lightgallery: true
|
||||
math: false
|
||||
comment: true
|
||||
---
|
||||
|
|
|
@ -17,6 +17,7 @@ featuredImagePreview: ""
|
|||
|
||||
toc: false
|
||||
autoCollapseToc: true
|
||||
lightgallery: true
|
||||
math: false
|
||||
comment: true
|
||||
---
|
||||
|
|
|
@ -17,12 +17,13 @@ featuredImagePreview: ""
|
|||
|
||||
toc: true
|
||||
autoCollapseToc: true
|
||||
lightgallery: true
|
||||
math: true
|
||||
comment: false
|
||||
dev: true
|
||||
---
|
||||
|
||||
## :(fas fa-rocket): This is a test page
|
||||
## & :(fas fa-rocket): This is a test page
|
||||
|
||||
[https://www.aol.com/article/entertainment/2020/02/10/oscars-viewership-hits-new-low-with-236-million-viewers/23923047/](https://www.aol.com/article/entertainment/2020/02/10/oscars-viewership-hits-new-low-with-236-million-viewers/23923047/)
|
||||
|
||||
|
@ -30,6 +31,12 @@ Test all features in development.
|
|||
|
||||
<!--more-->
|
||||
|
||||
## Test Img
|
||||
|
||||
![Web Image 1](https://static.dillonzq.com/images/20190817130904-U6cPUk.jpg "Web Image")
|
||||
|
||||
![Local Image](/images/Apple-Devices-Preview.png "Local Image")
|
||||
|
||||
## Test Code
|
||||
|
||||
### Inline code
|
||||
|
@ -43,11 +50,11 @@ class DataHolder<T>{
|
|||
T item;
|
||||
|
||||
public void setData(T t) {
|
||||
this.item=t;
|
||||
this.item=t;
|
||||
}
|
||||
|
||||
public T getData() {
|
||||
return this.item;
|
||||
return this.item;
|
||||
}
|
||||
}
|
||||
```
|
||||
|
@ -384,10 +391,6 @@ Here is a story about love...
|
|||
int a = 1;
|
||||
{{< /typeit >}}
|
||||
|
||||
## Test Img
|
||||
|
||||
![Gif](https://static.dillonzq.com/images/20190817130904-U6cPUk.jpg "Title")
|
||||
|
||||
## Test Align
|
||||
|
||||
{{% align right %}}
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
<figure>
|
||||
{{- partial "plugin/image.html" (dict "src" .Destination "alt" .Text "title" .Title ) -}}
|
||||
{{- with .Title | default .Text -}}
|
||||
{{- $lightgallery := ne .Page.Site.Params.page.lightgallery false | and (ne .Page.Params.lightgallery false) -}}
|
||||
{{- partial "plugin/image.html" (dict "src" .Destination "title" .Title "description" .Text "lightgallery" $lightgallery "context" .Page) -}}
|
||||
{{- with (.Title | default .Text) -}}
|
||||
<figcaption class="image-caption">
|
||||
{{- . | safeHTML -}}
|
||||
</figcaption>
|
||||
|
|
|
@ -3,9 +3,11 @@
|
|||
{{- errorf "\n\nThere are two possible situations that led to this error:\n 1. You haven't copied the config.toml yet. See https://github.com/dillonzq/LoveIt#installation \n 2. You have an incompatible update. See https://github.com//dillonzq/LoveIt/blob/master/CHANGELOG.md \n\n有两种可能的情况会导致这个错误发生:\n 1. 你还没有复制 config.toml 参考 https://github.com/dillonzq/LoveIt#installation \n 2. 你进行了一次不兼容的更新 参考 https://github.com//dillonzq/LoveIt/blob/master/CHANGELOG.md \n" -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- $scratch := newScratch -}}
|
||||
{{- .Scratch.Set "scratch" $scratch -}}
|
||||
{{- if eq (getenv "HUGO_ENV") "production" -}}
|
||||
{{- .Scratch.Set "production" true -}}
|
||||
{{- .Scratch.Set "CDN" .Site.Params.cdn -}}
|
||||
{{- $scratch.Set "production" true -}}
|
||||
{{- $scratch.Set "CDN" .Site.Params.cdn -}}
|
||||
{{- end -}}
|
||||
|
||||
<!DOCTYPE html>
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
</h1>
|
||||
|
||||
{{- /* Content */ -}}
|
||||
<div class="content">
|
||||
<div class="content" id="content">
|
||||
{{- partial "single/content.html" .Content -}}
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
{{- with .Params.featuredImage -}}
|
||||
<div class="featured-image-preview">
|
||||
{{- $image := $.Params.featuredImagePreview | default . -}}
|
||||
{{- partial "plugin/image.html" (dict "src" $image "alt" "featured image") -}}
|
||||
{{- partial "plugin/image.html" (dict "src" $image "description" $.Description "context" $) -}}
|
||||
</div>
|
||||
{{- end -}}
|
||||
|
||||
|
|
|
@ -1,11 +1,13 @@
|
|||
{{- if .Scratch.Get "production" | and .IsPage | and (ne .Site.Params.comment.enable false) | and (ne .Params.comment false) -}}
|
||||
{{- $CDN := .Scratch.Get "CDN" -}}
|
||||
{{- $scratch := .Scratch.Get "scratch" -}}
|
||||
|
||||
{{- if $scratch.Get "production" | and (ne .Site.Params.comment.enable false) | and (ne .Params.comment false) -}}
|
||||
{{- $CDN := $scratch.Get "CDN" -}}
|
||||
|
||||
{{- /* Disqus Comment System */ -}}
|
||||
{{- with .Site.Params.comment.disqus.shortname -}}
|
||||
<div id="disqus_thread"></div>
|
||||
{{- $script := printf `<script src="https://%s.disqus.com/embed.js"></script>` . -}}
|
||||
{{- slice $script | $.Scratch.Add "scriptCDN" -}}
|
||||
{{- slice $script | $scratch.Add "scriptCDN" -}}
|
||||
<noscript>
|
||||
Please enable JavaScript to view the <a href="https://disqus.com/?ref_noscript">comments powered by Disqus.</a>
|
||||
</noscript>
|
||||
|
@ -16,14 +18,14 @@
|
|||
{{- $gitalk := .Site.Params.comment.gitalk -}}
|
||||
<div id="gitalk"></div>
|
||||
{{- with $CDN.gitalkCSS -}}
|
||||
{{- slice . | $.Scratch.Add "linkCDN" -}}
|
||||
{{- slice . | $scratch.Add "linkCDN" -}}
|
||||
{{- else -}}
|
||||
{{- slice "css/lib/gitalk/gitalk.css" | .Scratch.Add "linkLocal" -}}
|
||||
{{- slice "css/lib/gitalk/gitalk.css" | $scratch.Add "linkLocal" -}}
|
||||
{{- end -}}
|
||||
{{- with $CDN.gitalkJS -}}
|
||||
{{- slice . | $.Scratch.Add "scriptCDN" -}}
|
||||
{{- slice . | $scratch.Add "scriptCDN" -}}
|
||||
{{- else -}}
|
||||
{{- slice "css/lib/gitalk/gitalk.min.js" | .Scratch.Add "scriptLocal" -}}
|
||||
{{- slice "css/lib/gitalk/gitalk.min.js" | $scratch.Add "scriptLocal" -}}
|
||||
{{- end -}}
|
||||
<script>
|
||||
document.addEventListener("DOMContentLoaded", function(event) {
|
||||
|
@ -49,11 +51,11 @@
|
|||
{{- if .Site.Params.comment.valine.enable -}}
|
||||
{{- $valine := .Site.Params.comment.valine -}}
|
||||
<div id="valine"></div>
|
||||
{{- slice "css/lib/valine/dark.scss" | .Scratch.Add "linkLocal" -}}
|
||||
{{- slice "css/lib/valine/dark.scss" | $scratch.Add "linkLocal" -}}
|
||||
{{- with $CDN.valineJS -}}
|
||||
{{- slice . | $.Scratch.Add "scriptCDN" -}}
|
||||
{{- slice . | $scratch.Add "scriptCDN" -}}
|
||||
{{- else -}}
|
||||
{{- slice "js/lib/valine/Valine.min.js" | .Scratch.Add "scriptLocal" -}}
|
||||
{{- slice "js/lib/valine/Valine.min.js" | $scratch.Add "scriptLocal" -}}
|
||||
{{- end -}}
|
||||
<script>
|
||||
document.addEventListener("DOMContentLoaded", function(event) {
|
||||
|
@ -106,7 +108,7 @@
|
|||
></div>
|
||||
{{- $script := `<script src="https://connect.facebook.net/%s/sdk.js#xfbml=1&version=v5.0&appId=%s&autoLogAppEvents=1" crossorigin="anonymous"></script>` -}}
|
||||
{{- $script = printf $script $facebook.languageCode $facebook.appId -}}
|
||||
{{- slice $script | .Scratch.Add "scriptCDN" -}}
|
||||
{{- slice $script | $scratch.Add "scriptCDN" -}}
|
||||
<noscript>
|
||||
Please enable JavaScript to view the <a href="https://developers.facebook.com/docs/plugins/comments/">comments powered by Facebook.</a>
|
||||
</noscript>
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
{{- $CDN := .Scratch.Get "CDN" -}}
|
||||
{{- $scratch := .Scratch.Get "scratch" -}}
|
||||
{{- $CDN := $scratch.Get "CDN" -}}
|
||||
|
||||
<link rel="canonical" href="{{ .Permalink }}" />
|
||||
<link rel="shortcut icon" type="image/x-icon" href="/favicon.ico" />
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
{{- $scratch := .Scratch.Get "scratch" -}}
|
||||
|
||||
<div class="home-profile">
|
||||
{{- $avatar := .Site.Params.home.profile.avatarURL -}}
|
||||
{{- with .Site.Params.home.profile.gravatarEmail -}}
|
||||
|
@ -6,7 +8,7 @@
|
|||
{{- with $avatar -}}
|
||||
<div class="home-avatar">
|
||||
<a href="/posts">
|
||||
<img src={{ . | relURL }} alt="avatar" title="{{ T "home" }}">
|
||||
{{- partial "plugin/image.html" (dict "src-s" . "title" "avatar" "description" (T "home") "context" $) -}}
|
||||
</a>
|
||||
</div>
|
||||
{{- end -}}
|
||||
|
@ -16,16 +18,12 @@
|
|||
{{- if $.Site.Params.home.profile.typeit -}}
|
||||
{{- $id := md5 . | printf "tp-%s" -}}
|
||||
<div id={{ printf "r%s" $id }} hidden=true>
|
||||
{{- /* FIXME: https://github.com/gohugoio/hugo/issues/6882 */ -}}
|
||||
{{- /* . | $.RenderString | safeHTML */ -}}
|
||||
{{- . | markdownify | safeHTML -}}
|
||||
{{- . -}}
|
||||
</div>
|
||||
<div id={{ $id }} class="typeit"></div>
|
||||
{{- $.Scratch.SetInMap "typeitMap" $id (slice $id) -}}
|
||||
{{- $scratch.SetInMap "typeitMap" $id (slice $id) -}}
|
||||
{{- else -}}
|
||||
{{- /* FIXME: https://github.com/gohugoio/hugo/issues/6882 */ -}}
|
||||
{{- /* . | $.RenderString | safeHTML */ -}}
|
||||
{{- . | markdownify | safeHTML -}}
|
||||
{{- . -}}
|
||||
{{- end -}}
|
||||
</h2>
|
||||
{{- end -}}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{{- if gt $.Paginator.TotalPages 1 -}}
|
||||
{{- if gt .Paginator.TotalPages 1 -}}
|
||||
<ul class="pagination">
|
||||
{{- $.Scratch.Set "paginator.ellipsed" false -}}
|
||||
{{- .Scratch.Set "paginator.ellipsed" false -}}
|
||||
{{- range $.Paginator.Pagers -}}
|
||||
{{- $right := sub .TotalPages .PageNumber -}}
|
||||
{{- $showNumber := or (le .PageNumber 1) (eq $right 0) -}}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{{- $type := index . "type" | default "fa" -}}
|
||||
{{- $classList := split (index . "class") " " -}}
|
||||
{{- $scratch := index . "scratch" -}}
|
||||
{{- $context := index . "context" -}}
|
||||
{{- /* Fork Awesome */ -}}
|
||||
{{- if eq $type "fo" -}}
|
||||
{{- $newClassList := slice -}}
|
||||
|
@ -12,11 +12,13 @@
|
|||
{{- end -}}
|
||||
{{- end -}}
|
||||
{{- $classList = $newClassList -}}
|
||||
{{- $scratch := $context.Scratch.Get "scratch" -}}
|
||||
{{- $scratch.Set "forkawesome" true -}}
|
||||
|
||||
{{- /* default is Font Awesome */ -}}
|
||||
{{- /* Others */ -}}
|
||||
{{- else if ne $type "fa" -}}
|
||||
{{- $scratch := $context.Scratch.Get "scratch" -}}
|
||||
{{- $scratch.Set "iconfont" true -}}
|
||||
{{- end -}}
|
||||
<i class="{{ delimit $classList ` ` }}"></i>
|
||||
|
|
|
@ -1,3 +1,36 @@
|
|||
{{- /* Lazyload */ -}}
|
||||
{{- $res := resources.Get "svg/loading.svg" | minify -}}
|
||||
<img src="{{ $res.RelPermalink | safeURL }}" data-sizes="auto" data-src="{{ index . `src` | safeURL }}" alt="{{ index . `alt` }}" title="{{ index . `title` | default (index . `alt`) }}" class="lazyload">
|
||||
{{- /* lazysizes and lightgallery.js */ -}}
|
||||
{{- $src := index . "src" -}}
|
||||
{{- $small := index . "src-s" | default $src -}}
|
||||
{{- $large := index . "src-l" | default $src -}}
|
||||
{{- $title := index . "title" -}}
|
||||
{{- $description := index . "description" -}}
|
||||
{{- $context := index . "context" -}}
|
||||
{{- $scratch := $context.Scratch.Get "scratch" -}}
|
||||
{{- $loading := resources.Get "svg/loading.svg" | minify -}}
|
||||
{{- if not (index . "src") | and (index . "src-s") -}}
|
||||
{{- $loading = resources.Get "svg/loading.small.svg" | minify -}}
|
||||
{{- end -}}
|
||||
{{- if index . "lightgallery" -}}
|
||||
<a class="lightgallery" href="{{ $large | safeURL }}" title="{{ $description }}" data-thumbnail="{{ $small | safeURL }}"{{ if $title }} data-sub-html="<h2>{{ $title }}</h2><p>{{ $description }}</p>"{{ end }}>
|
||||
<img
|
||||
class="lazyload"
|
||||
loading="lazy"
|
||||
src="{{ $loading.RelPermalink | safeURL }}"
|
||||
data-sizes="auto"
|
||||
data-srcset="{{ $small | safeURL }}, {{ $src | safeURL }} 1.5x, {{ $large | safeURL }} 2x"
|
||||
data-src="{{ $src | safeURL }}"
|
||||
alt="{{ $title | default $description }}" />
|
||||
</a>
|
||||
{{- $scratch.Set "lightgallery" true -}}
|
||||
{{- else -}}
|
||||
<img
|
||||
class="lazyload"
|
||||
loading="lazy"
|
||||
src="{{ $loading.RelPermalink | safeURL }}"
|
||||
data-sizes="auto"
|
||||
data-srcset="{{ $small | safeURL }}, {{ $src | safeURL }} 1.5x, {{ $large | safeURL }} 2x"
|
||||
data-src="{{ $src | safeURL }}"
|
||||
alt="{{ $title | default $description }}"
|
||||
title="{{ $description }}" />
|
||||
{{- end -}}
|
||||
{{- $scratch.Set "lazysizes" true -}}
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
{{- if .Params.share.enable | default .Site.Params.share.enable | eq true -}}
|
||||
{{- .Scratch.Set "share" true -}}
|
||||
{{- $scratch := .Scratch.Get "scratch" -}}
|
||||
|
||||
{{- if ne .Site.Params.share.enable false | and (ne .Params.share false) -}}
|
||||
{{- $scratch.Set "share" true -}}
|
||||
|
||||
{{- /* 001: Twitter */ -}}
|
||||
{{- if .Params.Share.Twitter | default .Site.Params.Share.Twitter | eq true -}}
|
||||
|
@ -95,7 +97,7 @@
|
|||
{{- /* 014: Instapaper */ -}}
|
||||
{{- if .Params.Share.Instapaper | default .Site.Params.Share.Instapaper | eq true -}}
|
||||
<a href="javascript:void(0);" title="{{ T `share` }} 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" "context" .) -}}
|
||||
</a>
|
||||
{{- end -}}
|
||||
|
||||
|
@ -144,7 +146,7 @@
|
|||
{{- /* 021: Myspace */ -}}
|
||||
{{- if .Params.Share.Myspace | default .Site.Params.Share.Myspace | eq true -}}
|
||||
<a href="javascript:void(0);" title="{{ T `share` }} 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" "context" .) -}}
|
||||
</a>
|
||||
{{- end -}}
|
||||
|
||||
|
@ -158,7 +160,7 @@
|
|||
{{- /* 023: 百度 */ -}}
|
||||
{{- if .Params.Share.Baidu | default .Site.Params.Share.Baidu | eq true -}}
|
||||
<a href="javascript:void(0);" title="{{ T `share` }} 百度" 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" "context" .) -}}
|
||||
</a>
|
||||
{{- end -}}
|
||||
|
||||
|
|
|
@ -302,7 +302,7 @@
|
|||
{{- /* 044: 知乎 */ -}}
|
||||
{{- with .Site.Params.Social.Zhihu -}}
|
||||
{{- $options := dict "href" (printf "https://www.zhihu.com/people/%s" .) "title" "知乎" "rel" "me" -}}
|
||||
{{- $options = dict "icon" (dict "class" "loveit it-zhihu-line" "type" "other" "scratch" $.Scratch) | merge $options -}}
|
||||
{{- $options = dict "icon" (dict "class" "loveit it-zhihu-line" "type" "other" "context" $) | merge $options -}}
|
||||
{{- partial "plugin/link.html" $options -}}
|
||||
{{- end -}}
|
||||
|
||||
|
@ -394,28 +394,28 @@
|
|||
{{- /* 055: Gitea */ -}}
|
||||
{{- with .Site.Params.Social.Gitea -}}
|
||||
{{- $options := dict "href" . "title" "Gitea" "rel" "me" -}}
|
||||
{{- $options = dict "icon" (dict "class" "fa fa-gitea fa-fw" "type" "fo" "scratch" $.Scratch) | merge $options -}}
|
||||
{{- $options = dict "icon" (dict "class" "fa fa-gitea fa-fw" "type" "fo" "context" $) | merge $options -}}
|
||||
{{- partial "plugin/link.html" $options -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- /* 056: XMPP */ -}}
|
||||
{{- with .Site.Params.Social.XMPP -}}
|
||||
{{- $options := dict "href" (printf "xmpp:%s" .) "title" "XMPP" "rel" "me" -}}
|
||||
{{- $options = dict "icon" (dict "class" "fa fa-xmpp fa-fw" "type" "fo" "scratch" $.Scratch) | merge $options -}}
|
||||
{{- $options = dict "icon" (dict "class" "fa fa-xmpp fa-fw" "type" "fo" "context" $) | merge $options -}}
|
||||
{{- partial "plugin/link.html" $options -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- /* 057: Matrix */ -}}
|
||||
{{- with .Site.Params.Social.Matrix -}}
|
||||
{{- $options := dict "href" (printf "https://matrix.to/#/%s" .) "title" "Matrix" "rel" "me" -}}
|
||||
{{- $options = dict "icon" (dict "class" "fa fa-matrix-org fa-fw" "type" "fo" "scratch" $.Scratch) | merge $options -}}
|
||||
{{- $options = dict "icon" (dict "class" "fa fa-matrix-org fa-fw" "type" "fo" "context" $) | merge $options -}}
|
||||
{{- partial "plugin/link.html" $options -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- /* 058: bilibili */ -}}
|
||||
{{- with .Site.Params.Social.Bilibili -}}
|
||||
{{- $options := dict "href" (printf "https://space.bilibili.com/%s" .) "title" "bilibili" "rel" "me" -}}
|
||||
{{- $options = dict "icon" (dict "class" "loveit it-bilibili-fill" "type" "other" "scratch" $.Scratch) | merge $options -}}
|
||||
{{- $options = dict "icon" (dict "class" "loveit it-bilibili-fill" "type" "other" "context" $) | merge $options -}}
|
||||
{{- partial "plugin/link.html" $options -}}
|
||||
{{- end -}}
|
||||
|
||||
|
|
|
@ -1,104 +1,148 @@
|
|||
{{- $CDN := .Scratch.Get "CDN" -}}
|
||||
{{- $localScratch := newScratch -}}
|
||||
{{- $scratch := .Scratch.Get "scratch" -}}
|
||||
{{- $CDN := $scratch.Get "CDN" -}}
|
||||
|
||||
{{- /* Fork Awesome https://forkaweso.me/ */ -}}
|
||||
{{- if .Scratch.Get "forkawesome" -}}
|
||||
{{- slice "css/lib/forkawesome/fork-awesome.scss" | .Scratch.Add "linkLocal" -}}
|
||||
{{- if $scratch.Get "forkawesome" -}}
|
||||
{{- slice "css/lib/forkawesome/fork-awesome.scss" | $scratch.Add "linkLocal" -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- /* iconfont https://www.iconfont.cn/ */ -}}
|
||||
{{- if .Scratch.Get "iconfont" -}}
|
||||
{{- slice "css/lib/iconfont/iconfont.css" | .Scratch.Add "linkLocal" -}}
|
||||
{{- if $scratch.Get "iconfont" -}}
|
||||
{{- slice "css/lib/iconfont/iconfont.css" | $scratch.Add "linkLocal" -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- /* Smooth Scroll https://github.com/cferdinandi/smooth-scroll */ -}}
|
||||
{{- with $CDN.smoothScrollJS -}}
|
||||
{{- slice . | $.Scratch.Add "scriptCDN" -}}
|
||||
{{- slice . | $scratch.Add "scriptCDN" -}}
|
||||
{{- else -}}
|
||||
{{- slice "js/lib/smooth-scroll/smooth-scroll.polyfills.min.js" | .Scratch.Add "scriptLocal" -}}
|
||||
{{- slice "js/lib/smooth-scroll/smooth-scroll.polyfills.min.js" | $scratch.Add "scriptLocal" -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- /* Sharer.js https://github.com/ellisonleao/sharer.js */ -}}
|
||||
{{- if .Scratch.Get "share" -}}
|
||||
{{- if $scratch.Get "share" -}}
|
||||
{{- with $CDN.sharerJS -}}
|
||||
{{- slice . | $.Scratch.Add "scriptCDN" -}}
|
||||
{{- slice . | $scratch.Add "scriptCDN" -}}
|
||||
{{- else -}}
|
||||
{{- slice "js/lib/sharer/sharer.min.js" | .Scratch.Add "scriptLocal" -}}
|
||||
{{- slice "js/lib/sharer/sharer.min.js" | $scratch.Add "scriptLocal" -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- /* lazysizes https://github.com/aFarkas/lazysizes */ -}}
|
||||
{{- with $CDN.lazysizesJS -}}
|
||||
{{- slice . | $.Scratch.Add "scriptCDN" -}}
|
||||
{{- else -}}
|
||||
{{- slice "js/lib/lazysizes/lazysizes.min.js" | .Scratch.Add "scriptLocal" -}}
|
||||
{{- if $scratch.Get "lazysizes" -}}
|
||||
{{- with $CDN.lazysizesJS -}}
|
||||
{{- slice . | $scratch.Add "scriptCDN" -}}
|
||||
{{- else -}}
|
||||
{{- slice "js/lib/lazysizes/lazysizes.min.js" | $scratch.Add "scriptLocal" -}}
|
||||
{{- end -}}
|
||||
{{- with $CDN.lazysizesNativeLoadingJS -}}
|
||||
{{- slice . | $scratch.Add "scriptCDN" -}}
|
||||
{{- else -}}
|
||||
{{- slice "js/lib/lazysizes/ls.native-loading.min.js" | $scratch.Add "scriptLocal" -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- /* lightgallery.js https://github.com/sachinchoolur/lightgallery.js */ -}}
|
||||
{{- if $scratch.Get "lightgallery" -}}
|
||||
{{- with $CDN.lightgalleryCSS -}}
|
||||
{{- slice . | $scratch.Add "linkCDN" -}}
|
||||
{{- else -}}
|
||||
{{- slice "css/lib/lightgallery/lightgallery.min.css" | $scratch.Add "linkLocal" -}}
|
||||
{{- end -}}
|
||||
{{- with $CDN.lightgalleryJS -}}
|
||||
{{- slice . | $scratch.Add "scriptCDN" -}}
|
||||
{{- else -}}
|
||||
{{- slice "js/lib/lightgallery/lightgallery.min.js" | $scratch.Add "scriptLocal" -}}
|
||||
{{- end -}}
|
||||
{{- with $CDN.lightgalleryThumbnailJS -}}
|
||||
{{- slice . | $scratch.Add "scriptCDN" -}}
|
||||
{{- else -}}
|
||||
{{- slice "js/lib/lightgallery/lg-thumbnail.min.js" | $scratch.Add "scriptLocal" -}}
|
||||
{{- end -}}
|
||||
{{- with $CDN.lightgalleryZoomJS -}}
|
||||
{{- slice . | $scratch.Add "scriptCDN" -}}
|
||||
{{- else -}}
|
||||
{{- slice "js/lib/lightgallery/lg-zoom.min.js" | $scratch.Add "scriptLocal" -}}
|
||||
{{- end -}}
|
||||
<script>
|
||||
document.addEventListener('DOMContentLoaded', function () {
|
||||
lightGallery(document.getElementById('content'), {
|
||||
selector: '.lightgallery',
|
||||
speed: 400,
|
||||
hideBarsDelay: 2000,
|
||||
thumbnail: true,
|
||||
exThumbImage: 'data-thumbnail',
|
||||
thumbWidth: 80,
|
||||
thumbContHeight: 80,
|
||||
});
|
||||
});
|
||||
</script>
|
||||
{{- end -}}
|
||||
|
||||
{{- /* TypeIt https://github.com/alexmacarthur/typeit */ -}}
|
||||
{{- with .Scratch.Get "typeitMap" -}}
|
||||
{{- with $scratch.Get "typeitMap" -}}
|
||||
{{- with $CDN.typeitJS -}}
|
||||
{{- slice . | $.Scratch.Add "scriptCDN" -}}
|
||||
{{- slice . | $scratch.Add "scriptCDN" -}}
|
||||
{{- else -}}
|
||||
{{- slice "js/lib/typeit/typeit.min.js" | $.Scratch.Add "scriptLocal" -}}
|
||||
{{- slice "js/lib/typeit/typeit.min.js" | $scratch.Add "scriptLocal" -}}
|
||||
{{- end -}}
|
||||
{{- range $key, $val := . -}}
|
||||
{{- slice $val | $localScratch.Add "typeitArr" -}}
|
||||
{{- slice $val | $scratch.Add "typeitArr" -}}
|
||||
{{- end -}}
|
||||
<script>
|
||||
window.typeitArr = {{ $localScratch.Get "typeitArr" | jsonify | safeJS }};
|
||||
window.typeitArr = {{ $scratch.Get "typeitArr" | jsonify | safeJS }};
|
||||
</script>
|
||||
{{- end -}}
|
||||
|
||||
{{- /* KaTeX https://github.com/KaTeX/KaTeX */ -}}
|
||||
{{- if .Site.Params.math.enable | and (ne .Params.math false) -}}
|
||||
{{- if ne .Site.Params.math.enable false | and .Params.math -}}
|
||||
{{- with $CDN.katexCSS -}}
|
||||
{{- slice . | $.Scratch.Add "linkCDN" -}}
|
||||
{{- slice . | $scratch.Add "linkCDN" -}}
|
||||
{{- else -}}
|
||||
{{- slice "css/lib/katex/katex.min.css" | .Scratch.Add "linkLocal" -}}
|
||||
{{- slice "css/lib/katex/katex.min.css" | $scratch.Add "linkLocal" -}}
|
||||
{{- end -}}
|
||||
{{- with $CDN.katexJS -}}
|
||||
{{- slice . | $.Scratch.Add "scriptCDN" -}}
|
||||
{{- slice . | $scratch.Add "scriptCDN" -}}
|
||||
{{- else -}}
|
||||
{{- slice "js/lib/katex/katex.min.js" | .Scratch.Add "scriptLocal" -}}
|
||||
{{- slice "js/lib/katex/katex.min.js" | $scratch.Add "scriptLocal" -}}
|
||||
{{- end -}}
|
||||
{{- with $CDN.katexAutoRenderJS -}}
|
||||
{{- slice . | $.Scratch.Add "scriptCDN" -}}
|
||||
{{- slice . | $scratch.Add "scriptCDN" -}}
|
||||
{{- else -}}
|
||||
{{- slice "js/lib/katex/auto-render.min.js" | .Scratch.Add "scriptLocal" -}}
|
||||
{{- slice "js/lib/katex/auto-render.min.js" | $scratch.Add "scriptLocal" -}}
|
||||
{{- end -}}
|
||||
{{- $math := .Site.Params.math -}}
|
||||
{{- if $math.copyTex -}}
|
||||
{{- with $CDN.katexCopyTexCSS -}}
|
||||
{{- slice . | $.Scratch.Add "linkCDN" -}}
|
||||
{{- slice . | $scratch.Add "linkCDN" -}}
|
||||
{{- else -}}
|
||||
{{- slice "css/lib/katex/copy-tex.min.css" | .Scratch.Add "linkLocal" -}}
|
||||
{{- slice "css/lib/katex/copy-tex.min.css" | $scratch.Add "linkLocal" -}}
|
||||
{{- end -}}
|
||||
{{- with $CDN.katexCopyTexJS -}}
|
||||
{{- slice . | $.Scratch.Add "scriptCDN" -}}
|
||||
{{- slice . | $scratch.Add "scriptCDN" -}}
|
||||
{{- else -}}
|
||||
{{- slice "js/lib/katex/copy-tex.min.js" | .Scratch.Add "scriptLocal" -}}
|
||||
{{- slice "js/lib/katex/copy-tex.min.js" | $scratch.Add "scriptLocal" -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
{{- if $math.mhchem -}}
|
||||
{{- with $CDN.katexMhchemJS -}}
|
||||
{{- slice . | $.Scratch.Add "scriptCDN" -}}
|
||||
{{- slice . | $scratch.Add "scriptCDN" -}}
|
||||
{{- else -}}
|
||||
{{- slice "js/lib/katex/mhchem.min.js" | .Scratch.Add "scriptLocal" -}}
|
||||
{{- slice "js/lib/katex/mhchem.min.js" | $scratch.Add "scriptLocal" -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
<script>
|
||||
document.addEventListener("DOMContentLoaded", function () {
|
||||
document.addEventListener('DOMContentLoaded', function () {
|
||||
renderMathInElement(document.body, {
|
||||
delimiters: [
|
||||
{ left: "$", right: "$", display: false },
|
||||
{ left: "$$", right: "$$", display: true },
|
||||
{ left: "\\(", right: "\\)", display: false },
|
||||
{ left: "\\[", right: "\\]", display: true },
|
||||
{{- if and $math.inlineLeftDelimiter $math.inlineRightDelimiter -}}
|
||||
{ left: "{{ $math.inlineLeftDelimiter }}", right: "{{ $math.inlineRightDelimiter }}", display: false },
|
||||
{{- end -}}
|
||||
{ left: '$$', right: '$$', display: true },
|
||||
{ left: '\\[', right: '\\]', display: true },
|
||||
{{- if and $math.blockLeftDelimiter $math.blockRightDelimiter -}}
|
||||
{ left: "{{ $math.blockLeftDelimiter }}", right: "{{ $math.blockRightDelimiter }}", display: true },
|
||||
{ left: '{{ $math.blockLeftDelimiter }}', right: '{{ $math.blockRightDelimiter }}', display: true },
|
||||
{{- end -}}
|
||||
{ left: '$', right: '$', display: false },
|
||||
{ left: '\\(', right: '\\)', display: false },
|
||||
{{- if and $math.inlineLeftDelimiter $math.inlineRightDelimiter -}}
|
||||
{ left: '{{ $math.inlineLeftDelimiter }}', right: '{{ $math.inlineRightDelimiter }}', display: false },
|
||||
{{- end -}}
|
||||
]
|
||||
});
|
||||
|
@ -107,54 +151,54 @@
|
|||
{{- end -}}
|
||||
|
||||
{{- /* mermaid https://github.com/knsv/mermaid */ -}}
|
||||
{{- with .Scratch.Get "mermaidMap" -}}
|
||||
{{- with $scratch.Get "mermaidMap" -}}
|
||||
{{- with $CDN.mermaidJS -}}
|
||||
{{- slice . | $.Scratch.Add "scriptCDN" -}}
|
||||
{{- slice . | $scratch.Add "scriptCDN" -}}
|
||||
{{- else -}}
|
||||
{{- slice "js/lib/mermaid/mermaid.min.js" | $.Scratch.Add "scriptLocal" -}}
|
||||
{{- slice "js/lib/mermaid/mermaid.min.js" | $scratch.Add "scriptLocal" -}}
|
||||
{{- end -}}
|
||||
{{- slice "css/mermaid.scss" | $.Scratch.Add "linkLocal" -}}
|
||||
{{- slice "css/mermaid.scss" | $scratch.Add "linkLocal" -}}
|
||||
<script>
|
||||
window.mermaidMap = {{ jsonify . | safeJS }};
|
||||
</script>
|
||||
{{- end -}}
|
||||
|
||||
{{- /* Music */ -}}
|
||||
{{- if .Scratch.Get "music" -}}
|
||||
{{- if $scratch.Get "music" -}}
|
||||
{{- /* APlayer https://github.com/MoePlayer/APlayer */ -}}
|
||||
{{- with $CDN.aplayerCSS -}}
|
||||
{{- slice . | $.Scratch.Add "linkCDN" -}}
|
||||
{{- slice . | $scratch.Add "linkCDN" -}}
|
||||
{{- else -}}
|
||||
{{- slice "css/lib/aplayer/APlayer.min.css" | .Scratch.Add "linkLocal" -}}
|
||||
{{- slice "css/lib/aplayer/APlayer.min.css" | $scratch.Add "linkLocal" -}}
|
||||
{{- end -}}
|
||||
{{- slice "css/lib/aplayer/dark.scss" | .Scratch.Add "linkLocal" -}}
|
||||
{{- slice "css/lib/aplayer/dark.scss" | $scratch.Add "linkLocal" -}}
|
||||
{{- with $CDN.aplayerJS -}}
|
||||
{{- slice . | $.Scratch.Add "scriptCDN" -}}
|
||||
{{- slice . | $scratch.Add "scriptCDN" -}}
|
||||
{{- else -}}
|
||||
{{- slice "js/lib/aplayer/APlayer.min.js" | .Scratch.Add "scriptLocal" -}}
|
||||
{{- slice "js/lib/aplayer/APlayer.min.js" | $scratch.Add "scriptLocal" -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- /* MetingJS https://github.com/metowolf/MetingJS */ -}}
|
||||
{{- with $CDN.metingJS -}}
|
||||
{{- slice . | $.Scratch.Add "scriptCDN" -}}
|
||||
{{- slice . | $scratch.Add "scriptCDN" -}}
|
||||
{{- else -}}
|
||||
{{- slice "js/lib/meting/Meting.min.js" | .Scratch.Add "scriptLocal" -}}
|
||||
{{- slice "js/lib/meting/Meting.min.js" | $scratch.Add "scriptLocal" -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- /* dev feature */ -}}
|
||||
{{- if .Params.dev -}}
|
||||
{{- /* ECharts https://github.com/apache/incubator-echarts */ -}}
|
||||
{{- with .Scratch.Get "echartsMap" -}}
|
||||
{{- with $scratch.Get "echartsMap" -}}
|
||||
{{- with $CDN.echartsJS -}}
|
||||
{{- slice . | $.Scratch.Add "scriptCDN" -}}
|
||||
{{- slice . | $scratch.Add "scriptCDN" -}}
|
||||
{{- else -}}
|
||||
{{- slice "js/lib/echarts/echarts.min.js" | $.Scratch.Add "scriptLocal" -}}
|
||||
{{- slice "js/lib/echarts/echarts.min.js" | $scratch.Add "scriptLocal" -}}
|
||||
{{- end -}}
|
||||
{{- with $CDN.echartsMacaronsJS -}}
|
||||
{{- slice . | $.Scratch.Add "scriptCDN" -}}
|
||||
{{- slice . | $scratch.Add "scriptCDN" -}}
|
||||
{{- else -}}
|
||||
{{- slice "js/lib/echarts/macarons.js" | $.Scratch.Add "scriptLocal" -}}
|
||||
{{- slice "js/lib/echarts/macarons.js" | $scratch.Add "scriptLocal" -}}
|
||||
{{- end -}}
|
||||
<script>
|
||||
window.echartsMap = {
|
||||
|
@ -166,10 +210,10 @@
|
|||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- range .Scratch.Get "linkCDN" -}}
|
||||
{{- range $scratch.Get "linkCDN" -}}
|
||||
{{- safeHTML . -}}
|
||||
{{- end -}}
|
||||
{{- range .Scratch.Get "linkLocal" -}}
|
||||
{{- range $scratch.Get "linkLocal" -}}
|
||||
{{- $res := resources.Get . -}}
|
||||
{{- if strings.HasSuffix . ".scss" -}}
|
||||
{{- $options := dict "outputStyle" "compressed" "enableSourceMap" true -}}
|
||||
|
@ -180,10 +224,10 @@
|
|||
<link rel="stylesheet" href="{{ $res.RelPermalink }}">
|
||||
{{- end -}}
|
||||
|
||||
{{- range .Scratch.Get "scriptCDN" -}}
|
||||
{{- range $scratch.Get "scriptCDN" -}}
|
||||
{{- safeHTML . -}}
|
||||
{{- end -}}
|
||||
{{- range .Scratch.Get "scriptLocal" -}}
|
||||
{{- range $scratch.Get "scriptLocal" -}}
|
||||
{{- $res := resources.Get . -}}
|
||||
{{- if not (strings.HasSuffix . ".min.js") -}}
|
||||
{{- $res = minify $res -}}
|
||||
|
@ -195,6 +239,6 @@
|
|||
<script src=/js/theme.min.js></script>
|
||||
|
||||
{{- /* Google analytics async */ -}}
|
||||
{{- if .Scratch.Get "production" | and .Site.GoogleAnalytics -}}
|
||||
{{- if $scratch.Get "production" | and .Site.GoogleAnalytics -}}
|
||||
{{- template "_internal/google_analytics_async.html" . -}}
|
||||
{{- end -}}
|
||||
|
|
|
@ -28,11 +28,9 @@
|
|||
{{- end -}}
|
||||
</div>
|
||||
<div class="post-info-share">
|
||||
{{- if .Site.Params.page.socialShare -}}
|
||||
<span>
|
||||
{{- partial "plugin/share.html" . -}}
|
||||
</span>
|
||||
{{- end -}}
|
||||
<span>
|
||||
{{- partial "plugin/share.html" . -}}
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
{{- define "title" }}{{ .Title }} | {{ .Site.Title }}{{ end -}}
|
||||
|
||||
{{- define "content" -}}
|
||||
{{- $scratch := .Scratch.Get "scratch" -}}
|
||||
<article class="page single">
|
||||
{{- /* Title */ -}}
|
||||
<h1 class="single-title animated flipInX">{{ .Title }}</h1>
|
||||
|
@ -35,7 +36,7 @@
|
|||
<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 .Scratch.Get "production" | and .Site.Params.valine.enable | and .Site.Params.valine.visitor -}}
|
||||
{{- if $scratch.Get "production" | and .Site.Params.valine.enable | and .Site.Params.valine.visitor -}}
|
||||
<span id="{{ .RelPermalink | relURL }}" class="leancloud_visitors" data-flag-title="{{ .Title }}">
|
||||
<i class="far fa-eye fa-fw"></i>{{ T "pageviews" | safeHTML }}
|
||||
</span>
|
||||
|
@ -46,7 +47,7 @@
|
|||
{{- /* Featured image */ -}}
|
||||
{{- with .Params.featuredImage -}}
|
||||
<div class="featured-image">
|
||||
{{- partial "plugin/image.html" (dict "src" . "alt" "featured image") -}}
|
||||
{{- partial "plugin/image.html" (dict "src" . "description" $.Description "context" $) -}}
|
||||
</div>
|
||||
{{- end -}}
|
||||
|
||||
|
@ -76,7 +77,7 @@
|
|||
{{- end -}}
|
||||
|
||||
{{- /* Content */ -}}
|
||||
<div class="content">
|
||||
<div class="content" id="content">
|
||||
{{- partial "single/content.html" .Content -}}
|
||||
</div>
|
||||
|
||||
|
|
|
@ -1,4 +1,6 @@
|
|||
<!-- shuffle md5 as id -->
|
||||
{{- $scratch := .Page.Scratch.Get "scratch" -}}
|
||||
|
||||
{{- /* shuffle md5 as id */ -}}
|
||||
{{- $id := delimit (split (md5 .Inner) "" | shuffle) "" | printf "echarts-%s" -}}
|
||||
<div class="echarts" id="{{ $id }}"></div>
|
||||
{{- .Page.Scratch.SetInMap "echartsMap" $id (printf "{%s}" .Inner) -}}
|
||||
{{- $scratch.SetInMap "echartsMap" $id (printf "{%s}" .Inner) -}}
|
||||
|
|
|
@ -1,4 +1,6 @@
|
|||
{{- $scratch := .Page.Scratch.Get "scratch" -}}
|
||||
|
||||
{{- /* shuffle md5 as id */ -}}
|
||||
{{- $id := delimit (split (md5 .Inner) "" | shuffle) "" | printf "mermaid-%s" -}}
|
||||
<div class="mermaid" id="{{ $id }}"></div>
|
||||
{{- .Page.Scratch.SetInMap "mermaidMap" $id (trim .Inner "\n") -}}
|
||||
{{- $scratch.SetInMap "mermaidMap" $id (trim .Inner "\n") -}}
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
{{- $scratch := .Page.Scratch.Get "scratch" -}}
|
||||
|
||||
{{- if .IsNamedParams -}}
|
||||
<meting-js server="{{ .Get "server" }}" type="{{ .Get "type" }}" id="{{ .Get "id" }}" theme="#A9A9B3"
|
||||
{{- with .Get "autoplay" }} autoplay="{{ . }}"{{ end -}}
|
||||
|
@ -9,4 +11,4 @@
|
|||
{{- else -}}
|
||||
<meting-js server="{{ .Get 0 }}" type="{{ .Get 1 }}" id="{{ .Get 2 }}" theme="#A9A9B3"></meting-js>
|
||||
{{- end -}}
|
||||
{{- .Page.Scratch.Set "music" true -}}
|
||||
{{- $scratch.Set "music" true -}}
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
{{- $scratch := .Page.Scratch.Get "scratch" -}}
|
||||
|
||||
{{- /* only the trailing newline is retained */ -}}
|
||||
{{- $content := replaceRE `(?s)^\n*(.*?)\n*$` "$1\n" .Inner | .Page.RenderString -}}
|
||||
{{- /* shuffle md5 as id */ -}}
|
||||
|
@ -35,7 +37,7 @@
|
|||
{{- end -}}
|
||||
|
||||
{{- $key := .Get "group" | default $id -}}
|
||||
{{- $group := index (.Page.Scratch.Get "typeitMap" | default dict) $key -}}
|
||||
{{- $group := index ($scratch.Get "typeitMap" | default dict) $key -}}
|
||||
{{- $group = $group | default slice | append $id -}}
|
||||
{{- .Page.Scratch.SetInMap "typeitMap" $key $group -}}
|
||||
{{- $scratch.SetInMap "typeitMap" $key $group -}}
|
||||
</div>
|
||||
|
|
File diff suppressed because one or more lines are too long
BIN
static/css/lib/fonts/lg.eot
Normal file
BIN
static/css/lib/fonts/lg.eot
Normal file
Binary file not shown.
47
static/css/lib/fonts/lg.svg
Normal file
47
static/css/lib/fonts/lg.svg
Normal file
|
@ -0,0 +1,47 @@
|
|||
<?xml version="1.0" standalone="no"?>
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" >
|
||||
<svg xmlns="http://www.w3.org/2000/svg">
|
||||
<metadata>
|
||||
<json>
|
||||
<![CDATA[
|
||||
{
|
||||
"fontFamily": "lg",
|
||||
"majorVersion": 1,
|
||||
"minorVersion": 0,
|
||||
"fontURL": "https://github.com/sachinchoolur/lightgallery.js",
|
||||
"copyright": "sachin",
|
||||
"license": "MLT",
|
||||
"licenseURL": "http://opensource.org/licenses/MIT",
|
||||
"version": "Version 1.0",
|
||||
"fontId": "lg",
|
||||
"psName": "lg",
|
||||
"subFamily": "Regular",
|
||||
"fullName": "lg",
|
||||
"description": "Font generated by IcoMoon."
|
||||
}
|
||||
]]>
|
||||
</json>
|
||||
</metadata>
|
||||
<defs>
|
||||
<font id="lg" horiz-adv-x="1024">
|
||||
<font-face units-per-em="1024" ascent="960" descent="-64" />
|
||||
<missing-glyph horiz-adv-x="1024" />
|
||||
<glyph unicode=" " horiz-adv-x="512" d="" />
|
||||
<glyph unicode="" glyph-name="pause_circle_outline" data-tags="pause_circle_outline" d="M554 256.667v340h86v-340h-86zM512 84.667q140 0 241 101t101 241-101 241-241 101-241-101-101-241 101-241 241-101zM512 852.667q176 0 301-125t125-301-125-301-301-125-301 125-125 301 125 301 301 125zM384 256.667v340h86v-340h-86z" />
|
||||
<glyph unicode="" glyph-name="play_circle_outline" data-tags="play_circle_outline" d="M512 84.667q140 0 241 101t101 241-101 241-241 101-241-101-101-241 101-241 241-101zM512 852.667q176 0 301-125t125-301-125-301-301-125-301 125-125 301 125 301 301 125zM426 234.667v384l256-192z" />
|
||||
<glyph unicode="" glyph-name="stack-2" data-tags="stack-2" d="M384 853.334h426.667q53 0 90.5-37.5t37.5-90.5v-426.667q0-53-37.5-90.5t-90.5-37.5h-426.667q-53 0-90.5 37.5t-37.5 90.5v426.667q0 53 37.5 90.5t90.5 37.5zM170.667 675.334v-547.333q0-17.667 12.5-30.167t30.167-12.5h547.333q-13.333-37.667-46.333-61.5t-74.333-23.833h-426.667q-53 0-90.5 37.5t-37.5 90.5v426.667q0 41.333 23.833 74.333t61.5 46.333zM810.667 768h-426.667q-17.667 0-30.167-12.5t-12.5-30.167v-426.667q0-17.667 12.5-30.167t30.167-12.5h426.667q17.667 0 30.167 12.5t12.5 30.167v426.667q0 17.667-12.5 30.167t-30.167 12.5z" />
|
||||
<glyph unicode="" glyph-name="clear" data-tags="clear" d="M810 664.667l-238-238 238-238-60-60-238 238-238-238-60 60 238 238-238 238 60 60 238-238 238 238z" />
|
||||
<glyph unicode="" glyph-name="arrow-left" data-tags="arrow-left" d="M426.667 768q17.667 0 30.167-12.5t12.5-30.167q0-18-12.667-30.333l-225.667-225.667h665q17.667 0 30.167-12.5t12.5-30.167-12.5-30.167-30.167-12.5h-665l225.667-225.667q12.667-12.333 12.667-30.333 0-17.667-12.5-30.167t-30.167-12.5q-18 0-30.333 12.333l-298.667 298.667q-12.333 13-12.333 30.333t12.333 30.333l298.667 298.667q12.667 12.333 30.333 12.333z" />
|
||||
<glyph unicode="" glyph-name="arrow-right" data-tags="arrow-right" d="M597.333 768q18 0 30.333-12.333l298.667-298.667q12.333-12.333 12.333-30.333t-12.333-30.333l-298.667-298.667q-12.333-12.333-30.333-12.333-18.333 0-30.5 12.167t-12.167 30.5q0 18 12.333 30.333l226 225.667h-665q-17.667 0-30.167 12.5t-12.5 30.167 12.5 30.167 30.167 12.5h665l-226 225.667q-12.333 12.333-12.333 30.333 0 18.333 12.167 30.5t30.5 12.167z" />
|
||||
<glyph unicode="" glyph-name="vertical_align_bottom" data-tags="vertical_align_bottom" d="M170 128.667h684v-86h-684v86zM682 384.667l-170-172-170 172h128v426h84v-426h128z" />
|
||||
<glyph unicode="" glyph-name="apps" data-tags="apps" d="M682 84.667v172h172v-172h-172zM682 340.667v172h172v-172h-172zM426 596.667v172h172v-172h-172zM682 768.667h172v-172h-172v172zM426 340.667v172h172v-172h-172zM170 340.667v172h172v-172h-172zM170 84.667v172h172v-172h-172zM426 84.667v172h172v-172h-172zM170 596.667v172h172v-172h-172z" />
|
||||
<glyph unicode="" glyph-name="fullscreen" data-tags="fullscreen" d="M598 724.667h212v-212h-84v128h-128v84zM726 212.667v128h84v-212h-212v84h128zM214 512.667v212h212v-84h-128v-128h-84zM298 340.667v-128h128v-84h-212v212h84z" />
|
||||
<glyph unicode="" glyph-name="fullscreen_exit" data-tags="fullscreen_exit" d="M682 596.667h128v-84h-212v212h84v-128zM598 128.667v212h212v-84h-128v-128h-84zM342 596.667v128h84v-212h-212v84h128zM214 256.667v84h212v-212h-84v128h-128z" />
|
||||
<glyph unicode="" glyph-name="zoom_in" data-tags="zoom_in" d="M512 512.667h-86v-86h-42v86h-86v42h86v86h42v-86h86v-42zM406 340.667q80 0 136 56t56 136-56 136-136 56-136-56-56-136 56-136 136-56zM662 340.667l212-212-64-64-212 212v34l-12 12q-76-66-180-66-116 0-197 80t-81 196 81 197 197 81 196-81 80-197q0-104-66-180l12-12h34z" />
|
||||
<glyph unicode="" glyph-name="zoom_out" data-tags="zoom_out" d="M298 554.667h214v-42h-214v42zM406 340.667q80 0 136 56t56 136-56 136-136 56-136-56-56-136 56-136 136-56zM662 340.667l212-212-64-64-212 212v34l-12 12q-76-66-180-66-116 0-197 80t-81 196 81 197 197 81 196-81 80-197q0-104-66-180l12-12h34z" />
|
||||
<glyph unicode="" glyph-name="share" data-tags="share" d="M768 252.667c68 0 124-56 124-124s-56-126-124-126-124 58-124 126c0 10 0 20 2 28l-302 176c-24-22-54-34-88-34-70 0-128 58-128 128s58 128 128 128c34 0 64-12 88-34l300 174c-2 10-4 20-4 30 0 70 58 128 128 128s128-58 128-128-58-128-128-128c-34 0-64 14-88 36l-300-176c2-10 4-20 4-30s-2-20-4-30l304-176c22 20 52 32 84 32z" />
|
||||
<glyph unicode="" glyph-name="facebook-with-circle" data-tags="facebook-with-circle" d="M512 952.32c-271.462 0-491.52-220.058-491.52-491.52s220.058-491.52 491.52-491.52 491.52 220.058 491.52 491.52-220.058 491.52-491.52 491.52zM628.429 612.659h-73.882c-8.755 0-18.483-11.52-18.483-26.829v-53.35h92.416l-13.978-76.083h-78.438v-228.403h-87.194v228.403h-79.104v76.083h79.104v44.749c0 64.205 44.544 116.378 105.677 116.378h73.882v-80.947z" />
|
||||
<glyph unicode="" glyph-name="google-with-circle" data-tags="google+-with-circle" d="M512 952.32c-271.462 0-491.52-220.058-491.52-491.52s220.058-491.52 491.52-491.52 491.52 220.058 491.52 491.52-220.058 491.52-491.52 491.52zM483.686 249.805c-30.874-15.002-64.102-16.589-76.954-16.589-2.458 0-3.84 0-3.84 0s-1.178 0-2.765 0c-20.070 0-119.962 4.608-119.962 95.59 0 89.395 108.8 96.41 142.131 96.41h0.87c-19.251 25.702-15.258 51.61-15.258 51.61-1.69-0.102-4.147-0.205-7.168-0.205-12.544 0-36.762 1.997-57.549 15.411-25.498 16.384-38.4 44.288-38.4 82.893 0 109.107 119.142 113.51 120.32 113.613h118.989v-2.611c0-13.312-23.91-15.923-40.192-18.125-5.53-0.819-16.64-1.894-19.763-3.482 30.157-16.128 35.021-41.421 35.021-79.104 0-42.906-16.794-65.587-34.611-81.51-11.059-9.882-19.712-17.613-19.712-28.006 0-10.189 11.878-20.582 25.702-32.717 22.579-19.917 53.555-47.002 53.555-92.723 0-47.258-20.326-81.050-60.416-100.454zM742.4 460.8h-76.8v-76.8h-51.2v76.8h-76.8v51.2h76.8v76.8h51.2v-76.8h76.8v-51.2zM421.018 401.92c-2.662 0-5.325-0.102-8.038-0.307-22.733-1.69-43.725-10.189-58.88-24.013-15.053-13.619-22.733-30.822-21.658-48.179 2.304-36.403 41.37-57.702 88.832-54.323 46.694 3.379 77.824 30.31 75.571 66.714-2.15 34.202-31.898 60.109-75.827 60.109zM465.766 599.808c-12.39 43.52-32.358 56.422-63.386 56.422-3.328 0-6.707-0.512-9.933-1.382-13.466-3.84-24.166-15.053-30.106-31.744-6.093-16.896-6.451-34.509-1.229-54.579 9.472-35.891 34.97-61.901 60.672-61.901 3.379 0 6.758 0.41 9.933 1.382 28.109 7.885 45.722 50.79 34.048 91.802z" />
|
||||
<glyph unicode="" glyph-name="pinterest-with-circle" data-tags="pinterest-with-circle" d="M512 952.32c-271.462 0-491.52-220.058-491.52-491.52s220.058-491.52 491.52-491.52 491.52 220.058 491.52 491.52-220.058 491.52-491.52 491.52zM545.638 344.32c-31.539 2.406-44.749 18.022-69.427 32.973-13.568-71.219-30.157-139.52-79.309-175.206-15.206 107.725 22.221 188.518 39.629 274.381-29.645 49.92 3.533 150.323 66.099 125.645 76.954-30.515-66.662-185.6 29.747-205.005 100.659-20.173 141.773 174.694 79.36 237.978-90.214 91.494-262.502 2.099-241.306-128.87 5.12-32 38.246-41.728 13.21-85.914-57.702 12.8-74.957 58.317-72.704 118.989 3.533 99.328 89.242 168.909 175.155 178.483 108.698 12.083 210.688-39.885 224.819-142.182 15.821-115.405-49.101-240.282-165.274-231.27z" />
|
||||
<glyph unicode="" glyph-name="twitter-with-circle" data-tags="twitter-with-circle" d="M512 952.32c-271.462 0-491.52-220.058-491.52-491.52s220.058-491.52 491.52-491.52 491.52 220.058 491.52 491.52-220.058 491.52-491.52 491.52zM711.936 549.683c0.205-4.198 0.256-8.397 0.256-12.493 0-128-97.331-275.507-275.405-275.507-54.682 0-105.574 15.974-148.378 43.52 7.526-0.922 15.258-1.28 23.091-1.28 45.363 0 87.091 15.411 120.218 41.421-42.342 0.819-78.080 28.774-90.419 67.174 5.888-1.075 11.93-1.69 18.176-1.69 8.806 0 17.408 1.178 25.498 3.379-44.288 8.909-77.67 48.026-77.67 94.925v1.178c13.056-7.219 28.006-11.622 43.878-12.134-26.010 17.408-43.059 47.002-43.059 80.64 0 17.715 4.762 34.406 13.107 48.691 47.77-58.573 119.040-97.075 199.526-101.222-1.69 7.117-2.509 14.49-2.509 22.118 0 53.402 43.315 96.819 96.819 96.819 27.802 0 52.992-11.776 70.656-30.618 22.067 4.403 42.752 12.39 61.44 23.501-7.219-22.579-22.528-41.574-42.547-53.606 19.61 2.406 38.246 7.578 55.603 15.309-12.954-19.405-29.389-36.506-48.282-50.125z" />
|
||||
</font></defs></svg>
|
After Width: | Height: | Size: 8.7 KiB |
BIN
static/css/lib/fonts/lg.ttf
Normal file
BIN
static/css/lib/fonts/lg.ttf
Normal file
Binary file not shown.
BIN
static/css/lib/fonts/lg.woff
Normal file
BIN
static/css/lib/fonts/lg.woff
Normal file
Binary file not shown.
BIN
static/css/lib/img/loading.gif
Normal file
BIN
static/css/lib/img/loading.gif
Normal file
Binary file not shown.
After Width: | Height: | Size: 3.7 KiB |
BIN
static/css/lib/img/video-play.png
Normal file
BIN
static/css/lib/img/video-play.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 819 B |
BIN
static/css/lib/img/vimeo-play.png
Normal file
BIN
static/css/lib/img/vimeo-play.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.4 KiB |
BIN
static/css/lib/img/youtube-play.png
Normal file
BIN
static/css/lib/img/youtube-play.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 2.6 KiB |
Loading…
Reference in a new issue