Hugo-based levitation.wales initial commit

This commit is contained in:
2026-09-04 13:48:04 +01:00
commit 74e7c4b3ed
55 changed files with 982 additions and 0 deletions
+20
View File
@@ -0,0 +1,20 @@
{{- /* Render data/collaborators.yaml, grouping by the single `past` flag. */ -}}
{{- $all := hugo.Data.collaborators -}}
{{- $current := where $all "past" "!=" true -}}
{{- $past := where $all "past" true -}}
<h2 id="collaborators">Collaborators</h2>
<ul>
{{- range $current }}
{{- $u := .url }}
<li>{{ if $u }}<a href="{{ $u }}">{{ end }}{{ .name }}{{ if $u }}</a>{{ end }}{{ with .affiliation }}, {{ . }}{{ end }}</li>
{{- end }}
</ul>
{{- with $past }}
<h2 id="wider-network">Wider network</h2>
<ul>
{{- range . }}
{{- $u := .url }}
<li>{{ if $u }}<a href="{{ $u }}">{{ end }}{{ .name }}{{ if $u }}</a>{{ end }}{{ with .affiliation }}, {{ . }}{{ end }}</li>
{{- end }}
</ul>
{{- end -}}
+5
View File
@@ -0,0 +1,5 @@
{{- /* Render the current person's `links` front matter as a small inline row.
Renders nothing if the page has no links. */ -}}
{{- with .Page.Params.links -}}
<p>{{ range $i, $l := . }}{{ if $i }} · {{ end }}<a href="{{ $l.url }}">{{ $l.name }}</a>{{ end }}</p>
{{- end -}}
+20
View File
@@ -0,0 +1,20 @@
{{- /* Build the roster from the member pages under /people. Each person's
status lives once, in their own front matter: set `alumnus: true`
for past members. */ -}}
{{- $people := (site.GetPage "/people").Pages -}}
{{- $current := where $people "Params.alumnus" "!=" true -}}
{{- $alumni := where $people "Params.alumnus" true -}}
<h2 id="group">Group</h2>
<ul>
{{- range $current.ByWeight }}
<li><a href="{{ .RelPermalink }}">{{ .Title }}</a>{{ with .Params.role }}, {{ . }}{{ end }}{{ with .Params.links }}{{ range . }} · <a href="{{ .url }}">{{ .name }}</a>{{ end }}{{ end }}</li>
{{- end }}
</ul>
{{- with $alumni }}
<h2 id="alumni">Alumni</h2>
<ul>
{{- range .ByWeight }}
<li><a href="{{ .RelPermalink }}">{{ .Title }}</a>{{ with .Params.role }}, {{ . }}{{ end }}{{ with .Params.links }}{{ range . }} · <a href="{{ .url }}">{{ .name }}</a>{{ end }}{{ end }}</li>
{{- end }}
</ul>
{{- end -}}
+11
View File
@@ -0,0 +1,11 @@
{{- /* List the child project pages of the section this shortcode is called
from, ordered by their `weight`. The bold link text is each page's
`linkTitle` (the acronym); the description is the page `title` with the
leading "ACRONYM: " stripped. Keeps this list in sync with the pages
(and hence the sidebar) so a new project is a one-file addition. */ -}}
<ul>
{{- range .Page.Pages.ByWeight }}
{{- $desc := replaceRE `^[^:]+:\s*` "" .Title -}}
<li><a href="{{ .RelPermalink }}"><strong>{{ .LinkTitle }}</strong></a>: {{ $desc }}</li>
{{- end }}
</ul>
+61
View File
@@ -0,0 +1,61 @@
{{- /* Render data/publications.yaml using the cached CSL-JSON in
data/citations/ (populated by `make citations`). Group members'
surnames are shown in bold. */ -}}
{{- /* Group surnames to embolden, taken from each /people page's `surname`
(current members and alumni alike) so the roster is the single source
of truth. Use ASCII surnames to match the CSL `family` names. */ -}}
{{- $group := slice -}}
{{- range (site.GetPage "/people").Pages -}}
{{- with .Params.surname -}}{{- $group = $group | append . -}}{{- end -}}
{{- end -}}
<ul class="pub-list">
{{- range hugo.Data.publications.papers -}}
{{- $note := .note -}}
{{- $arxiv := .arxiv -}}
{{- $fix := .fix -}}
{{- $key := .doi | lower | replaceRE "[^a-z0-9]" "_" -}}
{{- $c := index hugo.Data.citations $key -}}
{{- if $c -}}
{{- $names := slice -}}
{{- $groupExtra := slice -}}
{{- range $i, $a := $c.author -}}
{{- $ini := "" -}}
{{- range (split ($a.given | default "") " ") -}}
{{- $t := trim . " " -}}
{{- if gt (len $t) 0 -}}{{- $ini = printf "%s%s. " $ini (substr $t 0 1) -}}{{- end -}}
{{- end -}}
{{- $family := $a.family | default "" -}}
{{- with $fix -}}{{- with (index . $family) -}}{{- $family = . -}}{{- end -}}{{- end -}}
{{- $name := printf "%s%s" $ini $family -}}
{{- $isgroup := in $group $family -}}
{{- if $isgroup -}}{{- $name = printf "<strong>%s</strong>" $name -}}{{- end -}}
{{- $names = $names | append $name -}}
{{- if and $isgroup (gt $i 0) -}}{{- $groupExtra = $groupExtra | append $name -}}{{- end -}}
{{- end -}}
{{- /* Long author lists: first author + et al., still naming group members. */ -}}
{{- $authors := "" -}}
{{- if le (len $names) 10 -}}
{{- $authors = delimit $names ", " -}}
{{- else -}}
{{- $authors = printf "%s et al." (index $names 0) -}}
{{- with $groupExtra -}}{{- $authors = printf "%s, incl. %s" $authors (delimit . ", ") -}}{{- end -}}
{{- end -}}
{{- $year := "" -}}
{{- with $c.issued -}}{{- with (index . "date-parts") -}}{{- $year = index (index . 0) 0 -}}{{- end -}}{{- end -}}
{{- $container := index $c "container-title" -}}
{{- $art := or (index $c "article-number") (index $c "page") -}}
{{- $doi := $c.DOI -}}
<li>
{{ $authors | safeHTML }},
<em>{{ $c.title }}</em>,
{{- if $container }} {{ $container }}{{ with $c.volume }} <strong>{{ . }}</strong>{{ end }}{{ with $art }}, {{ . }}{{ end }}
{{- else }} arXiv:{{ replaceRE `(?i)^10\.48550/arxiv\.` "" $doi }}
{{- end }}
{{- with $year }} ({{ . }}){{ end }}.
<a href="https://doi.org/{{ $doi }}">doi:{{ $doi }}</a>{{ with $arxiv }} / <a href="https://arxiv.org/abs/{{ . }}">arXiv:{{ . }}</a>{{ end }}{{ with $note }} (<em>{{ . }}</em>){{ end }}
</li>
{{- else -}}
{{- warnf "publications: no cached citation for DOI %q (run: make citations)" .doi -}}
{{- end -}}
{{- end -}}
</ul>