Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenDocCN
LoveIt
提交
77d2decf
L
LoveIt
项目概览
OpenDocCN
/
LoveIt
通知
3
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
L
LoveIt
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
77d2decf
编写于
2月 03, 2020
作者:
D
Dillon
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix(image): fix image safeURL bug
上级
52c7ad29
变更
9
隐藏空白更改
内联
并排
Showing
9 changed file
with
473 addition
and
146 deletion
+473
-146
assets/css/_page/_post.scss
assets/css/_page/_post.scss
+13
-0
assets/css/_variables.scss
assets/css/_variables.scss
+1
-1
exampleSite/config.toml
exampleSite/config.toml
+3
-1
exampleSite/zh/config.toml
exampleSite/zh/config.toml
+3
-1
exampleSite/zh/content/posts/Basic-Markdown-Preview.md
exampleSite/zh/content/posts/Basic-Markdown-Preview.md
+2
-2
exampleSite/zh/content/posts/test.md
exampleSite/zh/content/posts/test.md
+316
-0
layouts/_default/_markup/render-image.html
layouts/_default/_markup/render-image.html
+1
-1
layouts/partials/image.html
layouts/partials/image.html
+1
-1
layouts/partials/scripts.html
layouts/partials/scripts.html
+133
-139
未找到文件。
assets/css/_page/_post.scss
浏览文件 @
77d2decf
...
...
@@ -60,6 +60,19 @@
visibility
:
hidden
;
}
h1
,
h2
,
h3
,
h4
,
h5
,
h6
{
font-weight
:
bold
;
.dark-theme
&
{
font-weight
:
bolder
;
}
}
h2
,
h3
,
h4
,
...
...
assets/css/_variables.scss
浏览文件 @
77d2decf
...
...
@@ -18,7 +18,7 @@ $global-font-color-dark: #a9a9b3 !default;
// Color of the secondary text
$global-font-secondary-color
:
#a9a9b3
!
default
;
$global-font-secondary-color-dark
:
#
87878d
!
default
;
$global-font-secondary-color-dark
:
#
5d5d5f
!
default
;
// Color of the link
$global-link-color
:
#161209
!
default
;
...
...
exampleSite/config.toml
浏览文件 @
77d2decf
...
...
@@ -124,7 +124,7 @@ dateFormatToUse = "2006-01-02"
# Footer CopyRight Info
## Site creation time
since
=
201
8
since
=
201
9
## ICP info only in China (HTML format is allowed)
icp
=
""
## license info (HTML format is allowed)
...
...
@@ -133,6 +133,8 @@ dateFormatToUse = "2006-01-02"
# public git repo url to link lastmod git commit only then enableGitInfo is true
gitRepo
=
""
# whether to render mathematical formulas
math
=
true
# whether to show link to Raw Markdown content of the post
linkToMarkdown
=
true
...
...
exampleSite/zh/config.toml
浏览文件 @
77d2decf
...
...
@@ -124,7 +124,7 @@ dateFormatToUse = "2006-01-02"
# 页面底部版权信息设置
## 网站创立年份
since
=
201
8
since
=
201
9
## ICP 备案信息,仅在中国使用 (允许使用 HTML 格式)
icp
=
""
## 许可协议信息 (允许使用 HTML 格式)
...
...
@@ -133,6 +133,8 @@ dateFormatToUse = "2006-01-02"
# 用于生成文章上次修改时间的公共 git 仓库路径,仅在 enableGitInfo 设为 true 时有效
gitRepo
=
""
# 是否渲染数学公式
math
=
true
# 是否在文章页面显示原始 Markdown 文档链接
linkToMarkdown
=
true
...
...
exampleSite/zh/content/posts/Basic-Markdown-Preview.md
浏览文件 @
77d2decf
...
...
@@ -435,7 +435,7 @@ Web image
![
Web Picture
](
https://static.dillonzq.com/images/20190817130904-U6cPUk.jpg
"Web Picture"
)
Local image
![
Local Picture
](
logo-revolunet-carre.jpg
"Local Picture"
)
![
Local Picture
](
/images/Apple-Devices-Preview.png
)
contact@revolunet.com
...
...
@@ -456,7 +456,7 @@ Web image
![
Web Picture
](
https://static.dillonzq.com/images/20190817130904-U6cPUk.jpg
"Web Picture"
)
Local image
![
Local Picture
](
/
苹果-touch-icon.png
"Local Picture"
)
![
Local Picture
](
/
images/Apple-Devices-Preview.png
)
<https://www.google.com>
...
...
exampleSite/zh/content/posts/test.md
0 → 100644
浏览文件 @
77d2decf
---
author
:
"
"
author_link
:
"
"
title
:
"
Test
Page"
date
:
2019-08-04T22:49:56+08:00
lastmod
:
2019-08-17T22:41:56+08:00
draft
:
true
description
:
"
This
is
a
test
page."
show_in_homepage
:
false
show_description
:
false
license
:
"
"
tags
:
[
"
Hugo"
,
"
主题"
,
]
categories
:
[
"
预览"
,
]
featured_image
:
"
"
featured_image_preview
:
"
"
comment
:
false
toc
:
true
auto_collapse_toc
:
true
math
:
true
dev
:
true
---
## This is a test page
Test all features in development[^link test].
[
^link test
]:
https://www.google.com/
<!--more-->
## Test ECharts
{{
<
dev
/
echarts
>
}}
title : {
text: '某站点用户访问来源',
subtext: '纯属虚构',
x:'center'
},
tooltip : {
trigger: 'item',
formatter: "{a}
<br/>
{b} : {c} ({d}%)"
},
legend: {
orient: 'vertical',
left: 'left',
data: ['直接访问','邮件营销','联盟广告','视频广告','搜索引擎']
},
series : [
{
name: '访问来源',
type: 'pie',
radius : '55%',
center: ['50%', '60%'],
data:[
{value:335, name:'直接访问'},
{value:310, name:'邮件营销'},
{value:234, name:'联盟广告'},
{value:135, name:'视频广告'},
{value:1548, name:'搜索引擎'}
],
itemStyle: {
emphasis: {
shadowBlur: 10,
shadowOffsetX: 0,
shadowColor: 'rgba(0, 0, 0, 0.5)'
}
}
}
]
{{
<
/
dev
/
echarts
>
}}
## Test Mermaid
{{
<
mermaid
>
}}
classDiagram
Animal <|-- Duck
Animal <|-- Fish
Animal <|-- Zebra
Animal : +int age
Animal : +String gender
Animal: +isMammal()
Animal: +mate()
class Duck{
+String beakColor
+swim()
+quack()
}
class Fish{
-int sizeInFeet
-canEat()
}
class Zebra{
+bool is_wild
+run()
}
{{
<
/
mermaid
>
}}
## Test Ruby
人最重要的特点是会思考,建站初衷无非是保存思维的电子快照。
当然各种文档工具亦或是简单的文本编辑器也能随时记录点滴,
选择建个人网站无非是想满足 [技术爱好者]^(Technology enthusiast) 的偏执。
## Test Music
## Test Toc
Toc
### Toc1
Toc
#### Toc 1-1
Toc
#### Toc 1-2
Toc
#### Toc 1-3
Toc
### Toc2
Toc
#### Toc 2-1
Toc
#### Toc 2-2
Toc
### Toc3
Toc
## Test Table
| Tables | Are | Cool |
| :------------ |:-------------:| -----:|
| col 3 is | right-aligned | $1600 |
| col 2 is | centered | $12 |
| zebra stripes | are neat | $1 |
## Test kbd
<kbd>
ctrl
</kbd>
+
<kbd>
alt
</kbd>
+
<kbd>
del
</kbd>
## Test Mixed Lists
Mixed Lists
-
item 1
*
[X] item A
*
[ ] item B
more text
1.
item a
2.
itemb
3.
item c
*
[X] item C
-
item 2
-
item 3
Really Mixed Lists
-
item 1
*
[X] item A
-
item B
more text
1.
item a
+
itemb
+
[ ] item c
1.
item C
1.
item 2
-
[X] item 3
## Test fa (Font Awesome)
:(fab fa-weixin fa-2x):
## Test Footnote
This is a footnote[^1]
[
^1
]:
This
is a footnote
## Test Admonition
{{% admonition quote %}}
biu biu biu.
{{% /admonition %}}
{{% admonition quote "I'm title!" false %}}
biu biu biu.
{{% /admonition %}}
{{% admonition example "I'm title!" false %}}
biu biu biu.
{{% /admonition %}}
{{% admonition bug "I'm title!" false %}}
biu biu biu.
{{% /admonition %}}
{{% admonition danger "I'm title!" false %}}
biu biu biu.
{{% /admonition %}}
{{% admonition failure "I'm title!" false %}}
biu biu biu.
{{% /admonition %}}
{{% admonition warning "I'm title!" false %}}
biu biu biu.
{{% /admonition %}}
{{% admonition question "I'm title!" false %}}
biu biu biu.
{{% /admonition %}}
{{% admonition success "I'm title!" false %}}
biu biu biu.
{{% /admonition %}}
{{% admonition tip "I'm title!" false %}}
biu biu biu.
{{% /admonition %}}
{{% admonition info "I'm title!" true %}}
**biu biu biu.**
{{% /admonition %}}
{{% admonition note "I'm title!" false %}}
**biu biu biu.**
{{% /admonition %}}
{{% admonition type="abstract" title="Test Admonition" %}}
This is a Admonition.
{{% /admonition %}}
## Test Highlight
`ls`
命令
```
go
// You can edit this code!
// Click here and start typing.
package
main
import
"fmt"
func
main
()
{
fmt
.
Println
(
"Hello, 世界"
,
"Hello, 世界"
,
"Hello, 世界"
,
"Hello, 世界"
,
"Hello, 世界"
,
"Hello, 世界"
,
"Hello, 世界"
,
"Hello, 世界"
)
}
```
-
This is a list that contains multiple code blocks.
-
Here is an indented block
```Code
This will still be parsed
as a normal indented code block.
```
-
Here is a fenced code block:
```Code
This will still be parsed
as a fenced code block.
```
> ```Code
> Blockquotes?
> Not a problem!
> ```
## Test Typeit
{{
<
typeit
group=
"test"
tag=
"h3"
>
}}
Here is a story about love...
{{
<
/
typeit
>
}}
{{
<
typeit
group=
"test"
code=
"java"
>
}}
u.accepted(); //
[
2018/01/05
](
/since/
)
special
int a = 1;
{{
<
/
typeit
>
}}
## Test Img
![
Gif
](
https://static.dillonzq.com/images/20190817130904-U6cPUk.jpg
"Title"
)
## Test Align
{{% align right %}}
**Test Text**
{{% /align %}}
## Test Katex
$$ c =
\p
m
\s
qrt{a^2 + b^2} $$
Left
\\
( c =
\p
m
\s
qrt{a^2 + b^2}
\\
) Right
layouts/_default/_markup/render-image.html
浏览文件 @
77d2decf
<figure>
{{- /* Lazyload */ -}}
{{- $loading := resources.Get "svg/loading.svg" | minify -}}
<img
src=
"{{ $loading.RelPermalink }}"
data-sizes=
"auto"
data-src=
"{{ .Destination | safeURL }}"
alt=
"{{ .Text }}"
{{
with
.
Title
}}
title=
"{{ . }}"
{{
end
}}
class=
"lazyload"
>
<img
src=
"{{ $loading.RelPermalink
| safeURL
}}"
data-sizes=
"auto"
data-src=
"{{ .Destination | safeURL }}"
alt=
"{{ .Text }}"
{{
with
.
Title
}}
title=
"{{ . }}"
{{
end
}}
class=
"lazyload"
>
{{- $caption := .Title | default .Text -}}
{{- with $caption -}}
<figcaption
class=
"image-caption"
>
...
...
layouts/partials/image.html
浏览文件 @
77d2decf
{{- /* Lazyload */ -}}
{{- $res := resources.Get "svg/loading.svg" | minify -}}
<img
src=
"{{ $res.RelPermalink }}"
data-sizes=
"auto"
data-src=
"{{ . }}"
alt=
"featured image"
class=
"lazyload"
>
\ No newline at end of file
<img
src=
"{{ $res.RelPermalink | safeURL }}"
data-sizes=
"auto"
data-src=
"{{ . | safeURL }}"
alt=
"featured image"
class=
"lazyload"
>
\ No newline at end of file
layouts/partials/scripts.html
浏览文件 @
77d2decf
{{- /* Google analytics async */ -}}
{{- if eq (getenv "HUGO_ENV") "production" | and .Site.GoogleAnalytics -}}
{{- template "_internal/google_analytics_async.html" . -}}
{{- end -}}
{{- /* jQuery https://github.com/jquery/jquery */ -}}
{{- $jquery := "" -}}
{{- if eq (getenv "HUGO_ENV") "production" | and .Site.Params.cdn.jquery_js -}}
...
...
@@ -6,6 +11,7 @@
{{- $res := resources.Get "js/lib/jquery/jquery.slim.min.js" -}}
{{- $jquery = printf "
<script
src=
\"%s\"
></script>
" $res.RelPermalink -}}
{{- end -}}
{{- $jquery | safeHTML -}}
{{- /* lazysizes https://github.com/aFarkas/lazysizes */ -}}
{{- $lazysizes := "" -}}
...
...
@@ -15,6 +21,7 @@
{{- $res := resources.Get "js/lib/lazysizes/lazysizes.min.js" -}}
{{- $lazysizes = printf "
<script
src=
\"%s\"
></script>
" $res.RelPermalink -}}
{{- end -}}
{{- $lazysizes | safeHTML -}}
{{- /* Smooth Scroll https://github.com/cferdinandi/smooth-scroll */ -}}
{{- $smooth_scroll := "" -}}
...
...
@@ -25,161 +32,148 @@
{{- $smooth_scroll = printf "
<script
src=
\"%s\"
></script>
" $res.RelPermalink -}}
{{- end -}}
{{- $smooth_scroll = delimit (slice $smooth_scroll "
<script>
window
.
scroll
=
new
SmoothScroll
(
'
[data-scroll]
'
,
{
speed
:
300
,
speedAsDuration
:
true
});
</script>
") "" -}}
{{- /* KaTeX https://github.com/KaTeX/KaTeX */ -}}
{{- $katex_css := "" -}}
{{- if eq (getenv "HUGO_ENV") "production" | and .Site.Params.cdn.katex_css -}}
{{- $katex_css = .Site.Params.cdn.katex_css -}}
{{- else -}}
{{- $res := resources.Get "css/lib/katex/katex.min.css" -}}
{{- $katex_css = printf "
<link
rel=
\"stylesheet\"
href=
\"%s\"
>
" $res.RelPermalink -}}
{{- end -}}
{{- $katex_js := "" -}}
{{- if eq (getenv "HUGO_ENV") "production" | and .Site.Params.cdn.katex_js -}}
{{- $katex_js = .Site.Params.cdn.katex_js -}}
{{- else -}}
{{- $res := resources.Get "js/lib/katex/katex.min.js" -}}
{{- $katex_js = printf "
<script
src=
\"%s\"
></script>
" $res.RelPermalink -}}
{{- end -}}
{{- $katex_auto_render_js := "" -}}
{{- if eq (getenv "HUGO_ENV") "production" | and .Site.Params.cdn.katex_auto_render_js -}}
{{- $katex_auto_render_js = .Site.Params.cdn.katex_auto_render_js -}}
{{- else -}}
{{- $res := resources.Get "js/lib/katex/auto-render.min.js" -}}
{{- $katex_auto_render_js = printf "
<script
defer
src=
\"%s\"
onload=
\"renderMathInElement(document.body);\"
></script>
" $res.RelPermalink -}}
{{- end -}}
{{- $katex := delimit (slice $katex_css $katex_js $katex_auto_render_js) "" -}}
{{- /* mermaid https://github.com/knsv/mermaid */ -}}
{{- $mermaid := "" -}}
{{- if eq (getenv "HUGO_ENV") "production" | and .Site.Params.cdn.mermaid_js -}}
{{- $mermaid = .Site.Params.cdn.mermaid_js -}}
{{- else -}}
{{- $res := resources.Get "js/lib/mermaid/mermaid.min.js" -}}
{{- $mermaid = printf "
<script
src=
\"%s\"
></script>
" $res.RelPermalink -}}
{{- end -}}
{{- $mermaidInit := "
<script>
mermaid
.
initialize
({
startOnLoad
:
false
,
theme
:
null
});
</script>
" -}}
{{- $mermaid = delimit (slice $mermaid $mermaidInit) "" -}}
{{- $smooth_scroll | safeHTML -}}
{{- /* TypeIt https://github.com/alexmacarthur/typeit */ -}}
{{- $typeit := "" -}}
{{- if eq (getenv "HUGO_ENV") "production" | and .Site.Params.cdn.typeit_js -}}
{{- $typeit = .Site.Params.cdn.typeit_js -}}
{{- else -}}
{{- $res := resources.Get "js/lib/typeit/typeit.min.js" -}}
{{- $typeit = printf "
<script
src=
\"%s\"
></script>
" $res.RelPermalink -}}
{{- end -}}
{{- /* jQuery.countdown https://github.com/hilios/jQuery.countdown */ -}}
{{- $countdown := "" -}}
{{- if eq (getenv "HUGO_ENV") "production" | and .Site.Params.cdn.jquery_countdown_js -}}
{{- $countdown = .Site.Params.cdn.jquery_countdown_js -}}
{{- else -}}
{{- $res := resources.Get "js/lib/jquery-countdown/jquery.countdown.min.js" -}}
{{- $countdown = printf "
<script
src=
\"%s\"
></script>
" $res.RelPermalink -}}
{{- end -}}
{{- /* APlayer https://github.com/MoePlayer/APlayer */ -}}
{{- $aplayer_css := "" -}}
{{- if eq (getenv "HUGO_ENV") "production" | and .Site.Params.cdn.aplayer_css -}}
{{- $aplayer_css = .Site.Params.cdn.aplayer_css -}}
{{- else -}}
{{- $res := resources.Get "css/lib/aplayer/APlayer.min.css" -}}
{{- $aplayer_css = printf "
<link
rel=
\"stylesheet\"
href=
\"%s\"
>
" $res.RelPermalink -}}
{{- end -}}
{{- $aplayer_js := "" -}}
{{- if eq (getenv "HUGO_ENV") "production" | and .Site.Params.cdn.aplayer_js -}}
{{- $aplayer_js = .Site.Params.cdn.aplayer_js -}}
{{- else -}}
{{- $res := resources.Get "js/lib/aplayer/APlayer.min.js" -}}
{{- $aplayer_js = printf "
<script
src=
\"%s\"
></script>
" $res.RelPermalink -}}
{{- end -}}
{{- $aplayer := delimit (slice $aplayer_css $aplayer_js) "" -}}
{{- /* MetingJS https://github.com/metowolf/MetingJS */ -}}
{{- $meting := "" -}}
{{- if eq (getenv "HUGO_ENV") "production" | and .Site.Params.cdn.meting_js -}}
{{- $meting = .Site.Params.cdn.meting_js -}}
{{- else -}}
{{- $res := resources.Get "js/lib/meting/Meting.min.js" -}}
{{- $meting = printf "
<script
src=
\"%s\"
></script>
" $res.RelPermalink -}}
{{- end -}}
{{- /* ECharts https://github.com/apache/incubator-echarts */ -}}
{{- $echarts_js := "" -}}
{{- if eq (getenv "HUGO_ENV") "production" | and .Site.Params.cdn.echarts_js -}}
{{- $echarts_js = .Site.Params.cdn.echarts_js -}}
{{- else -}}
{{- $res := resources.Get "js/lib/echarts/echarts.min.js" -}}
{{- $echarts_js = printf "
<script
src=
\"%s\"
></script>
" $res.RelPermalink -}}
{{- end -}}
{{- $echarts_macarons_js := "" -}}
{{- if eq (getenv "HUGO_ENV") "production" | and .Site.Params.cdn.echarts_macarons_js -}}
{{- $echarts_macarons_js = .Site.Params.cdn.echarts_macarons_js -}}
{{- else -}}
{{- $res := resources.Get "js/lib/echarts/macarons.js" | minify -}}
{{- $echarts_macarons_js = printf "
<script
src=
\"%s\"
></script>
" $res.RelPermalink -}}
{{- with .Scratch.Get "typeitMap" -}}
{{- $typeit := "" -}}
{{- if eq (getenv "HUGO_ENV") "production" | and .Site.Params.cdn.typeit_js -}}
{{- $typeit = .Site.Params.cdn.typeit_js -}}
{{- else -}}
{{- $res := resources.Get "js/lib/typeit/typeit.min.js" -}}
{{- $typeit = printf "
<script
src=
\"%s\"
></script>
" $res.RelPermalink -}}
{{- end -}}
{{- $typeit | safeHTML -}}
{{- $typeitArr := slice -}}
{{- range $key, $val := . -}}
{{- $typeitArr = $typeitArr | append (slice $val) -}}
{{- end -}}
<script>
{{
-
printf
"
window.typeitArr=%s;
"
(
jsonify
$typeitArr
)
|
safeJS
-
}}
</script>
{{- end -}}
{{- $echarts := delimit (slice $echarts_js $echarts_macarons_js) "" -}}
{{- $jquery | safeHTML -}}
{{- $lazysizes | safeHTML -}}
{{- $smooth_scroll | safeHTML -}}
{{- if .IsPage -}}
{{- with .Scratch.Get "mermaidMap" -}}
{{- $mermaid | safeHTML -}}
<script>
{{
-
printf
"
window.mermaidMap=%s;
"
(
jsonify
.)
|
safeJS
-
}}
</script>
{{- /* KaTeX https://github.com/KaTeX/KaTeX */ -}}
{{- if .Site.Params.math | and (ne .Params.math false) -}}
{{- $katex_css := "" -}}
{{- if eq (getenv "HUGO_ENV") "production" | and .Site.Params.cdn.katex_css -}}
{{- $katex_css = .Site.Params.cdn.katex_css -}}
{{- else -}}
{{- $res := resources.Get "css/lib/katex/katex.min.css" -}}
{{- $katex_css = printf "
<link
rel=
\"stylesheet\"
href=
\"%s\"
>
" $res.RelPermalink -}}
{{- end -}}
{{- if or .Params.math .Site.Params.math -}}
{{- $katex | safeHTML -}}
{{- $katex_js := "" -}}
{{- if eq (getenv "HUGO_ENV") "production" | and .Site.Params.cdn.katex_js -}}
{{- $katex_js = .Site.Params.cdn.katex_js -}}
{{- else -}}
{{- $res := resources.Get "js/lib/katex/katex.min.js" -}}
{{- $katex_js = printf "
<script
src=
\"%s\"
></script>
" $res.RelPermalink -}}
{{- end -}}
{{- if .Scratch.Get "music" -}}
{{- $aplayer | safeHTML -}}
{{- $meting | safeHTML -}}
{{- $katex_auto_render_js := "" -}}
{{- if eq (getenv "HUGO_ENV") "production" | and .Site.Params.cdn.katex_auto_render_js -}}
{{- $katex_auto_render_js = .Site.Params.cdn.katex_auto_render_js -}}
{{- else -}}
{{- $res := resources.Get "js/lib/katex/auto-render.min.js" -}}
{{- $katex_auto_render_js = printf "
<script
defer
src=
\"%s\"
onload=
\"renderMathInElement(document.body);\"
></script>
" $res.RelPermalink -}}
{{- end -}}
{{- $katex := delimit (slice $katex_css $katex_js $katex_auto_render_js) "" -}}
{{- $katex | safeHTML -}}
{{- end -}}
{{- with .Scratch.Get "countdownMap" -}}
{{- $countdown | safeHTML -}}
<script>
{{
-
printf
"
window.countdownMap=%s;
"
(
jsonify
.)
|
safeJS
-
}}
</script>
{{- /* mermaid https://github.com/knsv/mermaid */ -}}
{{- with .Scratch.Get "mermaidMap" -}}
{{- $mermaid := "" -}}
{{- if eq (getenv "HUGO_ENV") "production" | and .Site.Params.cdn.mermaid_js -}}
{{- $mermaid = .Site.Params.cdn.mermaid_js -}}
{{- else -}}
{{- $res := resources.Get "js/lib/mermaid/mermaid.min.js" -}}
{{- $mermaid = printf "
<script
src=
\"%s\"
></script>
" $res.RelPermalink -}}
{{- end -}}
{{- $mermaidInit := "
<script>
mermaid
.
initialize
({
startOnLoad
:
false
,
theme
:
null
});
</script>
" -}}
{{- $mermaid = delimit (slice $mermaid $mermaidInit) "" -}}
{{- $mermaid | safeHTML -}}
<script>
{{
-
printf
"
window.mermaidMap=%s;
"
(
jsonify
.)
|
safeJS
-
}}
</script>
{{- end -}}
{{- /* dev feature */ -}}
{{- if .Params.dev -}}
{{- with .Scratch.Get "echartsMap" -}}
{{- $echarts | safeHTML -}}
<script>
window
.
echartsMap
=
{
{
{
-
range
$key
,
$var
:
=
.
-
}
}
{
{
-
$key
}
}:
{
{
$var
|
safeJS
-
}
},
{
{
-
end
-
}
}
};
window
.
echartsArr
=
[];
</script>
{{- end -}}
{{- /* Music */ -}}
{{- if .Scratch.Get "music" -}}
{{- /* APlayer https://github.com/MoePlayer/APlayer */ -}}
{{- $aplayer_css := "" -}}
{{- if eq (getenv "HUGO_ENV") "production" | and .Site.Params.cdn.aplayer_css -}}
{{- $aplayer_css = .Site.Params.cdn.aplayer_css -}}
{{- else -}}
{{- $res := resources.Get "css/lib/aplayer/APlayer.min.css" -}}
{{- $aplayer_css = printf "
<link
rel=
\"stylesheet\"
href=
\"%s\"
>
" $res.RelPermalink -}}
{{- end -}}
{{- $aplayer_js := "" -}}
{{- if eq (getenv "HUGO_ENV") "production" | and .Site.Params.cdn.aplayer_js -}}
{{- $aplayer_js = .Site.Params.cdn.aplayer_js -}}
{{- else -}}
{{- $res := resources.Get "js/lib/aplayer/APlayer.min.js" -}}
{{- $aplayer_js = printf "
<script
src=
\"%s\"
></script>
" $res.RelPermalink -}}
{{- end -}}
{{- $aplayer := delimit (slice $aplayer_css $aplayer_js) "" -}}
{{- $aplayer | safeHTML -}}
{{- /* MetingJS https://github.com/metowolf/MetingJS */ -}}
{{- $meting := "" -}}
{{- if eq (getenv "HUGO_ENV") "production" | and .Site.Params.cdn.meting_js -}}
{{- $meting = .Site.Params.cdn.meting_js -}}
{{- else -}}
{{- $res := resources.Get "js/lib/meting/Meting.min.js" -}}
{{- $meting = printf "
<script
src=
\"%s\"
></script>
" $res.RelPermalink -}}
{{- end -}}
{{- $meting | safeHTML -}}
{{- end -}}
{{- with .Scratch.Get "typeitMap" -}}
{{- $typeit | safeHTML -}}
{{- $typeitArr := slice -}}
{{- range $key, $val := . -}}
{{- $typeitArr = $typeitArr | append (slice $val) -}}
{{- /* jQuery.countdown https://github.com/hilios/jQuery.countdown */ -}}
{{- with .Scratch.Get "countdownMap" -}}
{{- $countdown := "" -}}
{{- if eq (getenv "HUGO_ENV") "production" | and .Site.Params.cdn.jquery_countdown_js -}}
{{- $countdown = .Site.Params.cdn.jquery_countdown_js -}}
{{- else -}}
{{- $res := resources.Get "js/lib/jquery-countdown/jquery.countdown.min.js" -}}
{{- $countdown = printf "
<script
src=
\"%s\"
></script>
" $res.RelPermalink -}}
{{- end -}}
{{- $countdown | safeHTML -}}
<script>
{{
-
printf
"
window.
typeitArr=%s;
"
(
jsonify
$typeitArr
)
|
safeJS
-
}}
{{
-
printf
"
window.
countdownMap=%s;
"
(
jsonify
.
)
|
safeJS
-
}}
</script>
{{- end -}}
{{- $res := resources.Get "/js/blog.js" | minify -}}
<script
src=
"{{ $res.RelPermalink }}"
></script>
{{- /* dev feature */ -}}
{{- if .Params.dev -}}
{{- /* ECharts https://github.com/apache/incubator-echarts */ -}}
{{- with .Scratch.Get "echartsMap" -}}
{{- $echarts_js := "" -}}
{{- if eq (getenv "HUGO_ENV") "production" | and .Site.Params.cdn.echarts_js -}}
{{- $echarts_js = .Site.Params.cdn.echarts_js -}}
{{- else -}}
{{- $res := resources.Get "js/lib/echarts/echarts.min.js" -}}
{{- $echarts_js = printf "
<script
src=
\"%s\"
></script>
" $res.RelPermalink -}}
{{- end -}}
{{- $echarts_macarons_js := "" -}}
{{- if eq (getenv "HUGO_ENV") "production" | and .Site.Params.cdn.echarts_macarons_js -}}
{{- $echarts_macarons_js = .Site.Params.cdn.echarts_macarons_js -}}
{{- else -}}
{{- $res := resources.Get "js/lib/echarts/macarons.js" | minify -}}
{{- $echarts_macarons_js = printf "
<script
src=
\"%s\"
></script>
" $res.RelPermalink -}}
{{- end -}}
{{- $echarts := delimit (slice $echarts_js $echarts_macarons_js) "" -}}
{{- $echarts | safeHTML -}}
<script>
window
.
echartsMap
=
{
{{
-
range
$key
,
$var
:
=
.
-
}}
{{
-
$key
}}:
{{
$var
|
safeJS
-
}},
{{
-
end
-
}}
};
window
.
echartsArr
=
[];
</script>
{{- end -}}
{{- end -}}
{{- if eq (getenv "HUGO_ENV") "production" | and .Site.GoogleAnalytics -}}
{{- template "_internal/google_analytics_async.html" . -}}
{{- end -}}
\ No newline at end of file
{{- /* Blog script */ -}}
{{- $res := resources.Get "/js/blog.js" | minify -}}
<script
src=
"{{ $res.RelPermalink }}"
></script>
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录