From fc4a9c8c8a4ef5537ae883af525d0b9c42646f8c Mon Sep 17 00:00:00 2001 From: Patrice Chalin Date: Fri, 2 Feb 2024 10:30:01 -0500 Subject: [PATCH] Footer: factor out copyright, and code cleanup --- CHANGELOG.md | 5 ++++- layouts/partials/footer/center.html | 18 +++++++++--------- layouts/partials/footer/copyright.html | 3 +++ layouts/partials/footer/left.html | 10 +++++----- layouts/partials/footer/right.html | 10 +++++----- 5 files changed, 26 insertions(+), 20 deletions(-) create mode 100644 layouts/partials/footer/copyright.html diff --git a/CHANGELOG.md b/CHANGELOG.md index 0907049350..eb5c8b3f8a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -44,7 +44,9 @@ For the full list of changes, see the [0.9.0] release notes. **Other changes**: -- The latest release of [Mermaid] resources are fetch at build time ([#1410]) +- The footer parts can be individually customized: left, right, center, and + copyright. ([#1818]). +- The latest release of [Mermaid] resources are fetched at build time ([#1410]). - Docsy follows recommended accessibility practice: page-body links are underlined. For details, see [#1814] and [#1815]. @@ -53,6 +55,7 @@ For the full list of changes, see the [0.9.0] release notes. [#1744]: https://github.com/google/docsy/pull/1744 [#1814]: https://github.com/google/docsy/issues/1814 [#1815]: https://github.com/google/docsy/pull/1815 +[#1818]: https://github.com/google/docsy/pull/1818 [mermaid]: https://www.docsy.dev/docs/adding-content/diagrams-and-formulae/#diagrams-with-mermaid [multi-language]: https://www.docsy.dev/docs/language/ diff --git a/layouts/partials/footer/center.html b/layouts/partials/footer/center.html index 0654746d7b..46335abe59 100644 --- a/layouts/partials/footer/center.html +++ b/layouts/partials/footer/center.html @@ -1,11 +1,11 @@ -{{ with .Site.Params.copyright -}} -© {{ now.Year }} {{ . }} {{ T "footer_all_rights_reserved" }} -{{- end }} +{{ partial "footer/copyright.html" . -}} + {{ with .Site.Params.privacy_policy -}} -{{ T "footer_privacy_policy" }} -{{- end }} -{{ if not .Site.Params.ui.footer_about_disable -}} -{{ with .Site.GetPage "about" -}} - + {{ T "footer_privacy_policy" }} {{- end -}} -{{ end }} + +{{ if not .Site.Params.ui.footer_about_disable -}} + {{ with .Site.GetPage "about" -}} + + {{- end -}} +{{ end -}} diff --git a/layouts/partials/footer/copyright.html b/layouts/partials/footer/copyright.html new file mode 100644 index 0000000000..ac6527c68c --- /dev/null +++ b/layouts/partials/footer/copyright.html @@ -0,0 +1,3 @@ +{{ with .Site.Params.copyright -}} + © {{ now.Year }} {{ . }} {{ T "footer_all_rights_reserved" }} +{{- end -}} diff --git a/layouts/partials/footer/left.html b/layouts/partials/footer/left.html index 2f093d4b21..ed9265f4c2 100644 --- a/layouts/partials/footer/left.html +++ b/layouts/partials/footer/left.html @@ -1,5 +1,5 @@ -{{ with .Site.Params.links }} -{{ with index . "user" }} -{{ partial "footer/links.html" . }} -{{ end }} -{{ end }} +{{ with .Site.Params.links -}} + {{ with index . "user" -}} + {{- partial "footer/links.html" . -}} + {{ end -}} +{{ end -}} diff --git a/layouts/partials/footer/right.html b/layouts/partials/footer/right.html index 57cf429573..3afc3d2744 100644 --- a/layouts/partials/footer/right.html +++ b/layouts/partials/footer/right.html @@ -1,5 +1,5 @@ -{{ with .Site.Params.links }} -{{ with index . "developer" }} -{{ partial "footer/links.html" . }} -{{ end }} -{{ end }} +{{ with .Site.Params.links -}} + {{ with index . "developer" -}} + {{- partial "footer/links.html" . -}} + {{ end -}} +{{ end -}}