mirror of
https://github.com/hugo-fixit/FixIt.git
synced 2026-08-24 15:28:57 +00:00
e6625fb118
https://gohugo.io/methods/site/language/ https://gohugo.io/methods/page/language/ https://gohugo.io/configuration/languages/
26 lines
1.1 KiB
HTML
26 lines
1.1 KiB
HTML
{{- /* FixIt theme environment detection */ -}}
|
|
|
|
{{- if hugo.IsProduction -}}
|
|
{{- $cdn := .Site.Params.cdn -}}
|
|
{{- with $cdn.data -}}
|
|
{{- $cdnData := printf "data/cdn/%v" . | resources.Get | transform.Unmarshal -}}
|
|
{{- $cdn = dict "simpleIconsPrefix" $cdnData.prefix.simpleIcons -}}
|
|
{{- $prefix := $cdnData.prefix.libFiles | default "" -}}
|
|
{{- range $key, $value := $cdnData.libFiles -}}
|
|
{{- $cdn = printf "%v%v" $prefix $value | dict $key | merge $cdn -}}
|
|
{{- end -}}
|
|
{{- end -}}
|
|
{{- .Site.Store.Set "cdn" $cdn -}}
|
|
{{- .Site.Store.Set "fingerprint" .Site.Params.fingerprint -}}
|
|
{{- .Site.Store.Set "analytics" .Site.Params.analytics -}}
|
|
{{- .Store.Set "comment" (dict "Page" . "Key" "comment" | partial "function/param.html") -}}
|
|
{{- else -}}
|
|
{{- .Site.Store.Set "devOpts" .Site.Params.dev -}}
|
|
{{- if ne .Site.Params.dev.enable true -}}
|
|
{{- .Site.Store.Set "devOpts" dict -}}
|
|
{{- end -}}
|
|
{{- if .Site.Language.IsDefault -}}
|
|
{{- warnf "FixIt %v\n%v\n\n" (hugo.Store.Get "version") (T "init.devEnvWarn") -}}
|
|
{{- end -}}
|
|
{{- end -}}
|