diff --git a/exampleSite/content/docs/advanced/customization.md b/exampleSite/content/docs/advanced/customization.md index af39dff..163ae2d 100644 --- a/exampleSite/content/docs/advanced/customization.md +++ b/exampleSite/content/docs/advanced/customization.md @@ -70,6 +70,11 @@ You can add a custom section the footer between the language/theme buttons and t ``` +Available variables in the footer section are: + +- `.aboveVisible`: `true` if the Language or Theme button(s) are visible above the footer along with a horizontal separator. +- `.belowVisible`: `true` if the Copyright or PoweredBy text are visible below the footer. + _Note: The custom footer inherits the default footer background color text color and the `width` setting in `hugo.yaml#footer` section._ ## Custom Layouts diff --git a/layouts/partials/footer.html b/layouts/partials/footer.html index bf3f4c7..1a6b9d2 100644 --- a/layouts/partials/footer.html +++ b/layouts/partials/footer.html @@ -1,5 +1,7 @@ {{- $enableFooterSwitches := .Scratch.Get "enableFooterSwitches" | default false -}} {{- $displayThemeToggle := site.Params.theme.displayToggle | default true -}} +{{- $footerSwitchesVisible := and $enableFooterSwitches (or hugo.IsMultilingual $displayThemeToggle) -}} +{{- $copyrightSectionVisible := or (.Site.Params.footer.displayPoweredBy | default true) .Site.Params.footer.displayCopyright -}} {{- $copyright := (T "copyright") | default "© 2024 Hextra." -}} {{- $poweredBy := (T "poweredBy") | default "Powered by Hextra" -}} @@ -15,7 +17,7 @@