2020-04-21 16:55:06 +02:00
|
|
|
{{- $params := .Scratch.Get "params" -}}
|
|
|
|
{{- $cdn := .Scratch.Get "cdn" | default dict -}}
|
|
|
|
{{- $fingerprint := .Scratch.Get "fingerprint" -}}
|
|
|
|
{{- $config := (.Scratch.Get "this").config -}}
|
2020-02-14 14:09:21 +01:00
|
|
|
|
2020-02-24 10:53:08 +01:00
|
|
|
{{- /* Fork Awesome */ -}}
|
2020-04-21 16:55:06 +02:00
|
|
|
{{- if (.Scratch.Get "this").forkawesome -}}
|
2020-04-15 09:46:50 +02:00
|
|
|
{{- $options := dict "targetPath" "lib/forkawesome/fork-awesome.min.css" -}}
|
2020-04-21 16:55:06 +02:00
|
|
|
{{- dict "source" "lib/forkawesome/fork-awesome.scss" "toCSS" $options "fingerprint" $fingerprint | dict "scratch" $.Scratch "data" | partial "scratch/stylesheet.html" -}}
|
2020-02-14 14:09:21 +01:00
|
|
|
{{- end -}}
|
|
|
|
|
2020-02-24 10:53:08 +01:00
|
|
|
{{- /* iconfont */ -}}
|
2020-04-21 16:55:06 +02:00
|
|
|
{{- if (.Scratch.Get "this").iconfont -}}
|
|
|
|
{{- with $cdn.iconfontCSS -}}
|
2020-04-21 19:00:51 +02:00
|
|
|
{{- dict "source" . | dict "scratch" $.Scratch "data" | partial "scratch/stylesheet.html" -}}
|
2020-03-14 17:39:23 +01:00
|
|
|
{{- else -}}
|
2020-04-21 16:55:06 +02:00
|
|
|
{{- dict "source" "lib/iconfont/iconfont.css" "minify" true "fingerprint" $fingerprint | dict "scratch" $.Scratch "data" | partial "scratch/stylesheet.html" -}}
|
2020-03-14 17:39:23 +01:00
|
|
|
{{- end -}}
|
2020-02-17 14:31:53 +01:00
|
|
|
{{- end -}}
|
|
|
|
|
2020-02-24 10:53:08 +01:00
|
|
|
{{- /* Smooth Scroll */ -}}
|
2020-04-21 16:55:06 +02:00
|
|
|
{{- with $cdn.smoothScrollJS -}}
|
2020-04-21 19:00:51 +02:00
|
|
|
{{- dict "source" . | dict "scratch" $.Scratch "data" | partial "scratch/script.html" -}}
|
2020-02-14 14:09:21 +01:00
|
|
|
{{- else -}}
|
2020-04-21 16:55:06 +02:00
|
|
|
{{- dict "source" "lib/smooth-scroll/smooth-scroll.min.js" "fingerprint" $fingerprint | dict "scratch" $.Scratch "data" | partial "scratch/script.html" -}}
|
2020-02-14 14:09:21 +01:00
|
|
|
{{- end -}}
|
|
|
|
|
2020-04-15 09:46:50 +02:00
|
|
|
{{- /* Search */ -}}
|
|
|
|
{{- if .Site.Params.search.enable -}}
|
2020-04-21 16:55:06 +02:00
|
|
|
{{- with $cdn.autocompleteJS -}}
|
2020-04-21 19:00:51 +02:00
|
|
|
{{- dict "source" . | dict "scratch" $.Scratch "data" | partial "scratch/script.html" -}}
|
2020-02-17 19:53:07 +01:00
|
|
|
{{- else -}}
|
2020-04-21 16:55:06 +02:00
|
|
|
{{- dict "source" "lib/autocomplete/autocomplete.min.js" "fingerprint" $fingerprint | dict "scratch" $.Scratch "data" | partial "scratch/script.html" -}}
|
2020-04-15 09:46:50 +02:00
|
|
|
{{- end -}}
|
|
|
|
{{- $searchConfig := dict "noResultsFound" (T "noResultsFound") -}}
|
|
|
|
{{- if eq .Site.Params.search.type "lunr" -}}
|
|
|
|
{{- with .Site.Home.OutputFormats.Get "json" -}}
|
|
|
|
{{- $searchConfig = dict "type" "lunr" "lunrIndexURL" .RelPermalink | merge $searchConfig -}}
|
|
|
|
{{- end -}}
|
2020-04-21 16:55:06 +02:00
|
|
|
{{- with $cdn.lunrJS -}}
|
2020-04-21 19:00:51 +02:00
|
|
|
{{- dict "source" . | dict "scratch" $.Scratch "data" | partial "scratch/script.html" -}}
|
2020-04-15 09:46:50 +02:00
|
|
|
{{- else -}}
|
2020-04-21 16:55:06 +02:00
|
|
|
{{- dict "source" "lib/lunr/lunr.min.js" "fingerprint" $fingerprint | dict "scratch" $.Scratch "data" | partial "scratch/script.html" -}}
|
2020-04-15 09:46:50 +02:00
|
|
|
{{- end -}}
|
|
|
|
{{- if ne .Language.Lang "en" -}}
|
|
|
|
{{- $searchConfig = T "lunrLanguageCode" | dict "lunrLanguageCode" | merge $searchConfig -}}
|
|
|
|
{{- if eq .Language.Lang "zh-cn" -}}
|
|
|
|
{{- $searchConfig = dict "lunrSegmentitURL" (resources.Get "lib/lunr/lunr.segmentit.js").RelPermalink | merge $searchConfig -}}
|
|
|
|
{{- end -}}
|
2020-04-21 16:55:06 +02:00
|
|
|
{{- dict "source" "lib/lunr/lunr.stemmer.support.js" "minify" true "fingerprint" $fingerprint | dict "scratch" $.Scratch "data" | partial "scratch/script.html" -}}
|
|
|
|
{{- dict "source" (T "lunrLanguageLib") "minify" true "fingerprint" $fingerprint | dict "scratch" $.Scratch "data" | partial "scratch/script.html" -}}
|
2020-04-15 09:46:50 +02:00
|
|
|
{{- end -}}
|
|
|
|
{{- else if eq .Site.Params.search.type "algolia" -}}
|
2020-04-21 16:55:06 +02:00
|
|
|
{{- with $cdn.algoliasearchJS -}}
|
2020-04-21 19:00:51 +02:00
|
|
|
{{- dict "source" . | dict "scratch" $.Scratch "data" | partial "scratch/script.html" -}}
|
2020-04-15 09:46:50 +02:00
|
|
|
{{- else -}}
|
2020-04-21 16:55:06 +02:00
|
|
|
{{- dict "source" "lib/algoliasearch/algoliasearch-lite.umd.min.js" "fingerprint" $fingerprint | dict "scratch" $.Scratch "data" | partial "scratch/script.html" -}}
|
2020-04-15 09:46:50 +02:00
|
|
|
{{- end -}}
|
|
|
|
{{- $searchConfig = dict "type" "algolia" "algoliaIndex" .Site.Params.search.algolia.index "algoliaAppID" .Site.Params.search.algolia.appID "algoliaSearchKey" .Site.Params.search.algolia.searchKey | merge $searchConfig -}}
|
2020-02-17 19:53:07 +01:00
|
|
|
{{- end -}}
|
2020-04-15 09:46:50 +02:00
|
|
|
{{- $config = dict "search" $searchConfig | merge $config -}}
|
2020-02-17 19:53:07 +01:00
|
|
|
{{- end -}}
|
|
|
|
|
2020-02-24 10:53:08 +01:00
|
|
|
{{- /* lazysizes */ -}}
|
2020-04-21 16:55:06 +02:00
|
|
|
{{- with $cdn.lazysizesJS -}}
|
2020-04-21 19:00:51 +02:00
|
|
|
{{- dict "source" . | dict "scratch" $.Scratch "data" | partial "scratch/script.html" -}}
|
2020-03-08 14:02:21 +01:00
|
|
|
{{- else -}}
|
2020-04-21 16:55:06 +02:00
|
|
|
{{- dict "source" "lib/lazysizes/lazysizes.min.js" "fingerprint" $fingerprint | dict "scratch" $.Scratch "data" | partial "scratch/script.html" -}}
|
2020-02-24 10:00:39 +01:00
|
|
|
{{- end -}}
|
|
|
|
|
2020-02-24 10:53:08 +01:00
|
|
|
{{- /* lightgallery.js */ -}}
|
2020-04-21 16:55:06 +02:00
|
|
|
{{- if $params.lightgallery -}}
|
|
|
|
{{- with $cdn.lightgalleryCSS -}}
|
2020-04-21 19:00:51 +02:00
|
|
|
{{- dict "source" . | dict "scratch" $.Scratch "data" | partial "scratch/stylesheet.html" -}}
|
2020-02-24 10:00:39 +01:00
|
|
|
{{- else -}}
|
2020-04-21 16:55:06 +02:00
|
|
|
{{- dict "source" "lib/lightgallery/lightgallery.min.css" "fingerprint" $fingerprint | dict "scratch" $.Scratch "data" | partial "scratch/stylesheet.html" -}}
|
2020-02-24 10:00:39 +01:00
|
|
|
{{- end -}}
|
2020-04-21 16:55:06 +02:00
|
|
|
{{- with $cdn.lightgalleryJS -}}
|
2020-04-21 19:00:51 +02:00
|
|
|
{{- dict "source" . | dict "scratch" $.Scratch "data" | partial "scratch/script.html" -}}
|
2020-02-24 10:00:39 +01:00
|
|
|
{{- else -}}
|
2020-04-21 16:55:06 +02:00
|
|
|
{{- dict "source" "lib/lightgallery/lightgallery.min.js" "fingerprint" $fingerprint | dict "scratch" $.Scratch "data" | partial "scratch/script.html" -}}
|
2020-02-24 10:00:39 +01:00
|
|
|
{{- end -}}
|
2020-04-21 16:55:06 +02:00
|
|
|
{{- with $cdn.lightgalleryThumbnailJS -}}
|
2020-04-21 19:00:51 +02:00
|
|
|
{{- dict "source" . | dict "scratch" $.Scratch "data" | partial "scratch/script.html" -}}
|
2020-02-24 10:00:39 +01:00
|
|
|
{{- else -}}
|
2020-04-21 16:55:06 +02:00
|
|
|
{{- dict "source" "lib/lightgallery/lg-thumbnail.min.js" "fingerprint" $fingerprint | dict "scratch" $.Scratch "data" | partial "scratch/script.html" -}}
|
2020-02-24 10:00:39 +01:00
|
|
|
{{- end -}}
|
2020-04-21 16:55:06 +02:00
|
|
|
{{- with $cdn.lightgalleryZoomJS -}}
|
2020-04-21 19:00:51 +02:00
|
|
|
{{- dict "source" . | dict "scratch" $.Scratch "data" | partial "scratch/script.html" -}}
|
2020-04-15 09:46:50 +02:00
|
|
|
{{- else -}}
|
2020-04-21 16:55:06 +02:00
|
|
|
{{- dict "source" "lib/lightgallery/lg-zoom.min.js" "fingerprint" $fingerprint | dict "scratch" $.Scratch "data" | partial "scratch/script.html" -}}
|
2020-04-15 09:46:50 +02:00
|
|
|
{{- end -}}
|
|
|
|
{{- $lightGalleryConfig := dict "selector" ".lightgallery" "speed" 400 "hideBarsDelay" 2000 "thumbnail" true "exThumbImage" "data-thumbnail" "thumbWidth" 80 "thumbContHeight" 80 "actualSize" false -}}
|
|
|
|
{{- $config = dict "lightGallery" $lightGalleryConfig | merge $config -}}
|
|
|
|
{{- end -}}
|
|
|
|
|
2020-04-18 14:54:54 +02:00
|
|
|
{{- /* clipboard.js */ -}}
|
2020-04-21 16:55:06 +02:00
|
|
|
{{- if ne $params.copycode false -}}
|
|
|
|
{{- with $cdn.clipboardJS -}}
|
2020-04-21 19:00:51 +02:00
|
|
|
{{- dict "source" . | dict "scratch" $.Scratch "data" | partial "scratch/script.html" -}}
|
2020-04-21 16:55:06 +02:00
|
|
|
{{- else -}}
|
|
|
|
{{- dict "source" "lib/clipboard/clipboard.min.js" "fingerprint" $fingerprint | dict "scratch" $.Scratch "data" | partial "scratch/script.html" -}}
|
|
|
|
{{- end -}}
|
|
|
|
{{- $config = T "copyToClipboard" | dict "title" | dict "clipboard" | merge $config -}}
|
2020-04-18 14:54:54 +02:00
|
|
|
{{- end -}}
|
|
|
|
|
2020-04-15 09:46:50 +02:00
|
|
|
{{- /* Sharer.js */ -}}
|
2020-04-21 16:55:06 +02:00
|
|
|
{{- if $params.share.enable -}}
|
|
|
|
{{- with $cdn.sharerJS -}}
|
2020-04-21 19:00:51 +02:00
|
|
|
{{- dict "source" . | dict "scratch" $.Scratch "data" | partial "scratch/script.html" -}}
|
2020-02-24 10:00:39 +01:00
|
|
|
{{- else -}}
|
2020-04-21 16:55:06 +02:00
|
|
|
{{- dict "source" "lib/sharer/sharer.min.js" "fingerprint" $fingerprint | dict "scratch" $.Scratch "data" | partial "scratch/script.html" -}}
|
2020-02-24 10:00:39 +01:00
|
|
|
{{- end -}}
|
2020-02-14 14:09:21 +01:00
|
|
|
{{- end -}}
|
|
|
|
|
2020-02-24 10:53:08 +01:00
|
|
|
{{- /* TypeIt */ -}}
|
2020-04-21 16:55:06 +02:00
|
|
|
{{- with (.Scratch.Get "this").typeitMap -}}
|
|
|
|
{{- with $cdn.typeitJS -}}
|
2020-04-21 19:00:51 +02:00
|
|
|
{{- dict "source" . | dict "scratch" $.Scratch "data" | partial "scratch/script.html" -}}
|
2020-02-14 14:09:21 +01:00
|
|
|
{{- else -}}
|
2020-04-21 16:55:06 +02:00
|
|
|
{{- dict "source" "lib/typeit/typeit.min.js" "fingerprint" $fingerprint | dict "scratch" $.Scratch "data" | partial "scratch/script.html" -}}
|
2020-02-14 14:09:21 +01:00
|
|
|
{{- end -}}
|
2020-04-15 09:46:50 +02:00
|
|
|
{{- $typeitConfig := slice -}}
|
2020-02-14 14:09:21 +01:00
|
|
|
{{- range $key, $val := . -}}
|
2020-04-15 09:46:50 +02:00
|
|
|
{{- $typeitConfig = $typeitConfig | append (slice $val) -}}
|
2020-02-14 14:09:21 +01:00
|
|
|
{{- end -}}
|
2020-04-15 09:46:50 +02:00
|
|
|
{{- $config = dict "typeit" $typeitConfig | merge $config -}}
|
2020-02-14 14:09:21 +01:00
|
|
|
{{- end -}}
|
|
|
|
|
2020-02-24 10:53:08 +01:00
|
|
|
{{- /* KaTeX */ -}}
|
2020-04-21 16:55:06 +02:00
|
|
|
{{- if $params.math.enable -}}
|
|
|
|
{{- with $cdn.katexCSS -}}
|
2020-04-21 19:00:51 +02:00
|
|
|
{{- dict "source" . | dict "scratch" $.Scratch "data" | partial "scratch/stylesheet.html" -}}
|
2020-02-14 14:09:21 +01:00
|
|
|
{{- else -}}
|
2020-04-21 16:55:06 +02:00
|
|
|
{{- dict "source" "lib/katex/katex.min.css" "fingerprint" $fingerprint | dict "scratch" $.Scratch "data" | partial "scratch/stylesheet.html" -}}
|
2020-02-14 14:09:21 +01:00
|
|
|
{{- end -}}
|
2020-04-21 16:55:06 +02:00
|
|
|
{{- with $cdn.katexJS -}}
|
2020-04-21 19:00:51 +02:00
|
|
|
{{- dict "source" . | dict "scratch" $.Scratch "data" | partial "scratch/script.html" -}}
|
2020-02-14 14:09:21 +01:00
|
|
|
{{- else -}}
|
2020-04-21 16:55:06 +02:00
|
|
|
{{- dict "source" "lib/katex/katex.min.js" "fingerprint" $fingerprint | dict "scratch" $.Scratch "data" | partial "scratch/script.html" -}}
|
2020-02-14 14:09:21 +01:00
|
|
|
{{- end -}}
|
2020-04-21 16:55:06 +02:00
|
|
|
{{- with $cdn.katexAutoRenderJS -}}
|
2020-04-21 19:00:51 +02:00
|
|
|
{{- dict "source" . | dict "scratch" $.Scratch "data" | partial "scratch/script.html" -}}
|
2020-02-14 14:09:21 +01:00
|
|
|
{{- else -}}
|
2020-04-21 16:55:06 +02:00
|
|
|
{{- dict "source" "lib/katex/auto-render.min.js" "fingerprint" $fingerprint | dict "scratch" $.Scratch "data" | partial "scratch/script.html" -}}
|
2020-02-14 14:09:21 +01:00
|
|
|
{{- end -}}
|
2020-04-21 16:55:06 +02:00
|
|
|
{{- $math := $params.math -}}
|
2020-02-16 19:32:52 +01:00
|
|
|
{{- if $math.copyTex -}}
|
2020-04-21 16:55:06 +02:00
|
|
|
{{- with $cdn.katexCopyTexCSS -}}
|
2020-04-21 19:00:51 +02:00
|
|
|
{{- dict "source" . | dict "scratch" $.Scratch "data" | partial "scratch/stylesheet.html" -}}
|
2020-02-14 14:09:21 +01:00
|
|
|
{{- else -}}
|
2020-04-21 16:55:06 +02:00
|
|
|
{{- dict "source" "lib/katex/copy-tex.min.css" "fingerprint" $fingerprint | dict "scratch" $.Scratch "data" | partial "scratch/stylesheet.html" -}}
|
2020-02-14 14:09:21 +01:00
|
|
|
{{- end -}}
|
2020-04-21 16:55:06 +02:00
|
|
|
{{- with $cdn.katexCopyTexJS -}}
|
2020-04-21 19:00:51 +02:00
|
|
|
{{- dict "source" . | dict "scratch" $.Scratch "data" | partial "scratch/script.html" -}}
|
2020-02-14 14:09:21 +01:00
|
|
|
{{- else -}}
|
2020-04-21 16:55:06 +02:00
|
|
|
{{- dict "source" "lib/katex/copy-tex.min.js" "fingerprint" $fingerprint | dict "scratch" $.Scratch "data" | partial "scratch/script.html" -}}
|
2020-02-14 14:09:21 +01:00
|
|
|
{{- end -}}
|
|
|
|
{{- end -}}
|
|
|
|
{{- if $math.mhchem -}}
|
2020-04-21 16:55:06 +02:00
|
|
|
{{- with $cdn.katexMhchemJS -}}
|
2020-04-21 19:00:51 +02:00
|
|
|
{{- dict "source" . | dict "scratch" $.Scratch "data" | partial "scratch/script.html" -}}
|
2020-02-14 14:09:21 +01:00
|
|
|
{{- else -}}
|
2020-04-21 16:55:06 +02:00
|
|
|
{{- dict "source" "lib/katex/mhchem.min.js" "fingerprint" $fingerprint | dict "scratch" $.Scratch "data" | partial "scratch/script.html" -}}
|
2020-02-14 14:09:21 +01:00
|
|
|
{{- end -}}
|
|
|
|
{{- end -}}
|
2020-04-15 09:46:50 +02:00
|
|
|
{{- $mathConfig := dict "strict" false -}}
|
|
|
|
{{- $delimiters := slice (dict "left" "$$" "right" "$$" "display" true) (dict "left" "\\[" "right" "\\]" "display" true) -}}
|
|
|
|
{{- if and $math.blockLeftDelimiter $math.blockRightDelimiter -}}
|
|
|
|
{{- $delimiters = $delimiters | append (dict "left" $math.blockLeftDelimiter "right" $math.blockRightDelimiter "display" true) -}}
|
|
|
|
{{- end -}}
|
|
|
|
{{- $delimiters = $delimiters | append (dict "left" "$" "right" "$" "display" false) (dict "left" "\\(" "right" "\\)" "display" false) -}}
|
|
|
|
{{- if and $math.inlineLeftDelimiter $math.inlineRightDelimiter -}}
|
|
|
|
{{- $delimiters = $delimiters | append (dict "left" $math.inlineRightDelimiter "right" $math.inlineRightDelimiter "display" false) -}}
|
|
|
|
{{- end -}}
|
|
|
|
{{- $mathConfig = dict "delimiters" $delimiters | merge $mathConfig -}}
|
|
|
|
{{- $config = dict "math" $mathConfig | merge $config -}}
|
2020-02-14 14:09:21 +01:00
|
|
|
{{- end -}}
|
|
|
|
|
2020-02-24 10:53:08 +01:00
|
|
|
{{- /* mermaid */ -}}
|
2020-04-21 16:55:06 +02:00
|
|
|
{{- if (.Scratch.Get "this").mermaid -}}
|
|
|
|
{{- with $cdn.mermaidJS -}}
|
2020-04-21 19:00:51 +02:00
|
|
|
{{- dict "source" . | dict "scratch" $.Scratch "data" | partial "scratch/script.html" -}}
|
2020-02-14 14:09:21 +01:00
|
|
|
{{- else -}}
|
2020-04-21 16:55:06 +02:00
|
|
|
{{- dict "source" "lib/mermaid/mermaid.min.js" "fingerprint" $fingerprint | dict "scratch" $.Scratch "data" | partial "scratch/script.html" -}}
|
2020-02-14 14:09:21 +01:00
|
|
|
{{- end -}}
|
2020-04-15 09:46:50 +02:00
|
|
|
{{- $options := dict "targetPath" "lib/mermaid/mermaid.min.css" -}}
|
2020-04-21 16:55:06 +02:00
|
|
|
{{- dict "source" "lib/mermaid/mermaid.scss" "toCSS" $options "fingerprint" $fingerprint | dict "scratch" $.Scratch "data" | partial "scratch/stylesheet.html" -}}
|
2020-02-27 13:14:40 +01:00
|
|
|
{{- end -}}
|
|
|
|
|
|
|
|
{{- /* ECharts */ -}}
|
2020-04-21 16:55:06 +02:00
|
|
|
{{- if (.Scratch.Get "this").echarts -}}
|
|
|
|
{{- with $cdn.echartsJS -}}
|
2020-04-21 19:00:51 +02:00
|
|
|
{{- dict "source" . | dict "scratch" $.Scratch "data" | partial "scratch/script.html" -}}
|
2020-02-27 13:14:40 +01:00
|
|
|
{{- else -}}
|
2020-04-21 16:55:06 +02:00
|
|
|
{{- dict "source" "lib/echarts/echarts.min.js" "fingerprint" $fingerprint | dict "scratch" $.Scratch "data" | partial "scratch/script.html" -}}
|
2020-02-27 13:14:40 +01:00
|
|
|
{{- end -}}
|
2020-04-21 16:55:06 +02:00
|
|
|
{{- with $cdn.echartsMacaronsJS -}}
|
2020-04-21 19:00:51 +02:00
|
|
|
{{- dict "source" . | dict "scratch" $.Scratch "data" | partial "scratch/script.html" -}}
|
2020-02-27 13:14:40 +01:00
|
|
|
{{- else -}}
|
2020-04-21 16:55:06 +02:00
|
|
|
{{- dict "source" "lib/echarts/macarons.js" "minify" true "fingerprint" $fingerprint | dict "scratch" $.Scratch "data" | partial "scratch/script.html" -}}
|
2020-02-27 13:14:40 +01:00
|
|
|
{{- end -}}
|
2020-03-21 09:59:23 +01:00
|
|
|
{{- end -}}
|
|
|
|
|
|
|
|
{{- /* Mapbox GL */ -}}
|
2020-04-21 16:55:06 +02:00
|
|
|
{{- if (.Scratch.Get "this").mapbox -}}
|
|
|
|
{{- with $cdn.mapboxGLCSS -}}
|
2020-04-21 19:00:51 +02:00
|
|
|
{{- dict "source" . | dict "scratch" $.Scratch "data" | partial "scratch/stylesheet.html" -}}
|
2020-03-21 09:59:23 +01:00
|
|
|
{{- else -}}
|
2020-04-21 16:55:06 +02:00
|
|
|
{{- dict "source" "lib/mapbox-gl/mapbox-gl.min.css" "fingerprint" $fingerprint | dict "scratch" $.Scratch "data" | partial "scratch/stylesheet.html" -}}
|
2020-03-21 09:59:23 +01:00
|
|
|
{{- end -}}
|
2020-04-21 16:55:06 +02:00
|
|
|
{{- with $cdn.mapboxGLJS -}}
|
2020-04-21 19:00:51 +02:00
|
|
|
{{- dict "source" . | dict "scratch" $.Scratch "data" | partial "scratch/script.html" -}}
|
2020-03-21 09:59:23 +01:00
|
|
|
{{- else -}}
|
2020-04-21 16:55:06 +02:00
|
|
|
{{- dict "source" "lib/mapbox-gl/mapbox-gl.min.js" "fingerprint" $fingerprint | dict "scratch" $.Scratch "data" | partial "scratch/script.html" -}}
|
2020-03-21 09:59:23 +01:00
|
|
|
{{- end -}}
|
2020-04-21 16:55:06 +02:00
|
|
|
{{- dict "source" "lib/mapbox-gl/mapbox-gl-language.js" "minify" true "fingerprint" $fingerprint | dict "scratch" $.Scratch "data" | partial "scratch/script.html" -}}
|
|
|
|
{{- $config = dict "accessToken" $params.mapbox.accessToken "RTLTextPlugin" "https://api.mapbox.com/mapbox-gl-js/plugins/mapbox-gl-rtl-text/v0.2.0/mapbox-gl-rtl-text.js" | dict "mapbox" | merge $config -}}
|
2020-02-14 14:09:21 +01:00
|
|
|
{{- end -}}
|
|
|
|
|
|
|
|
{{- /* Music */ -}}
|
2020-04-21 16:55:06 +02:00
|
|
|
{{- if (.Scratch.Get "this").music -}}
|
2020-02-24 10:53:08 +01:00
|
|
|
{{- /* APlayer */ -}}
|
2020-04-21 16:55:06 +02:00
|
|
|
{{- with $cdn.aplayerCSS -}}
|
2020-04-21 19:00:51 +02:00
|
|
|
{{- dict "source" . | dict "scratch" $.Scratch "data" | partial "scratch/stylesheet.html" -}}
|
2020-02-14 14:09:21 +01:00
|
|
|
{{- else -}}
|
2020-04-21 16:55:06 +02:00
|
|
|
{{- dict "source" "lib/aplayer/APlayer.min.css" "fingerprint" $fingerprint | dict "scratch" $.Scratch "data" | partial "scratch/stylesheet.html" -}}
|
2020-02-14 14:09:21 +01:00
|
|
|
{{- end -}}
|
2020-04-15 09:46:50 +02:00
|
|
|
{{- $options := dict "targetPath" "lib/aplayer/dark.min.css" -}}
|
2020-04-21 16:55:06 +02:00
|
|
|
{{- dict "source" "lib/aplayer/dark.scss" "toCSS" $options "fingerprint" $fingerprint | dict "scratch" $.Scratch "data" | partial "scratch/stylesheet.html" -}}
|
|
|
|
{{- with $cdn.aplayerJS -}}
|
2020-04-21 19:00:51 +02:00
|
|
|
{{- dict "source" . | dict "scratch" $.Scratch "data" | partial "scratch/script.html" -}}
|
2020-02-14 14:09:21 +01:00
|
|
|
{{- else -}}
|
2020-04-21 16:55:06 +02:00
|
|
|
{{- dict "source" "lib/aplayer/APlayer.min.js" "fingerprint" $fingerprint | dict "scratch" $.Scratch "data" | partial "scratch/script.html" -}}
|
2020-02-14 14:09:21 +01:00
|
|
|
{{- end -}}
|
|
|
|
|
2020-02-24 10:53:08 +01:00
|
|
|
{{- /* MetingJS */ -}}
|
2020-04-21 16:55:06 +02:00
|
|
|
{{- with $cdn.metingJS -}}
|
2020-04-21 19:00:51 +02:00
|
|
|
{{- dict "source" . | dict "scratch" $.Scratch "data" | partial "scratch/script.html" -}}
|
2020-02-14 14:09:21 +01:00
|
|
|
{{- else -}}
|
2020-04-21 16:55:06 +02:00
|
|
|
{{- dict "source" "lib/meting/Meting.min.js" "fingerprint" $fingerprint | dict "scratch" $.Scratch "data" | partial "scratch/script.html" -}}
|
2020-02-14 14:09:21 +01:00
|
|
|
{{- end -}}
|
|
|
|
{{- end -}}
|
|
|
|
|
2020-02-24 13:34:00 +01:00
|
|
|
{{- /* Theme script */ -}}
|
2020-04-21 16:55:06 +02:00
|
|
|
{{- dict "source" "js/theme.min.js" "fingerprint" $fingerprint | dict "scratch" $.Scratch "data" | partial "scratch/script.html" -}}
|
2020-02-24 13:34:00 +01:00
|
|
|
{{- $_ := (resources.Get "js/theme.min.js.map").RelPermalink -}}
|
|
|
|
|
2020-04-21 16:55:06 +02:00
|
|
|
{{- range (.Scratch.Get "this").stylesheet -}}
|
2020-04-15 09:46:50 +02:00
|
|
|
{{- partial "plugin/stylesheet.html" . -}}
|
2020-02-14 14:09:21 +01:00
|
|
|
{{- end -}}
|
|
|
|
|
2020-04-15 09:46:50 +02:00
|
|
|
<script type="text/javascript">
|
2020-04-21 16:55:06 +02:00
|
|
|
window.config = {{ $config | jsonify | safeJS }};
|
2020-04-15 09:46:50 +02:00
|
|
|
</script>
|
|
|
|
|
2020-04-16 18:25:42 +02:00
|
|
|
{{- /* Polyfill.io */ -}}
|
2020-04-18 14:54:54 +02:00
|
|
|
{{- partial "plugin/script.html" (dict "source" "https://polyfill.io/v3/polyfill.min.js?features=Element.prototype.closest%2CrequestAnimationFrame%2CCustomEvent%2CPromise%2CObject.entries%2CObject.assign%2CObject.values%2Cfetch%2CElement.prototype.after") -}}
|
2020-04-16 18:25:42 +02:00
|
|
|
|
2020-04-21 16:55:06 +02:00
|
|
|
{{- range (.Scratch.Get "this").script -}}
|
2020-04-15 09:46:50 +02:00
|
|
|
{{- partial "plugin/script.html" . -}}
|
2020-02-14 14:09:21 +01:00
|
|
|
{{- end -}}
|
2020-02-16 17:41:08 +01:00
|
|
|
|
2020-02-17 14:02:27 +01:00
|
|
|
{{- /* Google analytics async */ -}}
|
2020-03-16 14:35:16 +01:00
|
|
|
{{- if eq hugo.Environment "production" | and .Site.GoogleAnalytics -}}
|
2020-02-17 14:02:27 +01:00
|
|
|
{{- template "_internal/google_analytics_async.html" . -}}
|
2020-04-21 17:37:05 +02:00
|
|
|
|
|
|
|
{{ if and .Site.Params.fathomAnalytics .Site.Params.fathomAnalytics.siteID }}
|
|
|
|
{{- partial "plugin/analytics/fathom" . -}}
|
|
|
|
{{ end }}
|
|
|
|
{{- end -}}
|