Remove context variable and flag in hugo.yaml

This commit is contained in:
Attila Greguss 2024-12-18 10:30:34 +00:00
parent 797b485c9b
commit 869731e9de
3 changed files with 5 additions and 20 deletions

View File

@ -64,24 +64,13 @@ layouts/partials/custom/head-end.html
## Custom Footer Section
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`:
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.
```yaml {filename="hugo.yaml"}
footer:
enable: true
customSection: true
# These settings are still respected
displayCopyright: false
displayPoweredBy: true
# This setting applies to the custom section
with: "wide"
```html {filename="layouts/partials/custom/footer.html"}
<!-- Your footer element here -->
```
Variables available in the footer are:
- `{{ .footerButtonColor }}` - The color/background color of a footer button
_Note: The custom footer inherits the default footer background color and text color._
_Note: The custom footer inherits the default footer background color text color and the `width` setting in `hugo.yaml#footer` section._
## Custom Layouts

View File

View File

@ -24,15 +24,11 @@
<hr class="dark:hx-border-neutral-800" />
{{- end -}}
{{- end -}}
{{- if .Site.Params.footer.customSection -}}
<div
class="{{ $footerWidth }} hx-pl-[max(env(safe-area-inset-left),0rem)] hx-pr-[max(env(safe-area-inset-right),0rem)] hx-text-gray-600 dark:hx-text-gray-400"
>
{{ 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" ) }}
{{ partial "custom/footer.html" . }}
</div>
<hr class="dark:hx-border-neutral-800" />
{{- end -}}
<div
class="{{ $footerWidth }} hx-mx-auto hx-flex hx-justify-center hx-py-12 hx-pl-[max(env(safe-area-inset-left),1.5rem)] hx-pr-[max(env(safe-area-inset-right),1.5rem)] hx-text-gray-600 dark:hx-text-gray-400 md:hx-justify-start"
>