fix: use hugo.IsMultilingual to replace deprecated .Site.IsMultiLingual (#404)

This commit is contained in:
Andreas Deininger 2024-05-29 10:11:25 +02:00 committed by GitHub
parent 857c4e4ca1
commit b2bc4f7098
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
7 changed files with 11 additions and 9 deletions

View File

@ -57,7 +57,7 @@ We recommend that you search existing [issues][issues] or discussions before ope
### Local development setup ### Local development setup
- [Hugo][hugo] >= v0.115.0 (extended version) - [Hugo][hugo] >= v0.124.0 (extended version)
- [Node.js][nodejs] - [Node.js][nodejs]
- [Go][go] - [Go][go]

View File

@ -31,7 +31,7 @@ jobs:
build: build:
runs-on: ubuntu-latest runs-on: ubuntu-latest
env: env:
HUGO_VERSION: 0.124.1 HUGO_VERSION: 0.126.1
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@v4 uses: actions/checkout@v4

View File

@ -20,7 +20,7 @@
{{- partial "language-switch.html" (dict "context" .) -}} {{- partial "language-switch.html" (dict "context" .) -}}
{{- with $displayThemeToggle }}{{ partial "theme-toggle.html" }}{{ end -}} {{- with $displayThemeToggle }}{{ partial "theme-toggle.html" }}{{ end -}}
</div> </div>
{{- if or site.IsMultiLingual $displayThemeToggle -}} {{- if or hugo.IsMultilingual $displayThemeToggle -}}
<hr class="dark:hx-border-neutral-800" /> <hr class="dark:hx-border-neutral-800" />
{{- end -}} {{- end -}}
{{- end -}} {{- end -}}

View File

@ -5,7 +5,7 @@
{{- $changeLanguage := (T "changeLanguage") | default "Change language" -}} {{- $changeLanguage := (T "changeLanguage") | default "Change language" -}}
{{- if site.IsMultiLingual -}} {{- if hugo.IsMultilingual -}}
<div class="hx-flex hx-justify-items-start {{ if $grow }}hx-grow{{ end }}"> <div class="hx-flex hx-justify-items-start {{ if $grow }}hx-grow{{ end }}">
<button <button
title="{{ $changeLanguage }}" title="{{ $changeLanguage }}"

View File

@ -43,9 +43,9 @@
{{ $switchesClass := cond $disableSidebar "md:hx-hidden" "" -}} {{ $switchesClass := cond $disableSidebar "md:hx-hidden" "" -}}
{{ $displayThemeToggle := (site.Params.theme.displayToggle | default true) -}} {{ $displayThemeToggle := (site.Params.theme.displayToggle | default true) -}}
{{ if or site.IsMultiLingual $displayThemeToggle }} {{ if or hugo.IsMultilingual $displayThemeToggle }}
<div class="{{ $switchesClass }} {{ with site.IsMultiLingual }}hx-justify-end{{ end }} hx-sticky hx-bottom-0 hx-bg-white dark:hx-bg-dark hx-mx-4 hx-py-4 hx-shadow-[0_-12px_16px_#fff] hx-flex hx-items-center hx-gap-2 dark:hx-border-neutral-800 dark:hx-shadow-[0_-12px_16px_#111] contrast-more:hx-border-neutral-400 contrast-more:hx-shadow-none contrast-more:dark:hx-shadow-none hx-border-t" data-toggle-animation="show"> <div class="{{ $switchesClass }} {{ with hugo.IsMultilingual }}hx-justify-end{{ end }} hx-sticky hx-bottom-0 hx-bg-white dark:hx-bg-dark hx-mx-4 hx-py-4 hx-shadow-[0_-12px_16px_#fff] hx-flex hx-items-center hx-gap-2 dark:hx-border-neutral-800 dark:hx-shadow-[0_-12px_16px_#111] contrast-more:hx-border-neutral-400 contrast-more:hx-shadow-none contrast-more:dark:hx-shadow-none hx-border-t" data-toggle-animation="show">
{{- with site.IsMultiLingual -}} {{- with hugo.IsMultilingual -}}
{{- partial "language-switch" (dict "context" $context "grow" true) -}} {{- partial "language-switch" (dict "context" $context "grow" true) -}}
{{- with $displayThemeToggle }}{{ partial "theme-toggle" (dict "hideLabel" true) }}{{ end -}} {{- with $displayThemeToggle }}{{ partial "theme-toggle" (dict "hideLabel" true) }}{{ end -}}
{{- else -}} {{- else -}}

View File

@ -7,4 +7,6 @@ command = "cd exampleSite && hugo --gc --minify --themesDir ../.. -b ${DEPLOY_PR
ignore = "false" ignore = "false"
[build.environment] [build.environment]
HUGO_VERSION = "0.117.0" HUGO_VERSION = "0.126.1"
GO_VERSION = "1.22.3"
NODE_VERSION = "22.2.0"

View File

@ -9,7 +9,7 @@ homepage = "https://github.com/imfing/hextra/"
demosite = "https://imfing.github.io/hextra/" demosite = "https://imfing.github.io/hextra/"
tags = ["Modern", "Elegant", "Blog", "Documentation", "Responsive", "Clean", "Light", "Dark", "Minimal"] tags = ["Modern", "Elegant", "Blog", "Documentation", "Responsive", "Clean", "Light", "Dark", "Minimal"]
features = ["Responsive", "Dark Mode", "Search", "Syntax Highlighting", "Multilingual", "Social", "Blog", "RSS", "Customization"] features = ["Responsive", "Dark Mode", "Search", "Syntax Highlighting", "Multilingual", "Social", "Blog", "RSS", "Customization"]
min_version = "0.111.0" min_version = "0.124.0"
[author] [author]
name = "Xin" name = "Xin"