Skip to content

Commit

Permalink
Footer copyright default to site title for authors (google#1851)
Browse files Browse the repository at this point in the history
  • Loading branch information
chalin authored Feb 8, 2024
1 parent 612f0c5 commit 621fb34
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ For details concerning all footer changes, see [#1818].
- Hugo config option `params.copyright`, previously a string, can now also be
a map with the following optional fields: `authors`, `from_year`, `to_year`.
When unset, `to_year` defaults to the year that the site built. The default
`authors` is "Site Authors" and this field is rendered as markdown.
`authors` is "<Site.Title> Authors" and this field is rendered as markdown.
- If `params.copyright` is unset, then the [site `copyright`] option will be
used and rendered as markdown, "as is" &mdash; with no year is added.

Expand Down
2 changes: 1 addition & 1 deletion layouts/partials/footer/center.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

{{ if ne .Site.Params.ui.footer_about_disable nil -}}
{{ warnf "Config parameter '.params.ui.footer_about_disable' is DEPRECATED, use '.params.ui.footer_about_enable' instead." -}}
{{ end }}
{{ end -}}

{{ if or .Site.Params.ui.footer_about_enable (eq .Site.Params.ui.footer_about_disable false) -}}
{{ with .Site.GetPage "about" -}}
Expand Down
4 changes: 3 additions & 1 deletion layouts/partials/footer/copyright.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@
{{- end -}}
{{ $toYear | default now.Year }}
<span class="td-footer__authors">
{{- $authors | default "Site Authors" | $page.RenderString -}}
{{- $authors
| default (printf "%s Authors" ($.Site.Title | default "Site"))
| $page.RenderString -}}
</span>
{{- /* Trim WS */ -}}
</span>
Expand Down

0 comments on commit 621fb34

Please sign in to comment.