Reimplement display of series

This commit is contained in:
Jez Cope 2021-04-11 18:46:47 +01:00
parent e056229575
commit c3621e7017
6 changed files with 44 additions and 8 deletions

View File

@ -188,3 +188,6 @@ h6, .content h6
ul
@extend .menu-list
#current
font-weight: bold

View File

@ -1,2 +1,6 @@
<time>{{ .Date.Format .Site.Params.DateFormat }}</time>
<div class="page-date">
<strong>Date:</strong>
<time>{{ .Date.Format .Site.Params.DateFormat }}</time>
</div>
{{ partial "series.html" .Params.series }}
{{ partial "tags.html" .Params.tags }}

View File

@ -12,6 +12,7 @@
{{ partial "status" . }}
</div>
<div class="column is-8">
{{ partial "series-items" . }}
{{ partial "toc" . }}
<div class="content">
{{ .Content }}

View File

@ -0,0 +1,27 @@
{{ $page := . }}
{{ with .Params.series }}
{{ $series := (site.GetPage "/series").GetPage . }}
<div class="card mb-5">
<header class="card-header has-background-primary has-text-white">
<p class="card-header-title has-text-white">
Series
</p>
</header>
<div class="card-content content is-size-7">
{{ with $series.Params.on }}
<p>This post is part of <a href="{{ $series.RelPermalink }}">a series on {{.}}</a>.</p>
{{ else }}
<p>This post is part of the series <a href="{{ $series.RelPermalink }}" class="has-text-white">{{ $series.Title }}</a></p>
{{ end }}
<ul>
{{ range $series.Pages }}
<li>
{{ if ne . $page }}<a href="{{ .RelPermalink }}">{{ else }}<span id="current">&gt; {{ end }}
{{ .Title }}
{{ if ne . $page }}</a>{{ else }} &lt;</span>{{ end }}
</li>
{{ end }}
</ul>
</div>
</div>
{{ end }}

View File

@ -0,0 +1,7 @@
{{ with . }}
{{ $series := (site.GetPage "/series").GetPage . }}
<div>
<strong>Series:</strong>
<a href="{{ $series.RelPermalink }}">{{ $series.Title }}</a>
</div>
{{ end }}

View File

@ -1,10 +1,4 @@
<li>
<a href="{{ .RelPermalink }}">
{{- with index .Site.Data.series .Data.Term }}
{{ .title }}
{{ else }}
{{ .Title }}
{{ end -}}
({{ .Data.series | len }} posts)</a>
<a href="{{ .RelPermalink }}">{{ .Title }} ({{ .Data.series | len }} posts)</a>
{{- with .Params.summary }}: {{.}}{{ end }}
</li>