Files
George Cushen 26c336eb6d feat(publications): improve structure + awards/funding/license metadata
Restructure `publication` frontmatter from a flat Markdown string into a
structured object (name, short_name, volume, issue, pages, publisher),
resolved through a new `functions/resolve_publication.html` partial that
also emits a per-page warning pointing legacy sites at `hugoblox migrate
publications`. APA/MLA citation rendering and the publication metadata
row both consume the resolver - no parsing of conventional Markdown
strings at render time.

Add work-level metadata fields surfaced via a new reusable
`components/award_badge.html` partial (variants: pill, card-corner,
inline, row; level-driven icon + colour tokens; pagefind filter):

- `awards[]` - name, level (winner/runner_up/honorable_mention/nominee/
  selected/featured), issuer, date, note, url; skim-row pills above the
  featured image, full row in the metadata grid, corner badges on card
  and slides-gallery views, inline marker on citation views, pill on
  date-title-summary
- `funding[]` - funder + grant + url, rendered as a metadata grid row
- `license` - SPDX-friendly string, metadata grid row
- `peer_reviewed`, `open_access` - status pills, decoupled from
  the publication block so preprints can surface them

Demo content updated in academic-cv (and the same shape in research-lab).
2026-05-27 03:53:21 +01:00

52 lines
1.8 KiB
HTML

{{ $item := .item }}
{{ $year_value := $item.Params.event_start | default $item.Date }}
{{ $year := (time $year_value).Format "2006" }}
{{ $has_attachments := partial "functions/has_attachments" $item }}
{{ $pub := partial "functions/resolve_publication.html" $item }}
{{ $top_award := "" }}
{{ with $item.Params.awards }}{{ $top_award = index . 0 }}{{ end }}
<div class="pub-list-item view-citation" style="margin-bottom: 1rem">
<i class="far fa-file-alt pub-icon" aria-hidden="true"></i>
{{/* APA Style */}}
{{ if eq (site.Params.hugoblox.content.citations.style | default "apa") "apa" }}
<span class="article-metadata li-cite-author">
{{ partial "page_metadata_authors" $item }}
</span>
({{- $year -}}).
<a href="{{ $item.RelPermalink }}" class="underline">{{ $item.Title }}</a>.
{{ with $pub.display_short }}{{- . | markdownify -}}.{{ end }}
{{ with $top_award }}
<span class="ml-1">{{ partial "components/award_badge.html" (dict "award" . "page" $item "variant" "inline") }}</span>
{{ end }}
{{ if $has_attachments }}
<div class="flex flex-wrap space-x-3">
{{ partial "page_links" (dict "page" $item "is_list" 1) }}
</div>
{{ end }}
{{/* MLA Style */}}
{{ else }}
<span class="article-metadata li-cite-author">
{{ partial "page_metadata_authors" $item }}.
</span>
<a href="{{ $item.RelPermalink }}">{{ $item.Title }}</a>.
{{ with $pub.display_short }}{{- . | markdownify -}},{{ end }}
{{- $year -}}.
{{ with $top_award }}
<span class="ml-1">{{ partial "components/award_badge.html" (dict "award" . "page" $item "variant" "inline") }}</span>
{{ end }}
{{ if $has_attachments }}
<div class="flex flex-wrap space-x-3">
{{ partial "page_links" (dict "page" $item "is_list" 1) }}
</div>
{{ end }}
{{ end }}
</div>