Skip to content

Commit

Permalink
Footer copyright default to site title for authors
Browse files Browse the repository at this point in the history
  • Loading branch information
chalin committed Feb 8, 2024
1 parent c074d68 commit 41b29bc
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 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
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 41b29bc

Please sign in to comment.