From fc73667af9a5594e9a1ade4c90c0fa09c31bd77d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Szczepanik?= Date: Wed, 15 Apr 2026 22:16:50 +0200 Subject: [PATCH] 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. --- content/contributors/_index.md | 2 - i18n/de.toml | 4 ++ i18n/en.toml | 4 ++ layouts/_default/project.html | 62 +++++++++++++++++++++++++ layouts/contributors/taxonomy.html | 72 ++++++++++++++++++++++++++++++ 5 files changed, 142 insertions(+), 2 deletions(-) create mode 100644 i18n/de.toml create mode 100644 i18n/en.toml create mode 100644 layouts/_default/project.html create mode 100644 layouts/contributors/taxonomy.html diff --git a/content/contributors/_index.md b/content/contributors/_index.md index 962a64a..864f3d0 100644 --- a/content/contributors/_index.md +++ b/content/contributors/_index.md @@ -15,5 +15,3 @@ as: - [Scientific Advisory Board]({{< relref "/roles/sab-member" >}}) - [Equal Opportunity Committee]({{< relref "/roles/eoc-member" >}}) - [Citizen Advisory Board]({{< relref "/roles/cab-member" >}}) - -The following individuals are contributing to this effort. diff --git a/i18n/de.toml b/i18n/de.toml new file mode 100644 index 0000000..3acb629 --- /dev/null +++ b/i18n/de.toml @@ -0,0 +1,4 @@ +contributors = "Beitragende" +contributors_long = "Die folgenden Personen leisten einen Beitrag zu diesem Projekt." +past_contributors = "ehemalige Beitragende" +past_contributors_long = "Die folgenden Personen haben früher zu diesem Projekt beigetragen." diff --git a/i18n/en.toml b/i18n/en.toml new file mode 100644 index 0000000..5171260 --- /dev/null +++ b/i18n/en.toml @@ -0,0 +1,4 @@ +contributors = "contributors" +contributors_long = "The following individuals are contributing to this effort." +past_contributors = "past contributors" +past_contributors_long = "The following individuals contributed to this effort previously." diff --git a/layouts/_default/project.html b/layouts/_default/project.html new file mode 100644 index 0000000..33fa16e --- /dev/null +++ b/layouts/_default/project.html @@ -0,0 +1,62 @@ +{{ define "main" }} +
+ {{ if .Params.showBreadcrumbs | default (.Site.Params.list.showBreadcrumbs | default false) }} + {{ partial "breadcrumbs.html" . }} + {{ end }} +

{{ .Title }}

+
+ {{ if .Content }} +
+
+ {{ .Content | emojify }} +
+
+ {{ end }} + +
+ {{ $cc := slice }} + {{ $pc := slice }} + {{ range .Params.current_contributors }}{{ with $.Site.GetPage . }}{{ $cc = $cc | append . }}{{ end }}{{ end }} + {{ range .Params.past_contributors }}{{ with $.Site.GetPage . }}{{ $pc = $pc | append . }}{{ end }}{{ end }} + {{ if $cc }} +

{{ T "contributors" | title }}

+
+ {{ range $cc.ByParam "sortkey" }} + {{ partial "article-link.html" . }} + {{ end }} + {{ end }} + {{ if $pc }} +

{{ T "past_contributors" | title }}

+
+ {{ range $pc.ByParam "sortkey" }} + {{ partial "article-link.html" . }} + {{ end }} + {{ end }} +
+ +
+ {{ $taxPages := where .Pages "Section" "ne" "contributors" }} + {{ if $taxPages }} +
+ {{ $groupedPages := $taxPages.GroupBy "Type" }} + {{ range (.Paginate $groupedPages).PageGroups }} +

+ {{ .Key | title }} +

+
+
+ {{ range .Pages.ByParam "sortkey" }} + {{ partial "article-link.html" . }} + {{ end }} +
+ {{ end }} +
+ {{ else }} +
+

+ {{ i18n "list.no_articles" | emojify }} +

+
+ {{ end }} +
+{{ end }} diff --git a/layouts/contributors/taxonomy.html b/layouts/contributors/taxonomy.html new file mode 100644 index 0000000..4b5a340 --- /dev/null +++ b/layouts/contributors/taxonomy.html @@ -0,0 +1,72 @@ +{{ define "main" }} +
+ {{ if .Params.showBreadcrumbs | default (.Site.Params.list.showBreadcrumbs | default false) }} + {{ partial "breadcrumbs.html" . }} + {{ end }} +

{{ .Title }}

+
+ {{ if .Content }} +
+
+ {{ .Content | emojify }} +
+
+ {{ end }} + {{ $showInactive := false }} +
+
+ {{ T "contributors_long" }} +
+
+
+ {{ range .Data.Terms }} + {{ if (and (isset .Page.Params "active") (not .Page.Params.active)) }} + {{/* explicit active=false -> skip & show later */}} + {{ $showInactive = true }} + {{ else }} +
+

+ {{ .Page.Title }} + {{ if $.Site.Params.taxonomy.showTermCount | default true }} + · + + {{ .Count }} + + {{ end }} +

+
+ {{ end }} + {{ end }} +
+ + {{ if $showInactive }} +
+
+ {{ T "past_contributors_long" }} +
+
+
+ {{ range .Data.Terms }} + {{ if (and (isset .Page.Params "active") (not .Page.Params.active)) }} +
+

+ {{ .Page.Title }} + {{ if $.Site.Params.taxonomy.showTermCount | default true }} + · + + {{ .Count }} + + {{ end }} +

+
+ {{ end }} + {{ end }} +
+ {{ end }} +{{ end }} -- 2.52.0