chore(lib): refactor libs and update Font Awesome 5.11.2 -> 5.12.1

This commit is contained in:
Dillon 2020-02-24 17:53:08 +08:00
parent 72a2e9bdcf
commit ef88651fe4
164 changed files with 369 additions and 255 deletions

View file

@ -1,9 +0,0 @@
fontawesome-free@5.11.2
forkawesome@1.1.7
gittalk@1.5.0
katex@0.11.1
aplayer@1.10.1
animate.css@3.7.2
mermaid@8.4.2
valine@1.3.10
lightgallery@1.1.3

File diff suppressed because one or more lines are too long

View file

@ -3,9 +3,9 @@
margin: 3% auto;
text-align: center;
@import "lib/mermaid/neutral/index";
@import "../lib/mermaid/neutral/index";
.dark-theme & {
@import "lib/mermaid/dark/index";
@import "../lib/mermaid/dark/index";
}
}

View file

@ -1,12 +0,0 @@
gitalk@1.5.0
valine@1.3.10
lazysizes@5.2.0
katex@0.11.1
mermaid@8.4.2
echarts@4.5.0
typeit@6.5.1
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

16
assets/lib/VERSION Normal file
View file

@ -0,0 +1,16 @@
fontawesome-free@5.12.1 https://fontawesome.com/
forkawesome@1.1.7 https://forkaweso.me/Fork-Awesome/
animate.css@3.7.2 https://github.com/daneden/animate.css
smooth-scroll@16.1.2 https://github.com/cferdinandi/smooth-scroll
sharer@0.4.0 https://github.com/ellisonleao/sharer.js
lazysizes@5.2.0 https://github.com/aFarkas/lazysizes
lightgallery@1.1.3 lg-thumbnail@1.1.0 lg-zoom@1.1.0 https://github.com/sachinchoolur/lightgallery.js
typeit@6.5.1 https://github.com/alexmacarthur/typeit
katex@0.11.1 https://github.com/KaTeX/KaTeX
mermaid@8.4.2 https://github.com/knsv/mermaid
aplayer@1.10.1 https://github.com/MoePlayer/APlayer
meting@2.0.1 https://github.com/metowolf/MetingJS
echarts@4.5.0 https://github.com/apache/incubator-echarts
gitalk@1.5.0 https://github.com/gitalk/gitalk
valine@1.3.10 https://valine.js.org/
iconfont https://www.iconfont.cn/

File diff suppressed because one or more lines are too long

View file

@ -515,34 +515,46 @@ enableEmoji = true
# 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">'
# fontawesome-free@5.12.1 https://fontawesome.com/
fontawesomeFreeCSS = ''
# animate.css@3.7.2 https://github.com/daneden/animate.css
animateCSS = ''
gitalkCSS = ''
gitalkJS = ''
valineJS = ''
# smooth-scroll@16.1.2 https://github.com/cferdinandi/smooth-scroll
smoothScrollJS = ''
# sharer@0.4.0 https://github.com/ellisonleao/sharer.js
sharerJS = ''
# lazysizes@5.2.0 https://github.com/aFarkas/lazysizes
lazysizesJS = ''
lazysizesNativeLoadingJS = ''
# lightgallery@1.1.3 lg-thumbnail@1.1.0 lg-zoom@1.1.0 https://github.com/sachinchoolur/lightgallery.js
lightgalleryCSS = ''
lightgalleryJS = ''
lightgalleryThumbnailJS = ''
lightgalleryZoomJS = ''
smoothScrollJS = ''
sharerJS = ''
# typeit@6.5.1 https://github.com/alexmacarthur/typeit
typeitJS = ''
# katex@0.11.1 https://github.com/KaTeX/KaTeX
katexCSS = ''
katexJS = ''
katexAutoRenderJS = ''
katexCopyTexCSS = ''
katexCopyTexJS = ''
katexMhchemJS = ''
# mermaid@8.4.2 https://github.com/knsv/mermaid
mermaidJS = ''
echartsJS = ''
echartsMacaronsJS = ''
typeitJS = ''
# aplayer@1.10.1 https://github.com/MoePlayer/APlayer
aplayerCSS = ''
aplayerJS = ''
# meting@2.0.1 https://github.com/metowolf/MetingJS
metingJS = ''
# echarts@4.5.0 https://github.com/apache/incubator-echarts
echartsJS = ''
echartsMacaronsJS = ''
# gitalk@1.5.0 https://github.com/gitalk/gitalk
gitalkCSS = ''
gitalkJS = ''
# valine@1.3.10 https://valine.js.org/
valineJS = ''
# Markup related configuration in Hugo
# Hugo 解析文档的配置

View file

@ -20,12 +20,12 @@
{{- with $CDN.gitalkCSS -}}
{{- slice . | $scratch.Add "linkCDN" -}}
{{- else -}}
{{- slice "css/lib/gitalk/gitalk.css" | $scratch.Add "linkLocal" -}}
{{- slice "lib/gitalk/gitalk.css" | $scratch.Add "linkLocal" -}}
{{- end -}}
{{- with $CDN.gitalkJS -}}
{{- slice . | $scratch.Add "scriptCDN" -}}
{{- else -}}
{{- slice "css/lib/gitalk/gitalk.min.js" | $scratch.Add "scriptLocal" -}}
{{- slice "lib/gitalk/gitalk.min.js" | $scratch.Add "scriptLocal" -}}
{{- end -}}
<script>
document.addEventListener("DOMContentLoaded", function(event) {
@ -51,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 "lib/valine/dark.scss" | $scratch.Add "linkLocal" -}}
{{- with $CDN.valineJS -}}
{{- slice . | $scratch.Add "scriptCDN" -}}
{{- else -}}
{{- slice "js/lib/valine/Valine.min.js" | $scratch.Add "scriptLocal" -}}
{{- slice "lib/valine/Valine.min.js" | $scratch.Add "scriptLocal" -}}
{{- end -}}
<script>
document.addEventListener("DOMContentLoaded", function(event) {

View file

@ -21,6 +21,22 @@
<link rel="feed" href="{{ .RelPermalink }}" type="application/rss+xml" title="{{ $.Site.Title }}">
{{- end -}}
{{- /* Font Awesome */ -}}
{{- with $CDN.fontawesomeFreeCSS -}}
{{- . | safeHTML -}}
{{- else -}}
{{- $res := resources.Get "lib/fontawesome-free/all.min.css" -}}
<link rel="stylesheet" href="{{ $res.RelPermalink }}">
{{- end -}}
{{- /* Animate.css */ -}}
{{- with $CDN.animateCSS -}}
{{- . | safeHTML -}}
{{- else -}}
{{ $res := resources.Get "lib/animate/animate.min.css" -}}
<link rel="stylesheet" href="{{ $res.RelPermalink }}">
{{- end -}}
{{- /* style.min.css */ -}}
{{- $res := resources.Get "css/style.template.scss" -}}
{{- $options := dict "targetPath" "css/style.min.css" -}}
@ -29,19 +45,3 @@
{{- $options = dict "enableSourceMap" true | merge $options -}}
{{- $res = resources.ExecuteAsTemplate "style.scss" . $res | toCSS $options -}}
<link rel="stylesheet" href="{{ $res.RelPermalink }}">
{{- /* Font Awesome https://fontawesome.com/ */ -}}
{{- with $CDN.fontawesomeFreeCSS -}}
{{- . | safeHTML -}}
{{- else -}}
{{- $res := resources.Get "css/lib/fontawesome-free/all.min.css" -}}
<link rel="stylesheet" href="{{ $res.RelPermalink }}">
{{- end -}}
{{- /* Animate.css https://github.com/daneden/animate.css */ -}}
{{- with $CDN.animateCSS -}}
{{- . | safeHTML -}}
{{- else -}}
{{ $res := resources.Get "css/lib/animate/animate.min.css" -}}
<link rel="stylesheet" href="{{ $res.RelPermalink }}">
{{- end -}}

View file

@ -1,67 +1,67 @@
{{- $scratch := .Scratch.Get "scratch" -}}
{{- $CDN := $scratch.Get "CDN" -}}
{{- /* Fork Awesome https://forkaweso.me/ */ -}}
{{- /* Fork Awesome */ -}}
{{- if $scratch.Get "forkawesome" -}}
{{- slice "css/lib/forkawesome/fork-awesome.scss" | $scratch.Add "linkLocal" -}}
{{- slice "lib/forkawesome/fork-awesome.scss" | $scratch.Add "linkLocal" -}}
{{- end -}}
{{- /* iconfont https://www.iconfont.cn/ */ -}}
{{- /* iconfont */ -}}
{{- if $scratch.Get "iconfont" -}}
{{- slice "css/lib/iconfont/iconfont.css" | $scratch.Add "linkLocal" -}}
{{- slice "lib/iconfont/iconfont.css" | $scratch.Add "linkLocal" -}}
{{- end -}}
{{- /* Smooth Scroll https://github.com/cferdinandi/smooth-scroll */ -}}
{{- /* Smooth Scroll */ -}}
{{- with $CDN.smoothScrollJS -}}
{{- slice . | $scratch.Add "scriptCDN" -}}
{{- else -}}
{{- slice "js/lib/smooth-scroll/smooth-scroll.polyfills.min.js" | $scratch.Add "scriptLocal" -}}
{{- slice "lib/smooth-scroll/smooth-scroll.polyfills.min.js" | $scratch.Add "scriptLocal" -}}
{{- end -}}
{{- /* Sharer.js https://github.com/ellisonleao/sharer.js */ -}}
{{- /* Sharer.js */ -}}
{{- if $scratch.Get "share" -}}
{{- with $CDN.sharerJS -}}
{{- slice . | $scratch.Add "scriptCDN" -}}
{{- else -}}
{{- slice "js/lib/sharer/sharer.min.js" | $scratch.Add "scriptLocal" -}}
{{- slice "lib/sharer/sharer.min.js" | $scratch.Add "scriptLocal" -}}
{{- end -}}
{{- end -}}
{{- /* lazysizes https://github.com/aFarkas/lazysizes */ -}}
{{- /* lazysizes */ -}}
{{- if $scratch.Get "lazysizes" -}}
{{- with $CDN.lazysizesJS -}}
{{- slice . | $scratch.Add "scriptCDN" -}}
{{- else -}}
{{- slice "js/lib/lazysizes/lazysizes.min.js" | $scratch.Add "scriptLocal" -}}
{{- slice "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" -}}
{{- slice "lib/lazysizes/ls.native-loading.min.js" | $scratch.Add "scriptLocal" -}}
{{- end -}}
{{- end -}}
{{- /* lightgallery.js https://github.com/sachinchoolur/lightgallery.js */ -}}
{{- /* lightgallery.js */ -}}
{{- if $scratch.Get "lightgallery" -}}
{{- with $CDN.lightgalleryCSS -}}
{{- slice . | $scratch.Add "linkCDN" -}}
{{- else -}}
{{- slice "css/lib/lightgallery/lightgallery.min.css" | $scratch.Add "linkLocal" -}}
{{- slice "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" -}}
{{- slice "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" -}}
{{- slice "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" -}}
{{- slice "lib/lightgallery/lg-zoom.min.js" | $scratch.Add "scriptLocal" -}}
{{- end -}}
<script>
document.addEventListener('DOMContentLoaded', function () {
@ -78,12 +78,12 @@
</script>
{{- end -}}
{{- /* TypeIt https://github.com/alexmacarthur/typeit */ -}}
{{- /* TypeIt */ -}}
{{- with $scratch.Get "typeitMap" -}}
{{- with $CDN.typeitJS -}}
{{- slice . | $scratch.Add "scriptCDN" -}}
{{- else -}}
{{- slice "js/lib/typeit/typeit.min.js" | $scratch.Add "scriptLocal" -}}
{{- slice "lib/typeit/typeit.min.js" | $scratch.Add "scriptLocal" -}}
{{- end -}}
{{- range $key, $val := . -}}
{{- slice $val | $scratch.Add "typeitArr" -}}
@ -93,41 +93,41 @@
</script>
{{- end -}}
{{- /* KaTeX https://github.com/KaTeX/KaTeX */ -}}
{{- /* KaTeX */ -}}
{{- if ne .Site.Params.math.enable false | and .Params.math -}}
{{- with $CDN.katexCSS -}}
{{- slice . | $scratch.Add "linkCDN" -}}
{{- else -}}
{{- slice "css/lib/katex/katex.min.css" | $scratch.Add "linkLocal" -}}
{{- slice "lib/katex/katex.min.css" | $scratch.Add "linkLocal" -}}
{{- end -}}
{{- with $CDN.katexJS -}}
{{- slice . | $scratch.Add "scriptCDN" -}}
{{- else -}}
{{- slice "js/lib/katex/katex.min.js" | $scratch.Add "scriptLocal" -}}
{{- slice "lib/katex/katex.min.js" | $scratch.Add "scriptLocal" -}}
{{- end -}}
{{- with $CDN.katexAutoRenderJS -}}
{{- slice . | $scratch.Add "scriptCDN" -}}
{{- else -}}
{{- slice "js/lib/katex/auto-render.min.js" | $scratch.Add "scriptLocal" -}}
{{- slice "lib/katex/auto-render.min.js" | $scratch.Add "scriptLocal" -}}
{{- end -}}
{{- $math := .Site.Params.math -}}
{{- if $math.copyTex -}}
{{- with $CDN.katexCopyTexCSS -}}
{{- slice . | $scratch.Add "linkCDN" -}}
{{- else -}}
{{- slice "css/lib/katex/copy-tex.min.css" | $scratch.Add "linkLocal" -}}
{{- slice "lib/katex/copy-tex.min.css" | $scratch.Add "linkLocal" -}}
{{- end -}}
{{- with $CDN.katexCopyTexJS -}}
{{- slice . | $scratch.Add "scriptCDN" -}}
{{- else -}}
{{- slice "js/lib/katex/copy-tex.min.js" | $scratch.Add "scriptLocal" -}}
{{- slice "lib/katex/copy-tex.min.js" | $scratch.Add "scriptLocal" -}}
{{- end -}}
{{- end -}}
{{- if $math.mhchem -}}
{{- with $CDN.katexMhchemJS -}}
{{- slice . | $scratch.Add "scriptCDN" -}}
{{- else -}}
{{- slice "js/lib/katex/mhchem.min.js" | $scratch.Add "scriptLocal" -}}
{{- slice "lib/katex/mhchem.min.js" | $scratch.Add "scriptLocal" -}}
{{- end -}}
{{- end -}}
<script>
@ -150,12 +150,12 @@
</script>
{{- end -}}
{{- /* mermaid https://github.com/knsv/mermaid */ -}}
{{- /* mermaid */ -}}
{{- with $scratch.Get "mermaidMap" -}}
{{- with $CDN.mermaidJS -}}
{{- slice . | $scratch.Add "scriptCDN" -}}
{{- else -}}
{{- slice "js/lib/mermaid/mermaid.min.js" | $scratch.Add "scriptLocal" -}}
{{- slice "lib/mermaid/mermaid.min.js" | $scratch.Add "scriptLocal" -}}
{{- end -}}
{{- slice "css/mermaid.scss" | $scratch.Add "linkLocal" -}}
<script>
@ -165,40 +165,40 @@
{{- /* Music */ -}}
{{- if $scratch.Get "music" -}}
{{- /* APlayer https://github.com/MoePlayer/APlayer */ -}}
{{- /* APlayer */ -}}
{{- with $CDN.aplayerCSS -}}
{{- slice . | $scratch.Add "linkCDN" -}}
{{- else -}}
{{- slice "css/lib/aplayer/APlayer.min.css" | $scratch.Add "linkLocal" -}}
{{- slice "lib/aplayer/APlayer.min.css" | $scratch.Add "linkLocal" -}}
{{- end -}}
{{- slice "css/lib/aplayer/dark.scss" | $scratch.Add "linkLocal" -}}
{{- slice "lib/aplayer/dark.scss" | $scratch.Add "linkLocal" -}}
{{- with $CDN.aplayerJS -}}
{{- slice . | $scratch.Add "scriptCDN" -}}
{{- else -}}
{{- slice "js/lib/aplayer/APlayer.min.js" | $scratch.Add "scriptLocal" -}}
{{- slice "lib/aplayer/APlayer.min.js" | $scratch.Add "scriptLocal" -}}
{{- end -}}
{{- /* MetingJS https://github.com/metowolf/MetingJS */ -}}
{{- /* MetingJS */ -}}
{{- with $CDN.metingJS -}}
{{- slice . | $scratch.Add "scriptCDN" -}}
{{- else -}}
{{- slice "js/lib/meting/Meting.min.js" | $scratch.Add "scriptLocal" -}}
{{- slice "lib/meting/Meting.min.js" | $scratch.Add "scriptLocal" -}}
{{- end -}}
{{- end -}}
{{- /* dev feature */ -}}
{{- if .Params.dev -}}
{{- /* ECharts https://github.com/apache/incubator-echarts */ -}}
{{- /* ECharts */ -}}
{{- with $scratch.Get "echartsMap" -}}
{{- with $CDN.echartsJS -}}
{{- slice . | $scratch.Add "scriptCDN" -}}
{{- else -}}
{{- slice "js/lib/echarts/echarts.min.js" | $scratch.Add "scriptLocal" -}}
{{- slice "lib/echarts/echarts.min.js" | $scratch.Add "scriptLocal" -}}
{{- end -}}
{{- with $CDN.echartsMacaronsJS -}}
{{- slice . | $scratch.Add "scriptCDN" -}}
{{- else -}}
{{- slice "js/lib/echarts/macarons.js" | $scratch.Add "scriptLocal" -}}
{{- slice "lib/echarts/macarons.js" | $scratch.Add "scriptLocal" -}}
{{- end -}}
<script>
window.echartsMap = {

View file

Before

Width:  |  Height:  |  Size: 470 KiB

After

Width:  |  Height:  |  Size: 470 KiB

View file

Before

Width:  |  Height:  |  Size: 8.7 KiB

After

Width:  |  Height:  |  Size: 8.7 KiB

View file

Before

Width:  |  Height:  |  Size: 187 KiB

After

Width:  |  Height:  |  Size: 187 KiB

View file

Before

Width:  |  Height:  |  Size: 3.7 KiB

After

Width:  |  Height:  |  Size: 3.7 KiB

View file

Before

Width:  |  Height:  |  Size: 819 B

After

Width:  |  Height:  |  Size: 819 B

View file

Before

Width:  |  Height:  |  Size: 1.4 KiB

After

Width:  |  Height:  |  Size: 1.4 KiB

View file

Before

Width:  |  Height:  |  Size: 2.6 KiB

After

Width:  |  Height:  |  Size: 2.6 KiB

Some files were not shown because too many files have changed in this diff Show more