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 }} + + + +
+{{- 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 }}