Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Footer copyright default to site title for authors #1851

Merged
merged 2 commits into from
Feb 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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