mirror of
https://github.com/hugo-fixit/FixIt.git
synced 2026-08-24 07:18:57 +00:00
feat(deprecated): project config key languageCode was deprecated in Hugo v0.158.0 and will be removed in a future release. Use locale instead.
https://gohugo.io/methods/site/language/ https://gohugo.io/methods/page/language/ https://gohugo.io/configuration/languages/
This commit is contained in:
+4
-4
@@ -12,12 +12,12 @@ defaultContentLanguage = "en"
|
||||
# [languages]
|
||||
|
||||
# [languages.en]
|
||||
# languageCode = "en"
|
||||
# languageName = "English"
|
||||
# locale = "en"
|
||||
# label = "English"
|
||||
|
||||
# [languages.zh-cn]
|
||||
# languageCode = "zh-CN"
|
||||
# languageName = "简体中文"
|
||||
# locale = "zh-CN"
|
||||
# label = "简体中文"
|
||||
|
||||
[permalinks]
|
||||
|
||||
|
||||
@@ -22,10 +22,10 @@ baseURL = "http://localhost:1313"
|
||||
defaultContentLanguage = "en"
|
||||
# Language code.
|
||||
# available values: ["en", "zh-CN", "fr", "pl", ...]
|
||||
languageCode = "en"
|
||||
locale = "en"
|
||||
# Language name.
|
||||
# available values: ["English", "简体中文", "Français", "Polski", ...]
|
||||
languageName = "English"
|
||||
label = "English"
|
||||
# Whether to include Chinese/Japanese/Korean.
|
||||
hasCJKLanguage = false
|
||||
# Timezone local.
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{{- $cjk := slice "zh-cn" "zh-tw" "ja" "ko" -}}
|
||||
{{- $isCJK := (in $cjk .Page.Language.Lang) | default .Page.Params.IsCJKLanguage -}}
|
||||
{{- $isCJK := (in $cjk .Page.Language.Name) | default .Page.Params.IsCJKLanguage -}}
|
||||
|
||||
{{- return $isCJK -}}
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
{{- if ne .Site.Params.dev.enable true -}}
|
||||
{{- .Site.Store.Set "devOpts" dict -}}
|
||||
{{- end -}}
|
||||
{{- if eq .Site hugo.Sites.Default -}}
|
||||
{{- if .Site.Language.IsDefault -}}
|
||||
{{- warnf "FixIt %v\n%v\n\n" (hugo.Store.Get "version") (T "init.devEnvWarn") -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
{{- if and (eq .Site hugo.Sites.Default) .Site.Params.search.enable (eq .Site.Params.search.type "pagefind") (not (fileExists "public/pagefind")) -}}
|
||||
{{- if and .Site.Language.IsDefault .Site.Params.search.enable (eq .Site.Params.search.type "pagefind") (not (fileExists "public/pagefind")) -}}
|
||||
{{- warnf "[FixIt] Pagefind search index not found.\nRun `npx pagefind --site public` in the site root directory after building.\n" -}}
|
||||
{{- end -}}
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
{{- end -}}
|
||||
|
||||
{{- /* FixIt theme version detection */ -}}
|
||||
{{- if eq .Site hugo.Sites.Default -}}
|
||||
{{- if .Site.Language.IsDefault -}}
|
||||
{{- if not .Site.Params.version -}}
|
||||
{{- errorf "FixIt %v\n%v\n\n" $version (T "init.configurationError") -}}
|
||||
{{- else if gt "0.2.0" (strings.TrimPrefix "v" .Site.Params.version) -}}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{{- hugo.Store.Set "version" "v1.0.0-mrizf1fk" -}}
|
||||
{{- hugo.Store.Set "version" "v1.0.0-mrj0ikh7" -}}
|
||||
{{- .Store.Set "this" dict -}}
|
||||
|
||||
{{- partial "init/detection-env.html" . -}}
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
-}}
|
||||
{{- $color := index $colorMap $type | default (index $colorMap "new") -}}
|
||||
{{- $repoName := .Get 3 | default $rvc.name -}}
|
||||
{{- $pathTemplate := cond hugo.IsMultilingual (printf "images/version/%%v-%%v.%v.svg" .Page.Language.Lang) "images/version/%v-%v.svg" -}}
|
||||
{{- $pathTemplate := cond hugo.IsMultilingual (printf "images/version/%%v-%%v.%v.svg" .Page.Language.Name) "images/version/%v-%v.svg" -}}
|
||||
{{- $path := printf $pathTemplate $version $type -}}
|
||||
{{- $resource := resources.Get "images/version.template.svg" -}}
|
||||
{{- $resource = $resource | resources.ExecuteAsTemplate $path (dict "version" $version "label" $label "color" $color "isCJK" $isCJK) | minify -}}
|
||||
|
||||
Reference in New Issue
Block a user