From 756769d6d38e9b056a1f0705254eaa623a8bfbbb Mon Sep 17 00:00:00 2001 From: Attila Greguss Date: Tue, 17 Dec 2024 17:43:33 +0000 Subject: [PATCH] amend how the custom footer section is displayed --- exampleSite/content/docs/advanced/customization.md | 10 +++++----- layouts/partials/footer.html | 10 +++++----- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/exampleSite/content/docs/advanced/customization.md b/exampleSite/content/docs/advanced/customization.md index e37ee07..24b847d 100644 --- a/exampleSite/content/docs/advanced/customization.md +++ b/exampleSite/content/docs/advanced/customization.md @@ -62,18 +62,18 @@ You may add custom scripts to the end of the head for every page by adding the f layouts/partials/custom/head-end.html ``` -## Custom Footer +## Custom Footer Section -You can replace the footer completely - excluding the language and theme buttons - by creating a file `layouts/partials/custom/footer.html` in your site __and__ setting `custom: true` in the `footer` section of your `hugo.yaml`: +You can add a custom section the footer between the language/theme buttons and the Copyright/Powered By section by creating a file `layouts/partials/custom/footer.html` in your site __and__ setting `customSection: true` in the `footer` section of your `hugo.yaml`: ```yaml {filename="hugo.yaml"} footer: enable: true - custom: true - # These settings are ignored by the custom footer + customSection: true + # These settings are still respected displayCopyright: false displayPoweredBy: true - # This setting is respected by the custom footer + # This setting applies to the custom section with: "wide" ``` diff --git a/layouts/partials/footer.html b/layouts/partials/footer.html index c6de318..1e391b4 100644 --- a/layouts/partials/footer.html +++ b/layouts/partials/footer.html @@ -25,22 +25,22 @@ {{- end -}} {{- end -}} - {{- if .Site.Params.footer.custom -}} + {{- if .Site.Params.footer.customSection -}}
{{ partial "custom/footer.html" (dict "context" . "footerButtonColor" "hx-rounded-md hx-transition-colors hover:hx-bg-gray-100 hover:hx-text-gray-900 dark:hover:hx-bg-primary-100/5 dark:hover:hx-text-gray-50" ) }}
- {{- else -}} +
+ {{- end -}}
-
+
{{- if (.Site.Params.footer.displayPoweredBy | default true) }}
{{ template "theme-credit" $poweredBy }}
{{ end }} - {{- if .Site.Params.footer.displayCopyright }}
{{ $copyright | markdownify }}
{{ end }} + {{- if .Site.Params.footer.displayCopyright }}
{{ $copyright | markdownify }}
{{ end }}
- {{- end -}} {{- define "theme-credit" -}}