mirror of
https://github.com/imfing/hextra.git
synced 2025-05-13 07:06:58 -04:00
Compare commits
5 Commits
797b485c9b
...
e3d29ca81a
Author | SHA1 | Date | |
---|---|---|---|
![]() |
e3d29ca81a | ||
![]() |
1a5a34b00c | ||
![]() |
13e11d59d2 | ||
![]() |
aa557df8aa | ||
![]() |
869731e9de |
@ -1155,6 +1155,9 @@ video {
|
|||||||
.hx-pb-px {
|
.hx-pb-px {
|
||||||
padding-bottom: 1px;
|
padding-bottom: 1px;
|
||||||
}
|
}
|
||||||
|
.hx-pl-\[max\(env\(safe-area-inset-left\)\,0rem\)\] {
|
||||||
|
padding-left: max(env(safe-area-inset-left),0rem);
|
||||||
|
}
|
||||||
.hx-pl-\[max\(env\(safe-area-inset-left\)\,1\.5rem\)\] {
|
.hx-pl-\[max\(env\(safe-area-inset-left\)\,1\.5rem\)\] {
|
||||||
padding-left: max(env(safe-area-inset-left),1.5rem);
|
padding-left: max(env(safe-area-inset-left),1.5rem);
|
||||||
}
|
}
|
||||||
@ -1170,6 +1173,9 @@ video {
|
|||||||
.hx-pr-\[max\(env\(safe-area-inset-left\)\,1\.5rem\)\] {
|
.hx-pr-\[max\(env\(safe-area-inset-left\)\,1\.5rem\)\] {
|
||||||
padding-right: max(env(safe-area-inset-left),1.5rem);
|
padding-right: max(env(safe-area-inset-left),1.5rem);
|
||||||
}
|
}
|
||||||
|
.hx-pr-\[max\(env\(safe-area-inset-right\)\,0rem\)\] {
|
||||||
|
padding-right: max(env(safe-area-inset-right),0rem);
|
||||||
|
}
|
||||||
.hx-pr-\[max\(env\(safe-area-inset-right\)\,1\.5rem\)\] {
|
.hx-pr-\[max\(env\(safe-area-inset-right\)\,1\.5rem\)\] {
|
||||||
padding-right: max(env(safe-area-inset-right),1.5rem);
|
padding-right: max(env(safe-area-inset-right),1.5rem);
|
||||||
}
|
}
|
||||||
|
@ -64,24 +64,18 @@ layouts/partials/custom/head-end.html
|
|||||||
|
|
||||||
## Custom Footer Section
|
## 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"}
|
```html {filename="layouts/partials/custom/footer.html"}
|
||||||
footer:
|
<!-- Your footer element here -->
|
||||||
enable: true
|
|
||||||
customSection: true
|
|
||||||
# These settings are still respected
|
|
||||||
displayCopyright: false
|
|
||||||
displayPoweredBy: true
|
|
||||||
# This setting applies to the custom section
|
|
||||||
with: "wide"
|
|
||||||
```
|
```
|
||||||
|
|
||||||
Variables available in the footer are:
|
Available variables in the footer section are:
|
||||||
|
|
||||||
- `{{ .footerButtonColor }}` - The color/background color of a footer button
|
- `.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 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
|
## Custom Layouts
|
||||||
|
|
||||||
|
@ -431,12 +431,14 @@
|
|||||||
"hx-pb-8",
|
"hx-pb-8",
|
||||||
"hx-pb-[env(safe-area-inset-bottom)]",
|
"hx-pb-[env(safe-area-inset-bottom)]",
|
||||||
"hx-pb-px",
|
"hx-pb-px",
|
||||||
|
"hx-pl-[max(env(safe-area-inset-left),0rem)]",
|
||||||
"hx-pl-[max(env(safe-area-inset-left),1.5rem)]",
|
"hx-pl-[max(env(safe-area-inset-left),1.5rem)]",
|
||||||
"hx-pointer-events-none",
|
"hx-pointer-events-none",
|
||||||
"hx-pr-2",
|
"hx-pr-2",
|
||||||
"hx-pr-4",
|
"hx-pr-4",
|
||||||
"hx-pr-[calc(env(safe-area-inset-right)-1.5rem)]",
|
"hx-pr-[calc(env(safe-area-inset-right)-1.5rem)]",
|
||||||
"hx-pr-[max(env(safe-area-inset-left),1.5rem)]",
|
"hx-pr-[max(env(safe-area-inset-left),1.5rem)]",
|
||||||
|
"hx-pr-[max(env(safe-area-inset-right),0rem)]",
|
||||||
"hx-pr-[max(env(safe-area-inset-right),1.5rem)]",
|
"hx-pr-[max(env(safe-area-inset-right),1.5rem)]",
|
||||||
"hx-pt-4",
|
"hx-pt-4",
|
||||||
"hx-pt-6",
|
"hx-pt-6",
|
||||||
|
0
layouts/partials/custom/footer.html
Normal file
0
layouts/partials/custom/footer.html
Normal file
@ -1,5 +1,7 @@
|
|||||||
{{- $enableFooterSwitches := .Scratch.Get "enableFooterSwitches" | default false -}}
|
{{- $enableFooterSwitches := .Scratch.Get "enableFooterSwitches" | default false -}}
|
||||||
{{- $displayThemeToggle := site.Params.theme.displayToggle | default true -}}
|
{{- $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." -}}
|
{{- $copyright := (T "copyright") | default "© 2024 Hextra." -}}
|
||||||
{{- $poweredBy := (T "poweredBy") | default "Powered by Hextra" -}}
|
{{- $poweredBy := (T "poweredBy") | default "Powered by Hextra" -}}
|
||||||
@ -15,7 +17,7 @@
|
|||||||
|
|
||||||
|
|
||||||
<footer class="hextra-footer hx-bg-gray-100 hx-pb-[env(safe-area-inset-bottom)] dark:hx-bg-neutral-900 print:hx-bg-transparent">
|
<footer class="hextra-footer hx-bg-gray-100 hx-pb-[env(safe-area-inset-bottom)] dark:hx-bg-neutral-900 print:hx-bg-transparent">
|
||||||
{{- if and $enableFooterSwitches (or hugo.IsMultilingual $displayThemeToggle) -}}
|
{{- if $footerSwitchesVisible -}}
|
||||||
<div class="hx-mx-auto hx-flex hx-gap-2 hx-py-2 hx-px-4 {{ $footerWidth }}">
|
<div class="hx-mx-auto hx-flex hx-gap-2 hx-py-2 hx-px-4 {{ $footerWidth }}">
|
||||||
{{- 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 -}}
|
||||||
@ -24,15 +26,12 @@
|
|||||||
<hr class="dark:hx-border-neutral-800" />
|
<hr class="dark:hx-border-neutral-800" />
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
|
|
||||||
{{- if .Site.Params.footer.customSection -}}
|
|
||||||
<div
|
<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"
|
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" (dict "context" . "aboveVisible" $footerSwitchesVisible "belowVisible" $copyrightSectionVisible ) }}
|
||||||
</div>
|
</div>
|
||||||
<hr class="dark:hx-border-neutral-800" />
|
{{- if $copyrightSectionVisible -}}
|
||||||
{{- end -}}
|
|
||||||
<div
|
<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"
|
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"
|
||||||
>
|
>
|
||||||
@ -41,6 +40,7 @@
|
|||||||
{{- if .Site.Params.footer.displayCopyright }}<div class="hx-text-xs">{{ $copyright | markdownify }}</div>{{ end }}
|
{{- if .Site.Params.footer.displayCopyright }}<div class="hx-text-xs">{{ $copyright | markdownify }}</div>{{ end }}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
{{- end -}}
|
||||||
</footer>
|
</footer>
|
||||||
|
|
||||||
{{- define "theme-credit" -}}
|
{{- define "theme-credit" -}}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user