From 635a73315be5fd17e1afebd035de52c2613e6a10 Mon Sep 17 00:00:00 2001 From: Yann Soubeyrand Date: Fri, 21 Apr 2023 11:26:45 +0200 Subject: [PATCH] layouts: split footer partial in several partials This allows to more easily override some parts of the footer. Signed-off-by: Yann Soubeyrand --- layouts/partials/footer-center.html | 5 +++++ layouts/partials/footer-left.html | 5 +++++ layouts/partials/footer-links.html | 9 +++++++++ layouts/partials/footer-right.html | 5 +++++ layouts/partials/footer.html | 31 +++-------------------------- 5 files changed, 27 insertions(+), 28 deletions(-) create mode 100644 layouts/partials/footer-center.html create mode 100644 layouts/partials/footer-left.html create mode 100644 layouts/partials/footer-links.html create mode 100644 layouts/partials/footer-right.html diff --git a/layouts/partials/footer-center.html b/layouts/partials/footer-center.html new file mode 100644 index 000000000..e3bd94dee --- /dev/null +++ b/layouts/partials/footer-center.html @@ -0,0 +1,5 @@ +{{ with .Site.Params.copyright }}© {{ now.Year}} {{ .}} {{ T "footer_all_rights_reserved" }}{{ end }} +{{ with .Site.Params.privacy_policy }}{{ T "footer_privacy_policy" }}{{ end }} +{{ if not .Site.Params.ui.footer_about_disable -}} + {{ with .Site.GetPage "about" }}

{{ .Title }}

{{ end }} +{{ end }} diff --git a/layouts/partials/footer-left.html b/layouts/partials/footer-left.html new file mode 100644 index 000000000..3ea503e59 --- /dev/null +++ b/layouts/partials/footer-left.html @@ -0,0 +1,5 @@ +{{ with .Site.Params.links }} +{{ with index . "user" }} +{{ partial "footer-links.html" . }} +{{ end }} +{{ end }} diff --git a/layouts/partials/footer-links.html b/layouts/partials/footer-links.html new file mode 100644 index 000000000..27dd192a2 --- /dev/null +++ b/layouts/partials/footer-links.html @@ -0,0 +1,9 @@ + diff --git a/layouts/partials/footer-right.html b/layouts/partials/footer-right.html new file mode 100644 index 000000000..5269257a3 --- /dev/null +++ b/layouts/partials/footer-right.html @@ -0,0 +1,5 @@ +{{ with .Site.Params.links }} +{{ with index . "developer" }} +{{ partial "footer-links.html" . }} +{{ end }} +{{ end }} diff --git a/layouts/partials/footer.html b/layouts/partials/footer.html index 5ee524fd1..d12f10c76 100644 --- a/layouts/partials/footer.html +++ b/layouts/partials/footer.html @@ -1,40 +1,15 @@ -{{ $links := .Site.Params.links -}}
- {{ with $links }} - {{ with index . "user" }} - {{ template "footer-links-block" . }} - {{ end }} - {{ end }} + {{ partial "footer-left.html" . }}
- {{ with $links }} - {{ with index . "developer" }} - {{ template "footer-links-block" . }} - {{ end }} - {{ end }} + {{ partial "footer-right.html" . }}
- {{ with .Site.Params.copyright }}© {{ now.Year}} {{ .}} {{ T "footer_all_rights_reserved" }}{{ end }} - {{ with .Site.Params.privacy_policy }}{{ T "footer_privacy_policy" }}{{ end }} - {{ if not .Site.Params.ui.footer_about_disable -}} - {{ with .Site.GetPage "about" }}

{{ .Title }}

{{ end }} - {{ end }} + {{ partial "footer-center.html" . }}
- -{{- define "footer-links-block" }} - -{{ end -}}