mirror of
https://github.com/tiennm99/HugoBlox-kit.git
synced 2026-10-07 14:16:28 +00:00
- make taxonomy URLs singular, consistent with other Academic pages (workaround Hugo attempting to publish taxonomy URLs with plural names). This requires the breaking change below. - Fix extra space/lines appearing in the author cards underneath page content as reported at https://spectrum.chat/academic/help/publication-widget-adds-additional-lines-at-bottom-of-the-page~315f77d8-7cc8-44a9-a431-5b64b7556c53 BREAKING CHANGE: Rename `name` to `title` in author profiles within `author/` folder.
27 lines
740 B
HTML
27 lines
740 B
HTML
{{/* Get name of primary author. */}}
|
|
|
|
{{ $page := . }}
|
|
|
|
{{/* Get publisher as fall back. */}}
|
|
{{ $publisher := site.Params.org_name | default site.Title }}
|
|
|
|
{{ $author := "" }}
|
|
{{ $author_username := "" }}
|
|
|
|
{{ if and (not $page.Params.authors) ($page.Scratch.Get "superuser_username") }}
|
|
{{ $author_username = $page.Scratch.Get "superuser_username" }}
|
|
{{ else if $page.Params.authors }}
|
|
{{ $author = index $page.Params.authors 0 }}
|
|
{{ $author_username = urlize $author }}
|
|
{{ end }}
|
|
|
|
{{ $taxonomy := "authors" }}
|
|
{{ $profile_page := site.GetPage (printf "/%s/%s" $taxonomy $author_username) }}
|
|
{{ with $profile_page }}
|
|
{{ $author = .Title }}
|
|
{{ else }}
|
|
{{ $author = $author | default $publisher }}
|
|
{{ end }}
|
|
|
|
{{ return $author }}
|