From 69b2c06b2832238ab39dc5dda7ab431f7d6fa2a2 Mon Sep 17 00:00:00 2001 From: Vincent Lannurien Date: Mon, 17 Aug 2026 20:11:50 +0200 Subject: [PATCH] Show topics on the home page, name the current one in the header 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 --- site/assets/css/extended/custom.css | 41 ++++++++++++++++ site/layouts/index.html | 65 ++++++++++++++++++++++++++ site/layouts/partials/breadcrumbs.html | 20 ++++++++ site/layouts/partials/header.html | 19 ++++---- 4 files changed, 135 insertions(+), 10 deletions(-) create mode 100644 site/layouts/index.html create mode 100644 site/layouts/partials/breadcrumbs.html diff --git a/site/assets/css/extended/custom.css b/site/assets/css/extended/custom.css index df0275b..135fadb 100644 --- a/site/assets/css/extended/custom.css +++ b/site/assets/css/extended/custom.css @@ -15,6 +15,47 @@ } } +/* Current topic shown beside the site title. PaperMod's .logo a carries the + full title weight; the topic reads as a secondary breadcrumb. */ +.logo-sep { + margin: 0 6px; + color: var(--secondary); + font-size: 24px; + font-weight: 400; +} + +.logo .logo-topic { + font-size: 24px; + font-weight: 500; + color: var(--secondary); +} + +/* Topic cards on the home page. The stats line and the section shortcuts sit + inside PaperMod's .post-entry, whose ::before overlay swallows clicks, so the + shortcut links need to be lifted above it to stay clickable. */ +.topic-stats { + display: flex; + flex-wrap: wrap; + gap: 4px 16px; + margin: 8px 0 0; + padding: 0; + list-style: none; + font-size: 14px; + color: var(--secondary); +} + +.topic-links { + display: flex; + gap: 16px; + margin-top: 10px; + position: relative; + z-index: 1; +} + +.topic-links a { + box-shadow: 0 1px 0 var(--primary); +} + /* Intro copy above a list of cards. PaperMod gives .post-entry a bottom margin only, and .md-content zeroes its last child's, so the intro would otherwise sit flush against the first card. Matches the card-to-card gap. */ diff --git a/site/layouts/index.html b/site/layouts/index.html new file mode 100644 index 0000000..863ae78 --- /dev/null +++ b/site/layouts/index.html @@ -0,0 +1,65 @@ +{{- define "main" }} + +{{- if .Title }} + +{{- end }} + +{{- if .Content }} +
{{ .Content }}
+{{- 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 }} + +
+
+

{{ .title }}

+
+ {{- with .description }} +
+

{{ . }}

+
+ {{- end }} +
    +
  • {{ $confs }} conferences
  • +
  • {{ $journals }} journals
  • + {{- if $next }} +
  • next deadline {{ (time $next).Format "Jan 2, 2006" }} — {{ $nextTitle }}
  • + {{- end }} +
+
+ {{- range slice "venues" "calendar" "digests" }} + {{ . | title }} + {{- end }} +
+ +
+{{- end }} + +{{- end }}{{- /* end main */ -}} diff --git a/site/layouts/partials/breadcrumbs.html b/site/layouts/partials/breadcrumbs.html new file mode 100644 index 0000000..ecd8ba1 --- /dev/null +++ b/site/layouts/partials/breadcrumbs.html @@ -0,0 +1,20 @@ +{{- /* PaperMod's breadcrumbs start at Home and walk down every ancestor. The + header already shows " / ", 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 }} + +{{- end }} +{{- end -}} diff --git a/site/layouts/partials/header.html b/site/layouts/partials/header.html index d7d1242..7b49a62 100644 --- a/site/layouts/partials/header.html +++ b/site/layouts/partials/header.html @@ -30,6 +30,15 @@ {{- end -}} {{- $label_text -}} + {{- /* 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 }} + / + {{ .title }} + {{- end }} + {{- end }} {{- end }} {{- $lsenabled := (or (not site.Params.disableThemeToggle) (and (not site.Params.disableLangToggle) (hugo.IsMultilingual))) }} @@ -100,16 +109,6 @@ {{- end }} - {{- else }} - {{- end }}