mirror of
https://github.com/tiennm99/HugoBlox-kit.git
synced 2026-10-13 02:14:21 +00:00
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).
37 lines
2.1 KiB
HTML
37 lines
2.1 KiB
HTML
{{ $item := .item }}
|
|
{{ $page := .page }}
|
|
{{ $summary := partial "functions/get_summary" $item }}
|
|
{{ $summary = $summary | page.RenderString }}
|
|
{{ $displayDate := .item.Params.event_start | default .item.Date }}
|
|
<article class="md:grid md:grid-cols-4 md:items-baseline">
|
|
<div class="md:col-span-3 group relative flex flex-col items-start">
|
|
<h2 class="text-base font-semibold tracking-tight text-zinc-800 dark:text-zinc-100">
|
|
<div
|
|
class="absolute -inset-x-4 -inset-y-6 z-0 scale-95 bg-zinc-50 opacity-0 transition group-hover:scale-100 group-hover:opacity-100 dark:bg-zinc-800/50 sm:-inset-x-6 sm:rounded-2xl"></div>
|
|
<a href="{{$item.RelPermalink}}"><span
|
|
class="absolute -inset-x-4 -inset-y-6 z-20 sm:-inset-x-6 sm:rounded-2xl"></span><span class="relative z-10">{{$item.Title}}</span></a>
|
|
</h2>
|
|
{{ with $item.Params.awards }}
|
|
<div class="relative z-10 mt-2">
|
|
{{ partial "components/award_badge.html" (dict "award" (index . 0) "page" $item "variant" "pill") }}
|
|
</div>
|
|
{{ end }}
|
|
<time
|
|
class="md:hidden relative z-10 order-first mb-3 flex items-center text-sm text-zinc-400 dark:text-zinc-500 pl-1"
|
|
datetime="{{ time.Format "2006-01-02" $displayDate }}">
|
|
{{ time.Format (site.Params.hugoblox.locale.date_format | default ":date_long") $displayDate }}
|
|
</time>
|
|
<p class="relative z-10 mt-2 text-sm text-zinc-600 dark:text-zinc-400 line-clamp-3">{{$summary}}</p>
|
|
<div aria-hidden="true" class="relative z-10 mt-4 flex items-center text-sm font-medium text-primary-500">
|
|
{{ T "read_more" | default "Read more" }}
|
|
<svg aria-hidden="true" class="ml-1 h-4 w-4 stroke-current" fill="none" viewBox="0 0 16 16">
|
|
<path d="M6.75 5.75 9.25 8l-2.5 2.25" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"></path>
|
|
</svg>
|
|
</div>
|
|
</div>
|
|
<time
|
|
class="mt-1 hidden md:block relative z-10 order-first mb-3 flex items-center text-sm text-zinc-400 dark:text-zinc-500"
|
|
datetime="{{ time.Format "2006-01-02" $displayDate }}">{{ time.Format (site.Params.hugoblox.locale.date_format | default ":date_long") $displayDate }}
|
|
</time>
|
|
</article>
|