diff options
author | Dillon <dillonzq@outlook.com> | 2020-02-24 12:53:08 +0300 |
---|---|---|
committer | Dillon <dillonzq@outlook.com> | 2020-02-24 12:53:08 +0300 |
commit | ef88651fe4faaa4e94683c822646a6b98667fe1b (patch) | |
tree | 325e442720a4627caced65e874d9fcf1a672e093 /layouts | |
parent | 72a2e9bdcfee2daba6503cd473609d5ea34f2b30 (diff) |
chore(lib): refactor libs and update Font Awesome 5.11.2 -> 5.12.1
Diffstat (limited to 'layouts')
-rw-r--r-- | layouts/partials/comment.html | 8 | ||||
-rw-r--r-- | layouts/partials/head/link.html | 26 | ||||
-rw-r--r-- | layouts/partials/script.html | 72 |
3 files changed, 53 insertions, 53 deletions
diff --git a/layouts/partials/comment.html b/layouts/partials/comment.html index 56c087a..cb2970f 100644 --- a/layouts/partials/comment.html +++ b/layouts/partials/comment.html @@ -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) { diff --git a/layouts/partials/head/link.html b/layouts/partials/head/link.html index 8e627f2..c8ff62b 100644 --- a/layouts/partials/head/link.html +++ b/layouts/partials/head/link.html @@ -21,27 +21,27 @@ <link rel="feed" href="{{ .RelPermalink }}" type="application/rss+xml" title="{{ $.Site.Title }}"> {{- end -}} -{{- /* style.min.css */ -}} -{{- $res := resources.Get "css/style.template.scss" -}} -{{- $options := dict "targetPath" "css/style.min.css" -}} -{{- $options = dict "includePaths" (slice "config/css") | merge $options -}} -{{- $options = dict "outputStyle" "compressed" | merge $options -}} -{{- $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/ */ -}} +{{- /* Font Awesome */ -}} {{- with $CDN.fontawesomeFreeCSS -}} {{- . | safeHTML -}} {{- else -}} - {{- $res := resources.Get "css/lib/fontawesome-free/all.min.css" -}} + {{- $res := resources.Get "lib/fontawesome-free/all.min.css" -}} <link rel="stylesheet" href="{{ $res.RelPermalink }}"> {{- end -}} -{{- /* Animate.css https://github.com/daneden/animate.css */ -}} +{{- /* Animate.css */ -}} {{- with $CDN.animateCSS -}} {{- . | safeHTML -}} {{- else -}} - {{ $res := resources.Get "css/lib/animate/animate.min.css" -}} + {{ $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" -}} +{{- $options = dict "includePaths" (slice "config/css") | merge $options -}} +{{- $options = dict "outputStyle" "compressed" | merge $options -}} +{{- $options = dict "enableSourceMap" true | merge $options -}} +{{- $res = resources.ExecuteAsTemplate "style.scss" . $res | toCSS $options -}} +<link rel="stylesheet" href="{{ $res.RelPermalink }}"> diff --git a/layouts/partials/script.html b/layouts/partials/script.html index b74b3ec..c3b78ec 100644 --- a/layouts/partials/script.html +++ b/layouts/partials/script.html @@ -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 = { |