Skip to content

Commit

Permalink
fix: hugo deprecation features
Browse files Browse the repository at this point in the history
  • Loading branch information
HEIGE-PCloud committed Sep 16, 2024
1 parent c0b2464 commit 38df51c
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 7 deletions.
2 changes: 0 additions & 2 deletions exampleSite/config/_default/hugo.en.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,5 @@ languageCode = "en"
languageName = "English"
# whether to include Chinese/Japanese/Korean
hasCJKLanguage = false
# default amount of posts in each pages
paginate = 12
# copyright description used only for seo schema
copyright = "This work is licensed under a Creative Commons Attribution-NonCommercial 4.0 International License."
2 changes: 0 additions & 2 deletions exampleSite/config/_default/hugo.zh-cn.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,5 @@ languageCode = "zh-CN"
languageName = "简体中文"
# 是否包括中日韩文字
hasCJKLanguage = true
# 默认每页列表显示的文章数目
paginate = 12
# 版权描述,仅仅用于 SEO
copyright = "This work is licensed under a Creative Commons Attribution-NonCommercial 4.0 International License."
2 changes: 2 additions & 0 deletions exampleSite/config/_default/pagination.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# The number of pages per pager
pagerSize = 12
4 changes: 2 additions & 2 deletions layouts/partials/header.html
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
{{- if .Site.Menus.main -}}
<span class="menu-item delimiter"></span>
{{- end -}}
{{- if .Site.IsMultiLingual -}}
{{- if hugo.IsMultilingual -}}
<button class="menu-item language" {{ printf "aria-label=%q" (T "selectLanguage") | safeHTMLAttr }}>
{{- .Language.LanguageName -}}
{{ partial "plugin/fontawesome.html" (dict "Style" "solid" "Icon" "chevron-right") }}
Expand Down Expand Up @@ -181,7 +181,7 @@
{{ partial "plugin/fontawesome.html" (dict "Style" "solid" "Icon" "adjust") }}
</button>
{{- end -}}
{{- if .Site.IsMultiLingual -}}
{{- if hugo.IsMultilingual -}}
<button class="menu-item tw-w-full" title="{{ T " selectLanguage" }}">
{{- .Language.LanguageName -}}
{{ partial "plugin/fontawesome.html" (dict "Style" "solid" "Icon" "chevron-right") }}
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 $type -}}
{{- $color := cond (eq $type "changed") "ff9101" "00b1ff" | cond (eq $type "deleted") "ff5252" -}}
{{- $pathTemplate := cond .Site.IsMultiLingual (printf "svg/version/%%v-%%v.%v.svg" .Page.Language.Lang) "svg/version/%v-%v.svg" -}}
{{- $pathTemplate := cond hugo.IsMultilingual (printf "svg/version/%%v-%%v.%v.svg" .Page.Language.Lang) "svg/version/%v-%v.svg" -}}
{{- $path := printf $pathTemplate $version $type -}}
{{- $resource := resources.Get "svg/version.template.svg" -}}
{{- $resource = $resource | resources.ExecuteAsTemplate $path (dict "version" $version "label" $label "color" $color) | minify -}}
Expand Down

0 comments on commit 38df51c

Please sign in to comment.