Skip to content

Commit

Permalink
fix: build error
Browse files Browse the repository at this point in the history
  • Loading branch information
reuixiy committed Jul 2, 2022
1 parent a6111f9 commit 74ea4db
Show file tree
Hide file tree
Showing 17 changed files with 56 additions and 54 deletions.
2 changes: 1 addition & 1 deletion assets/js/copy.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{{ $src := partial "utils/lib.html" (dict "type" "clipboard") }}
{{ $src := partial "utils/lib.html" (dict "$" . "type" "clipboard") }}

// Copy Button for Code Blocks

Expand Down
16 changes: 8 additions & 8 deletions config-examples/en/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -1429,18 +1429,18 @@ uglyURLs = false
clipboard = "/npm/clipboard-polyfill@2.8.6/dist/clipboard-polyfill.min.js"
instantsearch = "/npm/instantsearch.js@2/dist/instantsearch.min.js"
gitalk = "/npm/gitalk@1/dist/gitalk.min.js"
gitalk-css = "/npm/gitalk@1/dist/gitalk.css"
gitalk_css = "/npm/gitalk@1/dist/gitalk.css"
instantpage = "/npm/instant.page@5.1.0/instantpage.min.js"
katex = "/npm/katex@0.13.0/dist/katex.min.js"
katex-css = "/npm/katex@0.13.0/dist/katex.min.css"
katex-mhchem = "/npm/katex@0.13.0/dist/contrib/mhchem.min.js"
katex-auto-render = "/npm/katex@0.13.0/dist/contrib/auto-render.min.js"
katex_css = "/npm/katex@0.13.0/dist/katex.min.css"
katex_mhchem = "/npm/katex@0.13.0/dist/contrib/mhchem.min.js"
katex_auto_render = "/npm/katex@0.13.0/dist/contrib/auto-render.min.js"
lunr = "/npm/lunr@2.3.9/lunr.min.js"
lunr-tinyseg = "/npm/lunr-languages@1.4.0/tinyseg.js"
lunr-stemmer = "/npm/lunr-languages@1.4.0/min/lunr.stemmer.support.min.js"
lunr-lang = "/npm/lunr-languages@1.4.0/min/lunr.de.min.js"
lunr_tinyseg = "/npm/lunr-languages@1.4.0/tinyseg.js"
lunr_stemmer = "/npm/lunr-languages@1.4.0/min/lunr.stemmer.support.min.js"
lunr_lang = "/npm/lunr-languages@1.4.0/min/lunr.de.min.js"
mathjax = "/npm/mathjax@3.1.2/es5/tex-mml-chtml.js"
medium-zoom = "/npm/medium-zoom@latest/dist/medium-zoom.min.js"
medium_zoom = "/npm/medium-zoom@latest/dist/medium-zoom.min.js"
mermaid = "/npm/mermaid@8.8.3/dist/mermaid.min.js"
qrcode = "/npm/qrcode-generator@1.4.4/qrcode.min.js"
valine = "/npm/valine@1.4.14/dist/Valine.min.js"
Expand Down
16 changes: 8 additions & 8 deletions config-examples/zh-cn/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -1396,18 +1396,18 @@ uglyURLs = false
clipboard = "/npm/clipboard-polyfill@2.8.6/dist/clipboard-polyfill.min.js"
instantsearch = "/npm/instantsearch.js@2/dist/instantsearch.min.js"
gitalk = "/npm/gitalk@1/dist/gitalk.min.js"
gitalk-css = "/npm/gitalk@1/dist/gitalk.css"
gitalk_css = "/npm/gitalk@1/dist/gitalk.css"
instantpage = "/npm/instant.page@5.1.0/instantpage.min.js"
katex = "/npm/katex@0.13.0/dist/katex.min.js"
katex-css = "/npm/katex@0.13.0/dist/katex.min.css"
katex-mhchem = "/npm/katex@0.13.0/dist/contrib/mhchem.min.js"
katex-auto-render = "/npm/katex@0.13.0/dist/contrib/auto-render.min.js"
katex_css = "/npm/katex@0.13.0/dist/katex.min.css"
katex_mhchem = "/npm/katex@0.13.0/dist/contrib/mhchem.min.js"
katex_auto_render = "/npm/katex@0.13.0/dist/contrib/auto-render.min.js"
lunr = "/npm/lunr@2.3.9/lunr.min.js"
lunr-tinyseg = "/npm/lunr-languages@1.4.0/tinyseg.js"
lunr-stemmer = "/npm/lunr-languages@1.4.0/min/lunr.stemmer.support.min.js"
lunr-lang = "/npm/lunr-languages@1.4.0/min/lunr.de.min.js"
lunr_tinyseg = "/npm/lunr-languages@1.4.0/tinyseg.js"
lunr_stemmer = "/npm/lunr-languages@1.4.0/min/lunr.stemmer.support.min.js"
lunr_lang = "/npm/lunr-languages@1.4.0/min/lunr.de.min.js"
mathjax = "/npm/mathjax@3.1.2/es5/tex-mml-chtml.js"
medium-zoom = "/npm/medium-zoom@latest/dist/medium-zoom.min.js"
medium_zoom = "/npm/medium-zoom@latest/dist/medium-zoom.min.js"
mermaid = "/npm/mermaid@8.8.3/dist/mermaid.min.js"
qrcode = "/npm/qrcode-generator@1.4.4/qrcode.min.js"
valine = "/npm/valine@1.4.14/dist/Valine.min.js"
Expand Down
16 changes: 8 additions & 8 deletions config-examples/zh-tw/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -1396,18 +1396,18 @@ uglyURLs = false
clipboard = "/npm/clipboard-polyfill@2.8.6/dist/clipboard-polyfill.min.js"
instantsearch = "/npm/instantsearch.js@2/dist/instantsearch.min.js"
gitalk = "/npm/gitalk@1/dist/gitalk.min.js"
gitalk-css = "/npm/gitalk@1/dist/gitalk.css"
gitalk_css = "/npm/gitalk@1/dist/gitalk.css"
instantpage = "/npm/instant.page@5.1.0/instantpage.min.js"
katex = "/npm/katex@0.13.0/dist/katex.min.js"
katex-css = "/npm/katex@0.13.0/dist/katex.min.css"
katex-mhchem = "/npm/katex@0.13.0/dist/contrib/mhchem.min.js"
katex-auto-render = "/npm/katex@0.13.0/dist/contrib/auto-render.min.js"
katex_css = "/npm/katex@0.13.0/dist/katex.min.css"
katex_mhchem = "/npm/katex@0.13.0/dist/contrib/mhchem.min.js"
katex_auto_render = "/npm/katex@0.13.0/dist/contrib/auto-render.min.js"
lunr = "/npm/lunr@2.3.9/lunr.min.js"
lunr-tinyseg = "/npm/lunr-languages@1.4.0/tinyseg.js"
lunr-stemmer = "/npm/lunr-languages@1.4.0/min/lunr.stemmer.support.min.js"
lunr-lang = "/npm/lunr-languages@1.4.0/min/lunr.de.min.js"
lunr_tinyseg = "/npm/lunr-languages@1.4.0/tinyseg.js"
lunr_stemmer = "/npm/lunr-languages@1.4.0/min/lunr.stemmer.support.min.js"
lunr_lang = "/npm/lunr-languages@1.4.0/min/lunr.de.min.js"
mathjax = "/npm/mathjax@3.1.2/es5/tex-mml-chtml.js"
medium-zoom = "/npm/medium-zoom@latest/dist/medium-zoom.min.js"
medium_zoom = "/npm/medium-zoom@latest/dist/medium-zoom.min.js"
mermaid = "/npm/mermaid@8.8.3/dist/mermaid.min.js"
qrcode = "/npm/qrcode-generator@1.4.4/qrcode.min.js"
valine = "/npm/valine@1.4.14/dist/Valine.min.js"
Expand Down
2 changes: 1 addition & 1 deletion layouts/partials/third-party/algolia-search.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{{- $src := partial "utils/lib.html" (dict "type" "instantsearch") -}}
{{- $src := partial "utils/lib.html" (dict "$" . "type" "instantsearch") -}}

{{- $scripts := slice $src -}}
{{- $scripts = union $scripts (slice "js/algolia-search.js") -}}
Expand Down
2 changes: 1 addition & 1 deletion layouts/partials/third-party/busuanzi.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{{- $src := partial "utils/lib.html" (dict "type" "busuanzi") -}}
{{- $src := partial "utils/lib.html" (dict "$" . "type" "busuanzi") -}}

{{ if or .Site.Params.displayBusuanziPagePV .Site.Params.displayBusuanziSiteUVAndPV }}
{{ if eq hugo.Environment "production" }}
Expand Down
4 changes: 2 additions & 2 deletions layouts/partials/third-party/gitalk.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{{- $src := partial "utils/lib.html" (dict "type" "gitalk") -}}
{{- $srcCSS := partial "utils/lib.html" (dict "type" "gitalk-css") -}}
{{- $src := partial "utils/lib.html" (dict "$" . "type" "gitalk") -}}
{{- $srcCSS := partial "utils/lib.html" (dict "$" . "type" "gitalk-css") -}}

<link rel="stylesheet" href="{{ $srcCSS }}">
<script>
Expand Down
2 changes: 1 addition & 1 deletion layouts/partials/third-party/instant-page.html
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{{- $src := partial "utils/lib.html" (dict "type" "instantpage") -}}
{{- $src := partial "utils/lib.html" (dict "$" . "type" "instantpage") -}}

<script src="{{ $src }}" type="module" defer></script>
8 changes: 4 additions & 4 deletions layouts/partials/third-party/katex.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{{- $src := partial "utils/lib.html" (dict "type" "katex") -}}
{{- $srcCSS := partial "utils/lib.html" (dict "type" "katex-css") -}}
{{- $srcMhchem := partial "utils/lib.html" (dict "type" "katex-mhchem") -}}
{{- $srcAutoRender := partial "utils/lib.html" (dict "type" "katex-auto-render") -}}
{{- $src := partial "utils/lib.html" (dict "$" . "type" "katex") -}}
{{- $srcCSS := partial "utils/lib.html" (dict "$" . "type" "katex-css") -}}
{{- $srcMhchem := partial "utils/lib.html" (dict "$" . "type" "katex-mhchem") -}}
{{- $srcAutoRender := partial "utils/lib.html" (dict "$" . "type" "katex-auto-render") -}}

<link rel="stylesheet" href="{{ $srcCSS }}">
<script>
Expand Down
8 changes: 4 additions & 4 deletions layouts/partials/third-party/lunr-search.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{{- $src := partial "utils/lib.html" (dict "type" "lunr") -}}
{{- $srcTinyseg := partial "utils/lib.html" (dict "type" "lunr-tinyseg") -}}
{{- $srcStemmer := partial "utils/lib.html" (dict "type" "lunr-stemmer") -}}
{{- $srcLang := partial "utils/lib.html" (dict "type" "lunr-lang" "lang" .Site.Language.Lang) -}}
{{- $src := partial "utils/lib.html" (dict "$" . "type" "lunr") -}}
{{- $srcTinyseg := partial "utils/lib.html" (dict "$" . "type" "lunr-tinyseg") -}}
{{- $srcStemmer := partial "utils/lib.html" (dict "$" . "type" "lunr-stemmer") -}}
{{- $srcLang := partial "utils/lib.html" (dict "$" . "type" "lunr-lang" "lang" .Site.Language.Lang) -}}

{{- $scripts := slice $src -}}
{{- if ne .Site.Language.Lang "en" -}}
Expand Down
2 changes: 1 addition & 1 deletion layouts/partials/third-party/mathjax.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{{- $src := partial "utils/lib.html" (dict "type" "mathjax") -}}
{{- $src := partial "utils/lib.html" (dict "$" . "type" "mathjax") -}}

<script>
if (typeof MathJax === 'undefined') {
Expand Down
2 changes: 1 addition & 1 deletion layouts/partials/third-party/medium-zoom.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{{- $src := partial "utils/lib.html" (dict "type" "medium-zoom") -}}
{{- $src := partial "utils/lib.html" (dict "$" . "type" "medium-zoom") -}}

<script src="{{ $src }}"></script>

Expand Down
2 changes: 1 addition & 1 deletion layouts/partials/third-party/mermaid.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{{- $src := partial "utils/lib.html" (dict "type" "mermaid") -}}
{{- $src := partial "utils/lib.html" (dict "$" . "type" "mermaid") -}}

<script src="{{ $src }}"></script>
<script>
Expand Down
2 changes: 1 addition & 1 deletion layouts/partials/third-party/qrcode-generator.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{{- $src := partial "utils/lib.html" (dict "type" "qrcode") -}}
{{- $src := partial "utils/lib.html" (dict "$" . "type" "qrcode") -}}

<script src="{{ $src }}"></script>

Expand Down
2 changes: 1 addition & 1 deletion layouts/partials/third-party/utterances.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{{- $src := partial "utils/lib.html" (dict "type" "utterances") -}}
{{- $src := partial "utils/lib.html" (dict "$" . "type" "utterances") -}}

<script>
function loadComments() {
Expand Down
2 changes: 1 addition & 1 deletion layouts/partials/third-party/valine.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{{- $src := partial "utils/lib.html" (dict "type" "valine") -}}
{{- $src := partial "utils/lib.html" (dict "$" . "type" "valine") -}}

<script>
function loadComments() {
Expand Down
22 changes: 12 additions & 10 deletions layouts/partials/utils/lib.html
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
{{- $host := $.Site.Params.lib.host | default "https://cdn.jsdelivr.net" -}}
{{- $path := "" -}}
{{- $ := index . "$" -}}
{{- $type := .type -}}
{{- $lang := .lang -}}

{{- $host := $.Site.Params.lib.host | default "https://cdn.jsdelivr.net" -}}
{{- $path := "" -}}

<!--
Common libraries
Expand All @@ -25,7 +27,7 @@
{{- end -}}
{{- if eq $type "gitalk-css" -}}
{{- $dafault := "/npm/gitalk@1/dist/gitalk.css" -}}
{{- $path = $.Site.Params.lib.path.gitalk-css | default $dafault -}}
{{- $path = $.Site.Params.lib.path.gitalk_css | default $dafault -}}
{{- end -}}

{{- if eq $type "instantpage" -}}
Expand All @@ -39,15 +41,15 @@
{{- end -}}
{{- if eq $type "katex-css" -}}
{{- $defalut := "/npm/katex@0.13.0/dist/katex.min.css" -}}
{{- $path = $.Site.Params.lib.path.katex-css | default $defalut -}}
{{- $path = $.Site.Params.lib.path.katex_css | default $defalut -}}
{{- end -}}
{{- if eq $type "katex-mhchem" -}}
{{- $defalut := "/npm/katex@0.13.0/dist/contrib/mhchem.min.js" -}}
{{- $path = $.Site.Params.lib.path.katex-mhchem | default $defalut -}}
{{- $path = $.Site.Params.lib.path.katex_mhchem | default $defalut -}}
{{- end -}}
{{- if eq $type "katex-auto-render" -}}
{{- $defalut := "/npm/katex@0.13.0/dist/contrib/auto-render.min.js" -}}
{{- $path = $.Site.Params.lib.path.katex-auto-render | default $defalut -}}
{{- $path = $.Site.Params.lib.path.katex_auto_render | default $defalut -}}
{{- end -}}

{{- if eq $type "lunr" -}}
Expand All @@ -56,15 +58,15 @@
{{- end -}}
{{- if eq $type "lunr-tinyseg" -}}
{{- $defalut := "/npm/lunr-languages@1.4.0/tinyseg.js" -}}
{{- $path = $.Site.Params.lib.path.lunr-tinyseg | default $defalut -}}
{{- $path = $.Site.Params.lib.path.lunr_tinyseg | default $defalut -}}
{{- end -}}
{{- if eq $type "lunr-stemmer" -}}
{{- $defalut := "/npm/lunr-languages@1.4.0/min/lunr.stemmer.support.min.js" -}}
{{- $path = $.Site.Params.lib.path.lunr-stemmer | default $defalut -}}
{{- $path = $.Site.Params.lib.path.lunr_stemmer | default $defalut -}}
{{- end -}}
{{- if eq $type "lunr-lang" -}}
{{- $defalut := printf "/npm/lunr-languages@1.4.0/min/lunr.%s.min.js" $lang -}}
{{- $path = $.Site.Params.lib.path.lunr-lang | default $defalut -}}
{{- $path = $.Site.Params.lib.path.lunr_lang | default $defalut -}}
{{- end -}}

{{- if eq $type "mathjax" -}}
Expand All @@ -74,7 +76,7 @@

{{- if eq $type "medium-zoom" -}}
{{- $defalut := "/npm/medium-zoom@latest/dist/medium-zoom.min.js" -}}
{{- $path = $.Site.Params.lib.path.medium-zoom | default $defalut -}}
{{- $path = $.Site.Params.lib.path.medium_zoom | default $defalut -}}
{{- end -}}

{{- if eq $type "mermaid" -}}
Expand Down

0 comments on commit 74ea4db

Please sign in to comment.