www.trr379.de/layouts/contributors/taxonomy.html
Michał Szczepanik fc73667af9
All checks were successful
Deploy on webserver / Build site and deploy on success (push) Successful in 4m17s
Split contributors into current and former
When linking to people, we need to deal with both attributions (not
timed) and associations (time-constrained).  Arguably, taxonomies are
good only for the former, as they represent a simple, unqualified
relation.

A contributor who left a project does not stop being a contributor in
a broader sense, they may get listed as a "former contributor" in a
project page but they should be shown as they were in a publication
page.

Changes made here try to keep Contributor as a taxonomy, while tuning
the Project (term) and Contributors (taxonomy) layouts to
differentiate between past and present contributors. This is done
based on details declared in the front matter.

For *project*, a new custom template is created, borrowing from the
existing contributor template. The loop showing links to other pages
is repeated. First, we loop across current and past contributors
declared explicitly in the page params (we first collect pages and
then do a range sorting by "sortkey" param). Then, we do the standard
term page loop over .Pages, only modified by adding a filter: where
section is not contributors.

For *all contributors*, a new custom template is created, using the
Congo's taxonomy template and repeating iteration over the terms
twice, with filtering.

This means we rely on more information being included as page params:

- `params.active` for contributor, representing their overall status
  with respect to TRR
- `params.current_contributors` & `params.past_contributors` for
  project

It's probably better to rely on an external process to implement the
classification logic and pass the result it in simple terms, rather
than implement it in Hugo.

It also makes sense for an external process to set the contributors
list in the project file (where it is being displayed) and the flag on
a person record, because that process will likely have access to all
the necessary associations when generating these pages. For the
overall TRR "active" role, a person could be treated as inactive with
all their project associations marked as ended (an edge case would be
no project association, a decision likely depends on whether we want
the person page to be more of a taxonomy listing or more of a project
association listing).

Regarding "all contributors": one issue with the approach is that the
parameter is set on /page/ but the taxonomy lists /terms/. This means,
in the absence of DE pages for contributors, we will have access to
the "active" parameter in EN but not DE. This will lead to different
listings. However, this is probably acceptable - several things are
currently missing from the DE version. In any case, here we make some
provisions for the DE implementation by using i18n strings in the
template.
2026-05-04 13:56:49 +00:00

72 lines
2.8 KiB
HTML

{{ define "main" }}
<header>
{{ if .Params.showBreadcrumbs | default (.Site.Params.list.showBreadcrumbs | default false) }}
{{ partial "breadcrumbs.html" . }}
{{ end }}
<h1 class="mt-0 text-4xl font-extrabold text-neutral-900 dark:text-neutral">{{ .Title }}</h1>
</header>
{{ if .Content }}
<section class="prose mt-0 flex max-w-full flex-col dark:prose-invert lg:flex-row">
<div class="min-h-0 min-w-0 max-w-prose grow">
{{ .Content | emojify }}
</div>
</section>
{{ end }}
{{ $showInactive := false }}
<section class="prose mt-0 flex max-w-full flex-col dark:prose-invert lg:flex-row">
<div class="min-h-0 min-w-0 max-w-prose grow">
{{ T "contributors_long" }}
</div>
</section>
<section class="-mx-2 flex flex-wrap overflow-hidden">
{{ range .Data.Terms }}
{{ if (and (isset .Page.Params "active") (not .Page.Params.active)) }}
{{/* explicit active=false -> skip & show later */}}
{{ $showInactive = true }}
{{ else }}
<article class="my-3 w-full overflow-hidden px-2 sm:w-1/2 md:w-1/3 lg:w-1/4 xl:w-1/5">
<h2 class="flex items-center">
<a
class="text-xl font-medium decoration-primary-500 hover:underline hover:underline-offset-2"
href="{{ .Page.Permalink }}"
>{{ .Page.Title }}</a>
{{ if $.Site.Params.taxonomy.showTermCount | default true }}
<span class="px-2 text-base text-primary-500">&middot;</span>
<span class="text-base text-neutral-400">
{{ .Count }}
</span>
{{ end }}
</h2>
</article>
{{ end }}
{{ end }}
</section>
{{ if $showInactive }}
<section class="prose mt-0 flex max-w-full flex-col dark:prose-invert lg:flex-row">
<div class="min-h-0 min-w-0 max-w-prose grow">
{{ T "past_contributors_long" }}
</div>
</section>
<section class="-mx-2 flex flex-wrap overflow-hidden">
{{ range .Data.Terms }}
{{ if (and (isset .Page.Params "active") (not .Page.Params.active)) }}
<article class="my-3 w-full overflow-hidden px-2 sm:w-1/2 md:w-1/3 lg:w-1/4 xl:w-1/5">
<h2 class="flex items-center">
<a
class="text-xl font-medium decoration-primary-500 hover:underline hover:underline-offset-2"
href="{{ .Page.Permalink }}"
>{{ .Page.Title }}</a>
{{ if $.Site.Params.taxonomy.showTermCount | default true }}
<span class="px-2 text-base text-primary-500">&middot;</span>
<span class="text-base text-neutral-400">
{{ .Count }}
</span>
{{ end }}
</h2>
</article>
{{ end }}
{{ end }}
</section>
{{ end }}
{{ end }}