💥 BREAKING CHANGE: rename directory layouts/_partials/scratch to layouts/_partials/store

This commit is contained in:
Cell
2025-07-03 17:31:22 +08:00
parent 92d0a857c1
commit 9293ee27f3
7 changed files with 68 additions and 68 deletions
+42 -42
View File
@@ -10,18 +10,18 @@
{{- $search := .Site.Params.search -}}
{{- /* TODO update "lib/autocomplete-js/umd/index.production.js" */ -}}
{{- $source := $cdn.autocompleteJS | default "lib/autocomplete/autocomplete.min.js" -}}
{{- dict "Source" $source "Fingerprint" $fingerprint "Defer" true | dict "Page" . "Data" | partial "scratch/script.html" -}}
{{- dict "Source" $source "Fingerprint" $fingerprint "Defer" true | dict "Page" . "Data" | partial "store/script.html" -}}
{{- $config = dict "maxResultLength" $search.maxResultLength "snippetLength" $search.snippetLength "highlightTag" $search.highlightTag "noResultsFound" (T "assets.noResultsFound") | dict "search" | merge $config -}}
{{- if eq $search.type "algolia" -}}
{{- $source := $cdn.algoliasearchJS | default "lib/algoliasearch/algoliasearch-lite.umd.min.js" -}}
{{- dict "Source" $source "Fingerprint" $fingerprint "Defer" true | dict "Page" . "Data" | partial "scratch/script.html" -}}
{{- dict "Source" $source "Fingerprint" $fingerprint "Defer" true | dict "Page" . "Data" | partial "store/script.html" -}}
{{- $config = dict "type" "algolia" "algoliaIndex" $search.algolia.index "algoliaAppID" $search.algolia.appID "algoliaSearchKey" $search.algolia.searchKey | dict "search" | merge $config -}}
{{- else if eq $search.type "fuse" -}}
{{- with .Site.Home.OutputFormats.Get "search" -}}
{{- $config = dict "type" "fuse" "fuseIndexURL" .RelPermalink | dict "search" | merge $config -}}
{{- end -}}
{{- $source := $cdn.fuseJS | default "lib/fuse/fuse.min.js" -}}
{{- dict "Source" $source "Fingerprint" $fingerprint "Defer" true | dict "Page" . "Data" | partial "scratch/script.html" -}}
{{- dict "Source" $source "Fingerprint" $fingerprint "Defer" true | dict "Page" . "Data" | partial "store/script.html" -}}
{{- $config = dict "isCaseSensitive" $search.fuse.isCaseSensitive "minMatchCharLength" $search.fuse.minMatchCharLength "findAllMatches" $search.fuse.findAllMatches "location" $search.fuse.location "threshold" $search.fuse.threshold "distance" $search.fuse.distance "ignoreLocation" $search.fuse.ignoreLocation "useExtendedSearch" $search.fuse.useExtendedSearch "ignoreFieldNorm" $search.fuse.ignoreFieldNorm | dict "search" | merge $config -}}
{{- else if eq $search.type "cse" -}}
{{- $config = dict "type" "cse" | dict "search" | merge $config -}}
@@ -41,26 +41,26 @@
{{- /* instant.page */ -}}
{{- if $params.instantPage -}}
{{- $source := $cdn.instantPage | default "lib/instant-page/instantpage.min.js" -}}
{{- dict "Source" $source "Fingerprint" $fingerprint "Attr" `type="module"` "Async" true "Defer" true | dict "Page" . "Data" | partial "scratch/script.html" -}}
{{- dict "Source" $source "Fingerprint" $fingerprint "Attr" `type="module"` "Async" true "Defer" true | dict "Page" . "Data" | partial "store/script.html" -}}
{{- end -}}
{{- /* twemoji */ -}}
{{- if $params.twemoji -}}
{{- $source := $cdn.twemojiJS | default "lib/twemoji/twemoji.min.js" -}}
{{- dict "Source" $source "Fingerprint" $fingerprint "Defer" true | dict "Page" . "Data" | partial "scratch/script.html" -}}
{{- dict "Source" $source "Fingerprint" $fingerprint "Defer" true | dict "Page" . "Data" | partial "store/script.html" -}}
{{- $config = dict "twemoji" true | merge $config -}}
{{- end -}}
{{- /* lightgallery */ -}}
{{- if $params.lightgallery | or (eq $params.lightgallery "force") -}}
{{- $source := $cdn.lightgalleryCSS | default "lib/lightgallery/css/lightgallery-bundle.min.css" -}}
{{- dict "Source" $source "Fingerprint" $fingerprint | dict "Page" . "Data" | partial "scratch/style.html" -}}
{{- dict "Source" $source "Fingerprint" $fingerprint | dict "Page" . "Data" | partial "store/style.html" -}}
{{- $source := $cdn.lightgalleryJS | default "lib/lightgallery/lightgallery.min.js" -}}
{{- dict "Source" $source "Fingerprint" $fingerprint "Defer" true | dict "Page" . "Data" | partial "scratch/script.html" -}}
{{- dict "Source" $source "Fingerprint" $fingerprint "Defer" true | dict "Page" . "Data" | partial "store/script.html" -}}
{{- $source := $cdn.lightgalleryThumbnailJS | default "lib/lightgallery/plugins/thumbnail/lg-thumbnail.min.js" -}}
{{- dict "Source" $source "Fingerprint" $fingerprint "Defer" true | dict "Page" . "Data" | partial "scratch/script.html" -}}
{{- dict "Source" $source "Fingerprint" $fingerprint "Defer" true | dict "Page" . "Data" | partial "store/script.html" -}}
{{- $source := $cdn.lightgalleryZoomJS | default "lib/lightgallery/plugins/zoom/lg-zoom.min.js" -}}
{{- dict "Source" $source "Fingerprint" $fingerprint "Defer" true | dict "Page" . "Data" | partial "scratch/script.html" -}}
{{- dict "Source" $source "Fingerprint" $fingerprint "Defer" true | dict "Page" . "Data" | partial "store/script.html" -}}
{{- $config = dict "lightgallery" true | merge $config -}}
{{- end -}}
@@ -79,14 +79,14 @@
{{- /* Sharer.js */ -}}
{{- if $params.share.enable -}}
{{- $source := $cdn.sharerJS | default "lib/sharer/sharer.min.js" -}}
{{- dict "Source" $source "Fingerprint" $fingerprint "Async" true "Defer" true | dict "Page" . "Data" | partial "scratch/script.html" -}}
{{- dict "Source" $source "Fingerprint" $fingerprint "Async" true "Defer" true | dict "Page" . "Data" | partial "store/script.html" -}}
{{- end -}}
{{- /* TypeIt */ -}}
{{- if .Store.Get "hasTyped" -}}
{{- $typeit := .Site.Params.typeit -}}
{{- $source := $cdn.typeitJS | default "lib/typeit/index.umd.js" -}}
{{- dict "Source" $source "Fingerprint" $fingerprint "Defer" true | dict "Page" . "Data" | partial "scratch/script.html" -}}
{{- dict "Source" $source "Fingerprint" $fingerprint "Defer" true | dict "Page" . "Data" | partial "store/script.html" -}}
{{- $config = dict "speed" $typeit.speed "cursorSpeed" $typeit.cursorSpeed "cursorChar" $typeit.cursorChar "duration" $typeit.duration "loop" $typeit.loop | dict "typeit" | merge $config -}}
{{- end -}}
@@ -96,11 +96,11 @@
{{- /* KaTeX */ -}}
{{- if (eq $math.type "katex") | and (.Store.Get "hasKaTeX") -}}
{{- $source := $cdn.katexCSS | default "lib/katex/katex.min.css" -}}
{{- dict "Source" $source "Fingerprint" $fingerprint "Preload" true | dict "Page" . "Data" | partial "scratch/style.html" -}}
{{- dict "Source" $source "Fingerprint" $fingerprint "Preload" true | dict "Page" . "Data" | partial "store/style.html" -}}
{{- /* Copy-tex extension */ -}}
{{- if $math.katex.copyTex -}}
{{- $source := $cdn.katexCopyTexJS | default "lib/katex/copy-tex.min.js" -}}
{{- dict "Source" $source "Fingerprint" $fingerprint "Defer" true | dict "Page" . "Data" | partial "scratch/script.html" -}}
{{- dict "Source" $source "Fingerprint" $fingerprint "Defer" true | dict "Page" . "Data" | partial "store/script.html" -}}
{{- end -}}
{{- end -}}
@@ -124,7 +124,7 @@
{{- if not hugo.IsProduction -}}
{{- $options = dict "sourceMap" "external" | merge $options -}}
{{- end -}}
{{- dict "Source" $source "Build" $options "Fingerprint" $fingerprint "Async" true "Defer" true | dict "Page" . "Data" | partial "scratch/script.html" -}}
{{- dict "Source" $source "Build" $options "Fingerprint" $fingerprint "Async" true "Defer" true | dict "Page" . "Data" | partial "store/script.html" -}}
{{- end -}}
{{- end -}}
@@ -143,7 +143,7 @@
{{- /* ECharts */ -}}
{{- if .Store.Get "hasEcharts" -}}
{{- $source := $cdn.echartsJS | default "lib/echarts/echarts.min.js" -}}
{{- dict "Source" $source "Fingerprint" $fingerprint "Defer" true | dict "Page" . "Data" | partial "scratch/script.html" -}}
{{- dict "Source" $source "Fingerprint" $fingerprint "Defer" true | dict "Page" . "Data" | partial "store/script.html" -}}
{{- $lightTheme := resources.Get "lib/echarts/theme/light.yml" | transform.Unmarshal -}}
{{- $darkTheme := resources.Get "lib/echarts/theme/dark.yml" | transform.Unmarshal -}}
{{- $config = dict "lightTheme" $lightTheme "darkTheme" $darkTheme | dict "echarts" | merge $config -}}
@@ -152,10 +152,10 @@
{{- /* Mapbox GL */ -}}
{{- if .HasShortcode "mapbox" -}}
{{- $source := $cdn.mapboxGLCSS | default "lib/mapbox-gl/mapbox-gl.css" -}}
{{- dict "Source" $source "Minify" true "Fingerprint" $fingerprint "Preload" true | dict "Page" . "Data" | partial "scratch/style.html" -}}
{{- dict "Source" $source "Minify" true "Fingerprint" $fingerprint "Preload" true | dict "Page" . "Data" | partial "store/style.html" -}}
{{- $source = $cdn.mapboxGLJS | default "lib/mapbox-gl/mapbox-gl.js" -}}
{{- dict "Source" $source "Fingerprint" $fingerprint "Defer" true | dict "Page" . "Data" | partial "scratch/script.html" -}}
{{- dict "Source" "lib/mapbox-gl/mapbox-gl-language.js" "Minify" true "Fingerprint" $fingerprint "Defer" true | dict "Page" . "Data" | partial "scratch/script.html" -}}
{{- dict "Source" $source "Fingerprint" $fingerprint "Defer" true | dict "Page" . "Data" | partial "store/script.html" -}}
{{- dict "Source" "lib/mapbox-gl/mapbox-gl-language.js" "Minify" true "Fingerprint" $fingerprint "Defer" true | dict "Page" . "Data" | partial "store/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 -}}
{{- end -}}
@@ -163,23 +163,23 @@
{{- if .HasShortcode "music" -}}
{{- /* APlayer */ -}}
{{- $source := $cdn.aplayerCSS | default "lib/aplayer/APlayer.min.css" -}}
{{- dict "Source" $source "Fingerprint" $fingerprint "Preload" true | dict "Page" . "Data" | partial "scratch/style.html" -}}
{{- dict "Source" $source "Fingerprint" $fingerprint "Preload" true | dict "Page" . "Data" | partial "store/style.html" -}}
{{- $options := dict "targetPath" "lib/aplayer/dark.min.css" "enableSourceMap" true -}}
{{- dict "Source" "lib/aplayer/dark.scss" "ToCSS" $options "Fingerprint" $fingerprint | dict "Page" . "Data" | partial "scratch/style.html" -}}
{{- dict "Source" "lib/aplayer/dark.scss" "ToCSS" $options "Fingerprint" $fingerprint | dict "Page" . "Data" | partial "store/style.html" -}}
{{- $source := $cdn.aplayerJS | default "lib/aplayer/APlayer.min.js" -}}
{{- dict "Source" $source "Fingerprint" $fingerprint "Defer" true | dict "Page" . "Data" | partial "scratch/script.html" -}}
{{- dict "Source" $source "Fingerprint" $fingerprint "Defer" true | dict "Page" . "Data" | partial "store/script.html" -}}
{{- /* MetingJS */ -}}
{{- $source := $cdn.metingJS | default "lib/meting/Meting.min.js" -}}
{{- dict "Source" $source "Fingerprint" $fingerprint "Defer" true | dict "Page" . "Data" | partial "scratch/script.html" -}}
{{- dict "Source" $source "Fingerprint" $fingerprint "Defer" true | dict "Page" . "Data" | partial "store/script.html" -}}
{{- end -}}
{{- /* Cookie Consent */ -}}
{{- if .Site.Params.cookieconsent | and .Site.Params.cookieconsent.enable -}}
{{- $source := $cdn.cookieconsentCSS | default "lib/cookieconsent/cookieconsent.min.css" -}}
{{- dict "Source" $source "Fingerprint" $fingerprint | dict "Page" . "Data" | partial "scratch/style.html" -}}
{{- dict "Source" $source "Fingerprint" $fingerprint | dict "Page" . "Data" | partial "store/style.html" -}}
{{- $source := $cdn.cookieconsentJS | default "lib/cookieconsent/cookieconsent.min.js" -}}
{{- dict "Source" $source "Fingerprint" $fingerprint "Defer" true | dict "Page" . "Data" | partial "scratch/script.html" -}}
{{- dict "Source" $source "Fingerprint" $fingerprint "Defer" true | dict "Page" . "Data" | partial "store/script.html" -}}
{{- $cookieconsentConfig := dict "popup" (dict "background" "#1aa3ff") "button" (dict "background" "#f0f0f0") | dict "theme" "edgeless" "palette" -}}
{{- $cookieconsentConfig = .Site.Params.cookieconsent | merge $cookieconsentConfig -}}
{{- $cookieconsentConfig = dict "message" ($cookieconsentConfig.content.message | default (T "assets.cookieconsentMessage")) "dismiss" ($cookieconsentConfig.content.dismiss | default (T "assets.cookieconsentDismiss")) "link" ($cookieconsentConfig.content.link | default (T "assets.cookieconsentLink")) | dict "content" | merge $cookieconsentConfig -}}
@@ -189,14 +189,14 @@
{{- /* PanguJS */ -}}
{{- if eq .Site.Params.pangu.enable true -}}
{{- $source := $cdn.panguJS | default "lib/pangu/pangu.min.js" -}}
{{- dict "Source" $source "Fingerprint" $fingerprint "Defer" true | dict "Page" . "Data" | partial "scratch/script.html" -}}
{{- dict "Source" $source "Fingerprint" $fingerprint "Defer" true | dict "Page" . "Data" | partial "store/script.html" -}}
{{- $config = dict "pangu" .Site.Params.pangu | merge $config -}}
{{- end -}}
{{- /* Watermark */ -}}
{{- if eq .Site.Params.watermark.enable true -}}
{{- $source := $cdn.cellWatermarkJS | default "lib/cell-watermark/watermark.min.js" -}}
{{- dict "Source" $source "Fingerprint" $fingerprint "Defer" true | dict "Page" . "Data" | partial "scratch/script.html" -}}
{{- dict "Source" $source "Fingerprint" $fingerprint "Defer" true | dict "Page" . "Data" | partial "store/script.html" -}}
{{- /* Hugo bug: case insensitive for `.Site.Params` */ -}}
{{- $config = dict "watermark" .Site.Params.watermark | merge $config -}}
{{- end -}}
@@ -208,23 +208,23 @@
{{- $cryptoEncBase64JS := $cdn.cryptoEncBase64JS | default "lib/crypto-js/enc-base64.js" -}}
{{- $cryptoSha256JS := $cdn.cryptoSha256JS | default "lib/crypto-js/sha256.js" -}}
{{- $xxhashWasmJS := $cdn.xxhashWasmJS | default "lib/xxhash-wasm/xxhash-wasm.js" -}}
{{- dict "Source" $cryptoCoreJS "Minify" true "Fingerprint" $fingerprint "Defer" true | dict "Page" . "Data" | partial "scratch/script.html" -}}
{{- dict "Source" $cryptoEncBase64JS "Minify" true "Fingerprint" $fingerprint "Defer" true | dict "Page" . "Data" | partial "scratch/script.html" -}}
{{- dict "Source" $cryptoSha256JS "Minify" true "Fingerprint" $fingerprint "Defer" true | dict "Page" . "Data" | partial "scratch/script.html" -}}
{{- dict "Source" $xxhashWasmJS "Fingerprint" $fingerprint "Defer" true | dict "Page" . "Data" | partial "scratch/script.html" -}}
{{- dict "Source" $cryptoCoreJS "Minify" true "Fingerprint" $fingerprint "Defer" true | dict "Page" . "Data" | partial "store/script.html" -}}
{{- dict "Source" $cryptoEncBase64JS "Minify" true "Fingerprint" $fingerprint "Defer" true | dict "Page" . "Data" | partial "store/script.html" -}}
{{- dict "Source" $cryptoSha256JS "Minify" true "Fingerprint" $fingerprint "Defer" true | dict "Page" . "Data" | partial "store/script.html" -}}
{{- dict "Source" $xxhashWasmJS "Fingerprint" $fingerprint "Defer" true | dict "Page" . "Data" | partial "store/script.html" -}}
{{- /* Decryption script */ -}}
{{- $options := dict "targetPath" "js/fixit-decryptor.min.js" "minify" hugo.IsProduction -}}
{{- if not hugo.IsProduction -}}
{{- $options = dict "sourceMap" "external" | merge $options -}}
{{- end -}}
{{- dict "Source" (resources.Get "js/fixit-decryptor.js") "Build" $options "Fingerprint" $fingerprint "Defer" true | dict "Page" . "Data" | partial "scratch/script.html" -}}
{{- dict "Source" (resources.Get "js/fixit-decryptor.js") "Build" $options "Fingerprint" $fingerprint "Defer" true | dict "Page" . "Data" | partial "store/script.html" -}}
{{- $config = dict "all" (isset $params "password") "shortcode" ($encryptPartial | default false) | dict "encryption" | merge $config -}}
{{- end -}}
{{- /* 不蒜子 */ -}}
{{- if .Site.Params.busuanzi.enable | and hugo.IsProduction -}}
{{- $source := .Site.Params.busuanzi.source | default "https://vercount.one/js" -}}
{{- dict "Source" $source "Fingerprint" $fingerprint "Async" true "Defer" true | dict "Page" . "Data" | partial "scratch/script.html" -}}
{{- dict "Source" $source "Fingerprint" $fingerprint "Async" true "Defer" true | dict "Page" . "Data" | partial "store/script.html" -}}
{{- end -}}
{{- /* Site creation time */ -}}
@@ -262,11 +262,11 @@
{{- $paceCSS = printf "%v/pace-theme-default.min.css" . -}}
{{- end -}}
{{- end -}}
{{- dict "Source" $paceJS "Fingerprint" $fingerprint "Async" true "Defer" true | dict "Page" . "Data" | partial "scratch/script.html" -}}
{{- dict "Source" $paceCSS "Fingerprint" $fingerprint | dict "Page" . "Data" | partial "scratch/style.html" -}}
{{- dict "Source" $paceJS "Fingerprint" $fingerprint "Async" true "Defer" true | dict "Page" . "Data" | partial "store/script.html" -}}
{{- dict "Source" $paceCSS "Fingerprint" $fingerprint | dict "Page" . "Data" | partial "store/style.html" -}}
{{- /* To patch pace theme flat-top z-index error */ -}}
{{- if eq $.Site.Params.pace.theme "flat-top" -}}
{{- dict "Source" "lib/pace/pace-patch-flat-top.css" "Fingerprint" $fingerprint | dict "Page" . "Data" | partial "scratch/style.html" -}}
{{- dict "Source" "lib/pace/pace-patch-flat-top.css" "Fingerprint" $fingerprint | dict "Page" . "Data" | partial "store/style.html" -}}
{{- end -}}
{{- end -}}
@@ -274,18 +274,18 @@
{{- partial "plugin/post-chat-ai.html" . -}}
{{- range $params.library.css -}}
{{- dict "Source" . "Fingerprint" $fingerprint | dict "Page" $ "Data" | partial "scratch/style.html" -}}
{{- dict "Source" . "Fingerprint" $fingerprint | dict "Page" $ "Data" | partial "store/style.html" -}}
{{- end -}}
{{- range $params.library.js -}}
{{- dict "Source" . "Fingerprint" $fingerprint "Defer" true | dict "Page" $ "Data" | partial "scratch/script.html" -}}
{{- dict "Source" . "Fingerprint" $fingerprint "Defer" true | dict "Page" $ "Data" | partial "store/script.html" -}}
{{- end -}}
{{- with .Store.Get "styleArr" -}}
{{- $content := delimit . " " -}}
{{- $path := substr (md5 $.RelPermalink) 0 8 | printf "css/%v" -}}
{{- $options := printf "%v.min.css" $path | dict "targetPath" -}}
{{- dict "Content" $content "Path" (printf "%v.scss" $path) "ToCSS" $options | dict "Page" $ "Data" | partial "scratch/style.html" -}}
{{- dict "Content" $content "Path" (printf "%v.scss" $path) "ToCSS" $options | dict "Page" $ "Data" | partial "store/style.html" -}}
{{- end -}}
{{- /* Config script */ -}}
@@ -293,14 +293,14 @@
{{- if hugo.IsServer -}}
{{- $configJS = add $configJS "console.log('Page config:', window.config);" -}}
{{- end -}}
{{- $configJS | dict "Content" | dict "Page" . "Data" | partial "scratch/script.html" -}}
{{- $configJS | dict "Content" | dict "Page" . "Data" | partial "store/script.html" -}}
{{- /* Theme script */ -}}
{{- $options := dict "targetPath" "js/theme.min.js" "minify" hugo.IsProduction -}}
{{- if not hugo.IsProduction -}}
{{- $options = dict "sourceMap" "external" | merge $options -}}
{{- end -}}
{{- dict "Source" (resources.Get "js/theme.js") "Build" $options "Fingerprint" $fingerprint "Defer" true | dict "Page" . "Data" | partial "scratch/script.html" -}}
{{- dict "Source" (resources.Get "js/theme.js") "Build" $options "Fingerprint" $fingerprint "Defer" true | dict "Page" . "Data" | partial "store/script.html" -}}
{{- /* Custom Assets */ -}}
{{- block "custom-assets" . }}{{ end -}}
@@ -311,13 +311,13 @@
{{- if not hugo.IsProduction -}}
{{- $options = dict "sourceMap" "inline" | merge $options -}}
{{- end -}}
{{- dict "Source" . "Build" $options "Fingerprint" $fingerprint "Defer" true | dict "Page" $ "Data" | partial "scratch/script.html" -}}
{{- dict "Source" . "Build" $options "Fingerprint" $fingerprint "Defer" true | dict "Page" $ "Data" | partial "store/script.html" -}}
{{- end -}}
{{- with .Store.Get "scriptArr" -}}
{{- $content := delimit . "\n" -}}
{{- $targetPath := substr (md5 $.RelPermalink) 0 8 | printf "js/%v.js" -}}
{{- dict "Content" $content "Path" $targetPath "Defer" true | dict "Page" $ "Data" | partial "scratch/script.html" -}}
{{- dict "Content" $content "Path" $targetPath "Defer" true | dict "Page" $ "Data" | partial "store/script.html" -}}
{{- end -}}
{{- range (.Store.Get "this").style -}}
+1 -1
View File
@@ -1,4 +1,4 @@
{{- hugo.Store.Set "version" "v0.3.21-40345324" -}}
{{- hugo.Store.Set "version" "v0.3.21-92d0a857" -}}
{{- .Store.Set "this" dict -}}
{{- partial "init/detection-env.html" . -}}
+2 -2
View File
@@ -11,12 +11,12 @@
{{- end -}}
{{- end -}}
{{- with $features | uniq -}}
{{- delimit . "%2C" | printf "https://cdnjs.cloudflare.com/polyfill/v3/polyfill.js?features=%v" | dict "Source" | dict "Page" $ "Data" | partial "scratch/script.html" -}}
{{- delimit . "%2C" | printf "https://cdnjs.cloudflare.com/polyfill/v3/polyfill.js?features=%v" | dict "Source" | dict "Page" $ "Data" | partial "store/script.html" -}}
{{- end -}}
{{- end -}}
{{- /* object-fit-images */ -}}
{{- if $compatibility.objectFit -}}
{{- $source := $cdn.objectFitImagesJS | default "lib/object-fit-images/ofi.min.js" -}}
{{- dict "Source" $source "Fingerprint" $fingerprint | dict "Page" . "Data" | partial "scratch/script.html" -}}
{{- dict "Source" $source "Fingerprint" $fingerprint | dict "Page" . "Data" | partial "store/script.html" -}}
{{- end -}}
+3 -3
View File
@@ -27,7 +27,7 @@
{{- /* PostSummary */ -}}
{{- if $summaryEnable -}}
{{- $postChatCSS := "https://ai.zhheo.com/static/public/postChatUser_summary.min.css" -}}
{{- dict "Source" $postChatCSS "Fingerprint" $fingerprint | dict "Page" . "Data" | partial "scratch/style.html" -}}
{{- dict "Source" $postChatCSS "Fingerprint" $fingerprint | dict "Page" . "Data" | partial "store/style.html" -}}
{{- $p := "tianliGPT" -}}
{{- $postSummaryConfig := printf "let %v_postSelector='#content';" $p -}}
{{- with $summaryConfig.title -}}
@@ -100,7 +100,7 @@
{{- end -}}
{{- /* Insert config */ -}}
{{- $configJS | dict "Content" | dict "Page" . "Data" | partial "scratch/script.html" -}}
{{- $configJS | dict "Content" | dict "Page" . "Data" | partial "store/script.html" -}}
{{- /* Insert script */ -}}
{{- $postChatJS := "" -}}
@@ -112,5 +112,5 @@
{{- $postChatJS = add $sourcePrefix (index $jsMap "summary") -}}
{{- end -}}
{{- $sourceOpts = dict "Source" $postChatJS | merge $sourceOpts -}}
{{- $sourceOpts | dict "Page" . "Data" | partial "scratch/script.html" -}}
{{- $sourceOpts | dict "Page" . "Data" | partial "store/script.html" -}}
{{- end -}}
+20 -20
View File
@@ -16,9 +16,9 @@
{{- if $artalk.enable -}}
<div id="artalk" class="comment"></div>
{{- $source := $cdn.artalkCSS | default (add $artalk.server "/dist/Artalk.css") -}}
{{- dict "Source" $source "Minify" true "Fingerprint" $fingerprint | dict "Page" . "Data" | partial "scratch/style.html" -}}
{{- dict "Source" $source "Minify" true "Fingerprint" $fingerprint | dict "Page" . "Data" | partial "store/style.html" -}}
{{- $source := $cdn.artalkJS | default (add $artalk.server "/dist/Artalk.js") -}}
{{- dict "Source" $source "Fingerprint" $fingerprint | dict "Page" . "Data" | partial "scratch/script.html" -}}
{{- dict "Source" $source "Fingerprint" $fingerprint | dict "Page" . "Data" | partial "store/script.html" -}}
{{- $commentConfig = dict "el" "#artalk" "pageKey" .Permalink "pageTitle" .Title "pvEl" "artalk-visitor-count" "countEl" "artalk-comment-count" | dict "artalk" | merge $commentConfig -}}
{{- if (eq $artalk.locale "") | and (eq $.Site.LanguageCode "en") -}}
{{- $artalk = dict "locale" "en-US" | merge $artalk -}}
@@ -93,7 +93,7 @@
{{- if $disqus.enable -}}
<div id="disqus_thread" class="comment"></div>
{{- $source := printf "https://%v.disqus.com/embed.js" $disqus.shortname -}}
{{- dict "Source" $source "Defer" true | dict "Page" . "Data" | partial "scratch/script.html" -}}
{{- dict "Source" $source "Defer" true | dict "Page" . "Data" | partial "store/script.html" -}}
<noscript>
Please enable JavaScript to view the comments powered by <a href="https://disqus.com/?ref_noscript" rel="external nofollow noopener noreferrer">Disqus</a>.
</noscript>
@@ -104,9 +104,9 @@
{{- if $gitalk.enable -}}
<div id="gitalk" class="comment"></div>
{{- $source := $cdn.gitalkCSS | default "lib/gitalk/gitalk.css" -}}
{{- dict "Source" $source "Minify" true "Fingerprint" $fingerprint | dict "Page" . "Data" | partial "scratch/style.html" -}}
{{- dict "Source" $source "Minify" true "Fingerprint" $fingerprint | dict "Page" . "Data" | partial "store/style.html" -}}
{{- $source := $cdn.gitalkJS | default "lib/gitalk/gitalk.min.js" -}}
{{- dict "Source" $source "Fingerprint" $fingerprint | dict "Page" . "Data" | partial "scratch/script.html" -}}
{{- dict "Source" $source "Fingerprint" $fingerprint | dict "Page" . "Data" | partial "store/script.html" -}}
{{- $commentConfig = dict "id" .Date "title" .Title "clientID" $gitalk.clientId "clientSecret" $gitalk.clientSecret "repo" $gitalk.repo "owner" $gitalk.owner "admin" (slice $gitalk.owner) | dict "gitalk" | merge $commentConfig -}}
<noscript>
Please enable JavaScript to view the comments powered by <a href="https://github.com/gitalk/gitalk" rel="external nofollow noopener noreferrer">Gitalk</a>.
@@ -118,9 +118,9 @@
{{- if $valine.enable -}}
<div id="valine" class="comment"></div>
{{- $options := dict "targetPath" "lib/valine/valine.min.css" -}}
{{- dict "Source" "lib/valine/valine.scss" "ToCSS" $options | dict "Page" . "Data" | partial "scratch/style.html" -}}
{{- dict "Source" "lib/valine/valine.scss" "ToCSS" $options | dict "Page" . "Data" | partial "store/style.html" -}}
{{- $source := $cdn.valineJS | default "lib/valine/Valine.min.js" -}}
{{- dict "Source" $source "Fingerprint" $fingerprint | dict "Page" . "Data" | partial "scratch/script.html" -}}
{{- dict "Source" $source "Fingerprint" $fingerprint | dict "Page" . "Data" | partial "store/script.html" -}}
{{- $commentConfig = dict "el" "#valine" "appId" $valine.appId "appKey" $valine.appKey "lang" ($valine.lang | default (T "valineLang")) "visitor" $valine.visitor "recordIP" $valine.recordIP "placeholder" ($valine.placeholder | default (T "comment.valinePlaceholder")) "highlight" (ne $valine.highlight false) "enableQQ" $valine.enableQQ | dict "valine" | merge $commentConfig -}}
{{- with $valine.avatar -}}
{{- $commentConfig = dict "avatar" . | dict "valine" | merge $commentConfig -}}
@@ -149,9 +149,9 @@
{{- if $waline.enable -}}
<div id="waline" class="comment"></div>
{{- $source := $cdn.walineCSS | default "lib/waline/waline.css" -}}
{{- dict "Source" $source "Fingerprint" $fingerprint | dict "Page" . "Data" | partial "scratch/style.html" -}}
{{- dict "Source" $source "Fingerprint" $fingerprint | dict "Page" . "Data" | partial "store/style.html" -}}
{{- $source := $cdn.walineJS | default "lib/waline/waline.umd.js" -}}
{{- dict "Source" $source "Fingerprint" $fingerprint "Defer" true | dict "Page" . "Data" | partial "scratch/script.html" -}}
{{- dict "Source" $source "Fingerprint" $fingerprint "Defer" true | dict "Page" . "Data" | partial "store/script.html" -}}
{{- $commentConfig = dict "el" "#waline" "serverURL" $waline.serverURL "lang" .Lang "dark" "html[data-theme='dark']" | dict "waline" | merge $commentConfig -}}
{{- $commentConfig = dict "copyright" true "imageUploader" false "highlighter" false "texRenderer" false "search" false | dict "waline" | merge $commentConfig -}}
{{- with $waline.pageview -}}
@@ -215,7 +215,7 @@
data-numposts="{{ $facebook.numPosts }}"
></div>
{{- $source := printf "https://connect.facebook.net/%v/sdk.js#xfbml=1&version=v5.0&appId=%v&autoLogAppEvents=1" ($facebook.languageCode | default (T "comment.facebookLanguageCode")) $facebook.appId -}}
{{- dict "Source" $source "Defer" true | dict "Page" . "Data" | partial "scratch/script.html" -}}
{{- dict "Source" $source "Defer" true | dict "Page" . "Data" | partial "store/script.html" -}}
<noscript>
Please enable JavaScript to view the comments powered by <a href="https://developers.facebook.com/docs/plugins/comments/" rel="external nofollow noopener noreferrer">Facebook</a>.
</noscript>
@@ -242,7 +242,7 @@
{{- if $telegram.outlined -}}
{{- $attr = printf `%v data-outlined="1"` $attr -}}
{{- end -}}
{{- dict "Source" "https://comments.app/js/widget.js?2" "Defer" true "Attr" $attr | dict "Page" . "Data" | partial "scratch/script.html" -}}
{{- dict "Source" "https://comments.app/js/widget.js?2" "Defer" true "Attr" $attr | dict "Page" . "Data" | partial "store/script.html" -}}
<noscript>
Please enable JavaScript to view the comments powered by <a href="https://comments.app/" rel="external nofollow noopener noreferrer">Telegram Comments</a>.
</noscript>
@@ -252,7 +252,7 @@
{{- $commento := $comment.commento | default dict -}}
{{- if $commento.enable -}}
<div id="commento" class="comment"></div>
{{- dict "Source" "https://cdn.commento.io/js/commento.js" "Defer" true | dict "Page" . "Data" | partial "scratch/script.html" -}}
{{- dict "Source" "https://cdn.commento.io/js/commento.js" "Defer" true | dict "Page" . "Data" | partial "store/script.html" -}}
<noscript>
Please enable JavaScript to view the comments powered by <a href="https://commento.io/" rel="external nofollow noopener noreferrer">Commento</a>.
</noscript>
@@ -278,7 +278,7 @@
{{- if $twikoo.enable -}}
<div id="twikoo"></div>
{{- $source := $cdn.twikooJS | default "lib/twikoo/twikoo.all.min.js" -}}
{{- dict "Source" $source "Fingerprint" $fingerprint "Defer" true | dict "Page" . "Data" | partial "scratch/script.html" -}}
{{- dict "Source" $source "Fingerprint" $fingerprint "Defer" true | dict "Page" . "Data" | partial "store/script.html" -}}
{{- $commentConfig = dict "el" "#twikoo" "envId" $twikoo.envId "lang" .Lang | dict "twikoo" | merge $commentConfig -}}
{{- with $twikoo.region -}}
{{- $commentConfig = dict "region" . | dict "twikoo" | merge $commentConfig -}}
@@ -338,22 +338,22 @@
{{- $params := partial "function/params.html" -}}
{{- if not $params.lightgallery | and (($artalk.enable | and $artalk.lightgallery) | or ($twikoo.enable | and $twikoo.lightgallery)) -}}
{{- $source := $cdn.lightgalleryCSS | default "lib/lightgallery/css/lightgallery-bundle.min.css" -}}
{{- dict "Source" $source "Fingerprint" $fingerprint | dict "Page" . "Data" | partial "scratch/style.html" -}}
{{- dict "Source" $source "Fingerprint" $fingerprint | dict "Page" . "Data" | partial "store/style.html" -}}
{{- $source := $cdn.lightgalleryJS | default "lib/lightgallery/lightgallery.min.js" -}}
{{- dict "Source" $source "Fingerprint" $fingerprint "Defer" true | dict "Page" . "Data" | partial "scratch/script.html" -}}
{{- dict "Source" $source "Fingerprint" $fingerprint "Defer" true | dict "Page" . "Data" | partial "store/script.html" -}}
{{- $source := $cdn.lightgalleryThumbnailJS | default "lib/lightgallery/plugins/thumbnail/lg-thumbnail.min.js" -}}
{{- dict "Source" $source "Fingerprint" $fingerprint "Defer" true | dict "Page" . "Data" | partial "scratch/script.html" -}}
{{- dict "Source" $source "Fingerprint" $fingerprint "Defer" true | dict "Page" . "Data" | partial "store/script.html" -}}
{{- $source := $cdn.lightgalleryZoomJS | default "lib/lightgallery/plugins/zoom/lg-zoom.min.js" -}}
{{- dict "Source" $source "Fingerprint" $fingerprint "Defer" true | dict "Page" . "Data" | partial "scratch/script.html" -}}
{{- dict "Source" $source "Fingerprint" $fingerprint "Defer" true | dict "Page" . "Data" | partial "store/script.html" -}}
{{- end -}}
{{- /* KaTeX for Twikoo */ -}}
{{- if $twikoo.enable | and $twikoo.katex -}}
{{- $source := "https://cdn.jsdelivr.net/npm//katex@0.16.22/dist/katex.min.css" -}}
{{- dict "Source" $source "Fingerprint" $fingerprint | dict "Page" . "Data" | partial "scratch/style.html" -}}
{{- dict "Source" $source "Fingerprint" $fingerprint | dict "Page" . "Data" | partial "store/style.html" -}}
{{- $source := "https://cdn.jsdelivr.net/npm//katex@0.16.22/dist/katex.min.js" -}}
{{- dict "Source" $source "Fingerprint" $fingerprint "Defer" true | dict "Page" . "Data" | partial "scratch/script.html" -}}
{{- dict "Source" $source "Fingerprint" $fingerprint "Defer" true | dict "Page" . "Data" | partial "store/script.html" -}}
{{- $source := "https://cdn.jsdelivr.net/npm//katex@0.16.22/dist/contrib/auto-render.min.js" -}}
{{- dict "Source" $source "Fingerprint" $fingerprint "Defer" true | dict "Page" . "Data" | partial "scratch/script.html" -}}
{{- dict "Source" $source "Fingerprint" $fingerprint "Defer" true | dict "Page" . "Data" | partial "store/script.html" -}}
{{- end -}}
{{- end -}}