Skip to content

Commit

Permalink
♻️ Refactor: deprecate .Site.IsMultiLingual in favor of hugo.IsMultil…
Browse files Browse the repository at this point in the history
…ingual

.Site.IsMultiLingual was deprecated in Hugo v0.124.0 and will be removed in a future release. Use hugo.IsMultilingual
  • Loading branch information
Lruihao committed Jul 4, 2024
1 parent 44d0c76 commit 061a3e3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions layouts/partials/header.html
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@
<li class="menu-item theme-switch" title="{{ T "header.switchTheme" }}">
{{ dict "Class" "fa-solid fa-adjust fa-fw" | partial "plugin/icon.html" }}
</li>
{{- if .Site.IsMultiLingual -}}
{{- if hugo.IsMultilingual -}}
<li class="menu-item language-switch">
<span role="button" aria-label="{{ T "header.selectLanguage" }}" title="{{ T "header.selectLanguage" }}">
{{- dict "Class" "fa-solid fa-language fa-fw" | partial "plugin/icon.html" -}}
Expand Down Expand Up @@ -276,7 +276,7 @@
{{- end -}}
<li class="menu-item menu-system">
<span class="menu-system-item theme-switch" title="{{ T "header.switchTheme" }}">{{ dict "Class" "fa-solid fa-adjust fa-fw" | partial "plugin/icon.html" }}</span>
{{- if .Site.IsMultiLingual -}}
{{- if hugo.IsMultilingual -}}
<span class="menu-system-item language-switch">
<span role="button" aria-label="{{ T "header.selectLanguage" }}" title="{{ T "header.selectLanguage" }}">
{{- .Language.LanguageName -}}
Expand Down
2 changes: 1 addition & 1 deletion layouts/shortcodes/version.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
{{- $type := .Get 1 | default "new" | lower -}}
{{- $label := T (printf "version.%v" $type) -}}
{{- $color := cond (eq $type "changed") "ff9101" "00b1ff" | cond (eq $type "deleted") "ff5252" -}}
{{- $pathTemplate := cond .Site.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.Lang) "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" .Page.Params.IsCJKLanguage) | minify -}}
Expand Down

0 comments on commit 061a3e3

Please sign in to comment.