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
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:
@@ -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
|
/* 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
|
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. */
|
sit flush against the first card. Matches the card-to-card gap. */
|
||||||
|
|||||||
65
site/layouts/index.html
Normal file
65
site/layouts/index.html
Normal 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 */ -}}
|
||||||
20
site/layouts/partials/breadcrumbs.html
Normal file
20
site/layouts/partials/breadcrumbs.html
Normal 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 -}}
|
||||||
@@ -30,6 +30,15 @@
|
|||||||
{{- end -}}
|
{{- end -}}
|
||||||
{{- $label_text -}}
|
{{- $label_text -}}
|
||||||
</a>
|
</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 }}
|
{{- end }}
|
||||||
|
|
||||||
{{- $lsenabled := (or (not site.Params.disableThemeToggle) (and (not site.Params.disableLangToggle) (hugo.IsMultilingual))) }}
|
{{- $lsenabled := (or (not site.Params.disableThemeToggle) (and (not site.Params.disableLangToggle) (hugo.IsMultilingual))) }}
|
||||||
@@ -100,16 +109,6 @@
|
|||||||
</li>
|
</li>
|
||||||
{{- end }}
|
{{- end }}
|
||||||
</ul>
|
</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 }}
|
{{- end }}
|
||||||
</nav>
|
</nav>
|
||||||
</header>
|
</header>
|
||||||
|
|||||||
Reference in New Issue
Block a user