Some checks failed
Deploy on webserver / Build site and deploy on success (push) Failing after 1s
This commit introduces the process for individual publication term page generation, which includes a new jinja template and workflow. Since 'publications' is a taxonomy, the workflow renders the term page at 'content/publications/pub-pid/_index.md'. For the same reason, the (more) correct html template to use would be 'publications/taxonomy.html' instead of 'publications/list.html' (which is actually the fallback), hence the replacement. Since, individual publication metadata are included in each individual term page front matter, the taxonomy page has been updated to grab that metadata instead of reading the json object from 'data/publications.json'. This also allows the associated workflow to be dropped. A new 'publication-item' partial is introduced to allow better control over the rendering of individual items in the publication list on the taxonomy page. This intentionally shifts the rendering that was previously done in JS code to Hugo templating. Because hugo only runs the rendering on app build, the searching/filtering approach had to be changed so that all publications are rendered by default and required items are hidden depending on the filtering options selected or search terms entered. This is done in updated JS code, by assigning 'display: none' when applicable. Other JS additions include: - adding a count of filtered items - a new 'Clear all' button for clearing filters - allowing Topic pills to be clicked in order to add filter options TODO: customize the publications term page template for improved individual publication display.
47 lines
No EOL
1.8 KiB
HTML
47 lines
No EOL
1.8 KiB
HTML
{{ define "main" }}
|
|
<header>
|
|
{{ if .Params.showBreadcrumbs | default (.Site.Params.list.showBreadcrumbs | default false) }}
|
|
{{ partial "breadcrumbs.html" . }}
|
|
{{ end }}
|
|
<h1 class="mt-0 text-4xl font-extrabold text-neutral-900 dark:text-neutral">{{ .Title }}</h1>
|
|
</header>
|
|
<article class="prose max-w-full dark:prose-invert">
|
|
<div class="pub-layout">
|
|
<!-- Sidebar -->
|
|
<aside class="filters-panel">
|
|
<button onclick="clearAllFilters()" class="clear-button mt-2 text-sm text-primary-600 hover:underline">
|
|
Clear all
|
|
</button>
|
|
<div class="filter-block">
|
|
<strong>Kind</strong>
|
|
<div id="filter-kind" class="filter-group"></div>
|
|
</div>
|
|
|
|
<div class="filter-block">
|
|
<strong>Topic</strong>
|
|
<div id="filter-topic" class="filter-group"></div>
|
|
</div>
|
|
|
|
<div class="filter-block">
|
|
<strong>Year</strong>
|
|
<div id="filter-year" class="filter-group"></div>
|
|
</div>
|
|
</aside>
|
|
<!-- Main rendered content -->
|
|
<div class="results-panel">
|
|
<input type="text" id="search" placeholder="Search publications..." class="search-bar" /> <span id="pub-count"></span>
|
|
<!-- Data -->
|
|
{{ $pubPages := where .Site.Pages "Section" "publications" }}
|
|
{{ $pubPagesTerms := where $pubPages "Kind" "term" }}
|
|
<div id="results">
|
|
{{ range $i, $p := $pubPagesTerms }}
|
|
{{ partial "publication-item.html" $p }}
|
|
{{ end }}
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<!-- JS + CSS -->
|
|
<script src="/publications.js"></script>
|
|
<link rel="stylesheet" href="/publications.css">
|
|
</article>
|
|
{{ end }} |