From c93ee1c21a95cd2d770ec7a4f752870d7ff24451 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.html | 39 +++-------------------------- layouts/partials/footer/center.html | 11 ++++++++ layouts/partials/footer/left.html | 5 ++++ layouts/partials/footer/links.html | 9 +++++++ layouts/partials/footer/right.html | 5 ++++ 5 files changed, 34 insertions(+), 35 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.html b/layouts/partials/footer.html index b652549f2f..1bda7e9486 100644 --- a/layouts/partials/footer.html +++ b/layouts/partials/footer.html @@ -1,46 +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" . }}
- -{{- define "footer-links-block" }} - -{{ end -}} diff --git a/layouts/partials/footer/center.html b/layouts/partials/footer/center.html new file mode 100644 index 0000000000..0654746d7b --- /dev/null +++ b/layouts/partials/footer/center.html @@ -0,0 +1,11 @@ +{{ 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" -}} + +{{- end -}} +{{ end }} diff --git a/layouts/partials/footer/left.html b/layouts/partials/footer/left.html new file mode 100644 index 0000000000..2f093d4b21 --- /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 0000000000..0d84f4e1dd --- /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 0000000000..57cf429573 --- /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 }}