fix: ensure that the config of each page is unique

This commit is contained in:
Cell
2025-10-22 11:47:47 +08:00
parent fe129dd207
commit dd877f8041
3 changed files with 10 additions and 10 deletions
+6 -6
View File
@@ -323,17 +323,17 @@ FixIt theme assets partial
{{- if hugo.IsServer -}}
{{- $configJS = add $configJS "console.log('Page config:', window.config);" -}}
{{- end -}}
{{- $targetPath := relLangURL "/js/config/page.js" -}}
{{- if in .Site.RegularPages .Page -}}
{{- $targetPath = $noBaseRelPermalink | printf "%s/config/page.js" -}}
{{- $targetPath := $noBaseRelPermalink | printf "%s/config/page.js" -}}
{{- if (path.Ext .Page.RelPermalink) -}}
{{- $targetPath = "" -}}
{{- end -}}
{{- dict "Content" $configJS "Path" $targetPath "Defer" true | dict "Page" . "Data" | partial "store/script.html" -}}
{{- /* MathJax plugin */ -}}
{{- if .Store.Get "hasMathJax" -}}
{{- $targetPath := relLangURL "/js/lib/mathjax.min.js" -}}
{{- if in .Site.RegularPages .Page -}}
{{- $targetPath = $noBaseRelPermalink | printf "%s/mathjax.min.js" -}}
{{- $targetPath := $noBaseRelPermalink | printf "%s/mathjax.min.js" -}}
{{- if (path.Ext .Page.RelPermalink) -}}
{{- $targetPath = "" -}}
{{- end -}}
{{- $options := dict "targetPath" $targetPath "minify" hugo.IsProduction -}}
{{- if not hugo.IsProduction -}}
+1 -1
View File
@@ -1,4 +1,4 @@
{{- hugo.Store.Set "version" "v0.4.0-alpha.2-20251014082535-5c74d431" -}}
{{- hugo.Store.Set "version" "v0.4.0-alpha.2-20251022034748-fe129dd2" -}}
{{- .Store.Set "this" dict -}}
{{- partial "init/detection-env.html" . -}}
+3 -3
View File
@@ -100,9 +100,9 @@
{{- end -}}
{{- /* Insert config */ -}}
{{- $targetPath := relLangURL "/js/config/post-chat.js" -}}
{{- if in .Site.RegularPages .Page -}}
{{- $targetPath = (strings.TrimPrefix (relURL "") $.RelPermalink) | printf "%s/config/post-chat.js" -}}
{{- $targetPath := (strings.TrimPrefix (relURL "") $.RelPermalink) | printf "%s/config/post-chat.js" -}}
{{- if (path.Ext .Page.RelPermalink) -}}
{{- $targetPath = "" -}}
{{- end -}}
{{- dict "Content" $configJS "Path" $targetPath "Defer" true | dict "Page" . "Data" | partial "store/script.html" -}}