Skip to content
This repository was archived by the owner on Mar 9, 2022. It is now read-only.

Commit

Permalink
chore(lib): refactor libs and update Font Awesome 5.11.2 -> 5.12.1
Browse files Browse the repository at this point in the history
  • Loading branch information
dillonzq committed Feb 24, 2020
1 parent 72a2e9b commit ef88651
Show file tree
Hide file tree
Showing 164 changed files with 366 additions and 252 deletions.
9 changes: 0 additions & 9 deletions assets/css/lib/VERSION

This file was deleted.

5 changes: 0 additions & 5 deletions assets/css/lib/fontawesome-free/all.min.css

This file was deleted.

4 changes: 2 additions & 2 deletions assets/css/mermaid.scss
Original file line number Diff line number Diff line change
Expand Up @@ -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";
}
}
12 changes: 0 additions & 12 deletions assets/js/lib/VERSION

This file was deleted.

16 changes: 16 additions & 0 deletions assets/lib/VERSION
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
[email protected] https://fontawesome.com/
[email protected] https://forkaweso.me/Fork-Awesome/
[email protected] https://github.com/daneden/animate.css
[email protected] https://github.com/cferdinandi/smooth-scroll
[email protected] https://github.com/ellisonleao/sharer.js
[email protected] https://github.com/aFarkas/lazysizes
[email protected] [email protected] [email protected] https://github.com/sachinchoolur/lightgallery.js
[email protected] https://github.com/alexmacarthur/typeit
[email protected] https://github.com/KaTeX/KaTeX
[email protected] https://github.com/knsv/mermaid
[email protected] https://github.com/MoePlayer/APlayer
[email protected] https://github.com/metowolf/MetingJS
[email protected] https://github.com/apache/incubator-echarts
[email protected] https://github.com/gitalk/gitalk
[email protected] https://valine.js.org/
iconfont https://www.iconfont.cn/
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
5 changes: 5 additions & 0 deletions assets/lib/fontawesome-free/all.min.css

Large diffs are not rendered by default.

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
32 changes: 22 additions & 10 deletions exampleSite/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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/[email protected]/css/all.min.css" integrity="sha256-fdcFNFiBMrNfWL6OcAGQz6jDgNTRxnrLEd4vJYFWScE=" crossorigin="anonymous">'
## 例如 '<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fortawesome/[email protected]/css/all.min.css" integrity="sha256-fdcFNFiBMrNfWL6OcAGQz6jDgNTRxnrLEd4vJYFWScE=" crossorigin="anonymous">'
# [email protected] https://fontawesome.com/
fontawesomeFreeCSS = ''
# [email protected] https://github.com/daneden/animate.css
animateCSS = ''
gitalkCSS = ''
gitalkJS = ''
valineJS = ''
# [email protected] https://github.com/cferdinandi/smooth-scroll
smoothScrollJS = ''
# [email protected] https://github.com/ellisonleao/sharer.js
sharerJS = ''
# [email protected] https://github.com/aFarkas/lazysizes
lazysizesJS = ''
lazysizesNativeLoadingJS = ''
# [email protected] [email protected] [email protected] https://github.com/sachinchoolur/lightgallery.js
lightgalleryCSS = ''
lightgalleryJS = ''
lightgalleryThumbnailJS = ''
lightgalleryZoomJS = ''
smoothScrollJS = ''
sharerJS = ''
# [email protected] https://github.com/alexmacarthur/typeit
typeitJS = ''
# [email protected] https://github.com/KaTeX/KaTeX
katexCSS = ''
katexJS = ''
katexAutoRenderJS = ''
katexCopyTexCSS = ''
katexCopyTexJS = ''
katexMhchemJS = ''
# [email protected] https://github.com/knsv/mermaid
mermaidJS = ''
echartsJS = ''
echartsMacaronsJS = ''
typeitJS = ''
# [email protected] https://github.com/MoePlayer/APlayer
aplayerCSS = ''
aplayerJS = ''
# [email protected] https://github.com/metowolf/MetingJS
metingJS = ''
# [email protected] https://github.com/apache/incubator-echarts
echartsJS = ''
echartsMacaronsJS = ''
# [email protected] https://github.com/gitalk/gitalk
gitalkCSS = ''
gitalkJS = ''
# [email protected] https://valine.js.org/
valineJS = ''

# Markup related configuration in Hugo
# Hugo 解析文档的配置
Expand Down
8 changes: 4 additions & 4 deletions layouts/partials/comment.html
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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) {
Expand Down
26 changes: 13 additions & 13 deletions layouts/partials/head/link.html
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}">
72 changes: 36 additions & 36 deletions layouts/partials/script.html
Original file line number Diff line number Diff line change
@@ -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 () {
Expand All @@ -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" -}}
Expand All @@ -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>
Expand All @@ -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>
Expand All @@ -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 = {
Expand Down
Binary file removed static/css/lib/webfonts/fa-brands-400.woff
Binary file not shown.
Binary file removed static/css/lib/webfonts/fa-brands-400.woff2
Binary file not shown.
Binary file removed static/css/lib/webfonts/fa-regular-400.woff
Binary file not shown.
Binary file removed static/css/lib/webfonts/fa-regular-400.woff2
Binary file not shown.
Binary file removed static/css/lib/webfonts/fa-solid-900.woff
Binary file not shown.
Binary file removed static/css/lib/webfonts/fa-solid-900.woff2
Binary file not shown.
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
Binary file not shown.
Loading

0 comments on commit ef88651

Please sign in to comment.