Skip to content

Commit

Permalink
Footer: factor out copyright, and code cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
chalin committed Feb 2, 2024
1 parent 9352504 commit fc4a9c8
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 20 deletions.
5 changes: 4 additions & 1 deletion CHANGELOG.md
Expand Up @@ -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].

Expand All @@ -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/
Expand Down
18 changes: 9 additions & 9 deletions layouts/partials/footer/center.html
@@ -1,11 +1,11 @@
{{ with .Site.Params.copyright -}}
<span>&copy; {{ now.Year }} {{ . }} {{ T "footer_all_rights_reserved" }}</span>
{{- end }}
{{ partial "footer/copyright.html" . -}}

{{ with .Site.Params.privacy_policy -}}
<span class="ms-1"><a href="{{ . }}" target="_blank" rel="noopener">{{ T "footer_privacy_policy" }}</a></span>
{{- end }}
{{ if not .Site.Params.ui.footer_about_disable -}}
{{ with .Site.GetPage "about" -}}
<p class="td-footer__about mt-2"><a href="{{ .RelPermalink }}">{{ .Title }}</a></p>
<span class="ms-2"><a href="{{ . }}" target="_blank" rel="noopener">{{ T "footer_privacy_policy" }}</a></span>
{{- end -}}
{{ end }}

{{ if not .Site.Params.ui.footer_about_disable -}}
{{ with .Site.GetPage "about" -}}
<p class="td-footer__about mt-2"><a href="{{ .RelPermalink }}">{{ .Title }}</a></p>
{{- end -}}
{{ end -}}
3 changes: 3 additions & 0 deletions layouts/partials/footer/copyright.html
@@ -0,0 +1,3 @@
{{ with .Site.Params.copyright -}}
<span>&copy; {{ now.Year }} {{ . }} {{ T "footer_all_rights_reserved" }}</span>
{{- end -}}
10 changes: 5 additions & 5 deletions 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 -}}
10 changes: 5 additions & 5 deletions 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 -}}

0 comments on commit fc4a9c8

Please sign in to comment.