Show topics on the home page, name the current one in the header
All checks were successful
Build and deploy static pages / build-and-push (push) Successful in 13s

The home page fell back to PaperMod's recursive page list, which dumped
digest pages instead of the research topics they belong to. Add a home
layout that renders one card per entry in data/topics.yaml, with venue
counts, the nearest upcoming deadline, and section shortcuts.

With the topics listed there, drop the topic menu from the header and
show the current topic beside the site title instead, so the selected
research area is visible from every page. The breadcrumbs then repeated
that prefix, so override the partial to start below the topic section.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
2026-08-17 20:11:50 +02:00
parent 7e26bc0613
commit 69b2c06b28
4 changed files with 135 additions and 10 deletions

65
site/layouts/index.html Normal file
View File

@@ -0,0 +1,65 @@
{{- define "main" }}
{{- if .Title }}
<header class="page-header">
<h1>{{ .Title }}</h1>
{{- if .Description }}
<div class="post-description">{{ .Description | markdownify }}</div>
{{- end }}
</header>
{{- end }}
{{- if .Content }}
<div class="md-content page-intro">{{ .Content }}</div>
{{- end }}
{{- /* The home page lists the research topics registered in data/topics.yaml,
not the site's pages: every content page lives under a topic, so the
default recursive list would dump raw digests here. */ -}}
{{- $now := now.Format "2006-01-02" }}
{{- range hugo.Data.topics.topics }}
{{- $slug := .slug }}
{{- $data := index site.Data $slug }}
{{- $confs := len ((and $data $data.venues) | default dict).conferences }}
{{- $journals := len ((and $data $data.venues) | default dict).journals }}
{{- /* Nearest still-upcoming deadline, taken from the calendar page's events
(already normalised to ISO dates by pa-generate). */ -}}
{{- $next := "" }}
{{- $nextTitle := "" }}
{{- with site.GetPage (printf "/%s/calendar" $slug) }}
{{- range .Params.events }}
{{- $start := printf "%v" .start }}
{{- if and (ge $start $now) (or (eq $next "") (lt $start $next)) }}
{{- $next = $start }}
{{- $nextTitle = .title }}
{{- end }}
{{- end }}
{{- end }}
<article class="post-entry topic-entry">
<header class="entry-header">
<h2>{{ .title }}</h2>
</header>
{{- with .description }}
<div class="entry-content">
<p>{{ . }}</p>
</div>
{{- end }}
<ul class="topic-stats">
<li><strong>{{ $confs }}</strong> conferences</li>
<li><strong>{{ $journals }}</strong> journals</li>
{{- if $next }}
<li>next deadline <strong>{{ (time $next).Format "Jan 2, 2006" }}</strong> — {{ $nextTitle }}</li>
{{- end }}
</ul>
<footer class="entry-footer topic-links">
{{- range slice "venues" "calendar" "digests" }}
<a href="{{ printf "%s/%s/" $slug . | relURL }}">{{ . | title }}</a>
{{- end }}
</footer>
<a class="entry-link" aria-label="{{ .title }}" href="{{ printf "%s/" $slug | relURL }}"></a>
</article>
{{- end }}
{{- end }}{{- /* end main */ -}}

View File

@@ -0,0 +1,20 @@
{{- /* PaperMod's breadcrumbs start at Home and walk down every ancestor. The
header already shows "<site title> / <topic>", so the first two crumbs
would repeat it: drop the home page and the topic section, and render
nothing at all when that leaves the trail empty. */ -}}
{{- if (.Param "ShowBreadCrumbs") -}}
{{- $ancestors := .Ancestors.Reverse -}}
{{- $crumbs := slice -}}
{{- if gt (len $ancestors) 2 }}{{- $crumbs = after 2 $ancestors }}{{- end -}}
{{- if $crumbs }}
<nav class="breadcrumbs" role="navigation" aria-label="Breadcrumb">
{{- range $crumbs }}
<a href="{{ .RelPermalink }}">{{ .Title }}</a>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
stroke-linecap="round" stroke-linejoin="round" class="feather feather-chevron-right">
<polyline points="9 18 15 12 9 6"></polyline>
</svg>
{{- end }}
</nav>
{{- end }}
{{- end -}}

View File

@@ -30,6 +30,15 @@
{{- end -}}
{{- $label_text -}}
</a>
{{- /* Inside a topic, name it next to the site title so the current
research area is visible from every page. */ -}}
{{- $section := .Section }}
{{- range hugo.Data.topics.topics }}
{{- if eq .slug $section }}
<span class="logo-sep">/</span>
<a class="logo-topic" href="{{ printf "%s/" .slug | relURL }}" title="{{ .title }}">{{ .title }}</a>
{{- end }}
{{- end }}
{{- end }}
{{- $lsenabled := (or (not site.Params.disableThemeToggle) (and (not site.Params.disableLangToggle) (hugo.IsMultilingual))) }}
@@ -100,16 +109,6 @@
</li>
{{- end }}
</ul>
{{- else }}
<ul id="menu" class="menu">
{{- range hugo.Data.topics.topics }}
<li>
<a href="{{ printf "%s/" .slug | relURL }}" title="{{ .title }}">
<span>{{ .title }}</span>
</a>
</li>
{{- end }}
</ul>
{{- end }}
</nav>
</header>