mirror of
https://github.com/imfing/hextra.git
synced 2025-06-19 09:54:10 -04:00
feat: support custom footer section (#518)
* Add support for custom footer * amend how the custom footer section is displayed * Add missing class * add missing class * Remove context variable and flag in hugo.yaml * update hugo_stats * Only show footer section for copyright and PoweredBy if they are enabled * Add missing compiled css * Added necessary variables for correct styling of the custom footer in some cases * make padding consistent for copyright section and custom footer * chore: update css * chore: clean up css * docs: update customization instructions * fix: footer padding --------- Co-authored-by: Xin <xin@imfing.com>
This commit is contained in:
@ -119,6 +119,7 @@ The following classes can be used to customize various parts of the theme.
|
||||
#### Footer
|
||||
|
||||
- `hextra-footer` - The footer element
|
||||
- `hextra-custom-footer` - The custom footer section container
|
||||
|
||||
#### Search
|
||||
|
||||
@ -184,6 +185,21 @@ 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 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.
|
||||
|
||||
```html {filename="layouts/partials/custom/footer.html"}
|
||||
<!-- Your footer element here -->
|
||||
```
|
||||
|
||||
Available variables in the footer section are:
|
||||
|
||||
- `.switchesVisible`: `true` if the language/theme button(s) are visible above the footer along with a horizontal separator.
|
||||
- `.copyrightVisible`: `true` if the "Copyright" and "Powered By" text are visible at the bottom of 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
|
||||
|
||||
The layouts of the theme can be overridden by creating a file with the same name in the `layouts` directory of your site.
|
||||
|
@ -228,6 +228,7 @@
|
||||
"hextra-code-block",
|
||||
"hextra-code-copy-btn",
|
||||
"hextra-code-copy-btn-container",
|
||||
"hextra-custom-footer",
|
||||
"hextra-feature-card",
|
||||
"hextra-feature-grid",
|
||||
"hextra-filetree",
|
||||
|
Reference in New Issue
Block a user