Don't re-print the name of series when listing pages

Signed-off-by: Danila Fedorin <danila.fedorin@gmail.com>
This commit is contained in:
Danila Fedorin 2024-06-16 19:41:27 -07:00
parent b282843b40
commit a4bff7623d
2 changed files with 8 additions and 2 deletions

View File

@ -1,5 +1,11 @@
<li> <li>
<a href="{{ .page.Permalink }}" class="post-title">{{ if .page.Params.favorite }}{{ partial "icon.html" "star" }}{{ end }} {{ .page.Title }}</a> {{- $scratch := newScratch -}}
{{- if .seriesName -}}
{{- partial "nameinseries" (dict "page" .page "scratch" $scratch) -}}
{{- else -}}
{{- $scratch.Set "name" (.page.Title) -}}
{{- end -}}
<a href="{{ .page.Permalink }}" class="post-title">{{ if .page.Params.favorite }}{{ partial "icon.html" "star" }}{{ end }} {{ $scratch.Get "name" }}</a>
{{ if (not (eq .page.WordCount 0)) }} {{ if (not (eq .page.WordCount 0)) }}
<p class="post-wordcount">{{ i18n "nWords" .page.WordCount }}, {{ i18n "nMinutesToRead" .page.ReadingTime }}.</p> <p class="post-wordcount">{{ i18n "nWords" .page.WordCount }}, {{ i18n "nMinutesToRead" .page.ReadingTime }}.</p>
{{ end }} {{ end }}

View File

@ -11,7 +11,7 @@
<ul class="post-list"> <ul class="post-list">
{{ range $pages }} {{ range $pages }}
{{ partial "post.html" (dict "page" .) }} {{ partial "post.html" (dict "page" . "seriesName" true) }}
{{ end }} {{ end }}
</ul> </ul>
{{ end }} {{ end }}