Blog: List page with summary and pagination

This commit is contained in:
jtbx 2023-10-08 00:13:18 +02:00
commit 171fa015f1
14 changed files with 282 additions and 53 deletions

View file

@ -6,7 +6,6 @@
<ul>
{{ range .Pages }}
<!-- TODO: Content summary -->
<li>
<a href="{{ .Permalink }}"><span style="font-variant-numeric: tabular-nums;">{{ .Date.Format "2006-01-02" }}</span> | {{ .Title }}</a>
</li>

View file

@ -0,0 +1,13 @@
<article>
{{- partial "blog-header.html" (dict "subitem" true "page" . ) }}
{{- if in .RawContent "<!--more-->" }}
{{ .Summary | safeHTML }}
{{- else }}
<p>{{ .Summary | safeHTML }}</p>
{{- end }}
{{- if .Truncated }}
<div class="morelink"><a href="{{ .RelPermalink }}">mehr...</a></div>
{{- end }}
</article>

View file

@ -4,13 +4,9 @@
<h1>{{ .Parent.Title }}: {{ .Title }}</h1>
</header>
<ul>
{{ range .Pages }}
<!-- TODO: Content summary -->
<li>
<a href="{{ .Permalink }}"><span style="font-variant-numeric: tabular-nums;">{{ .Date.Format "2006-01-02" }}</span> | {{ .Title }}</a>
</li>
{{ end }}
</ul>
{{- range .Pages }}
{{ .Render "summary" }}
{{- end }}
<!-- TODO: Pagination: see https://gohugo.io/templates/pagination/ -->
</main>
{{ end }}

View file

@ -6,11 +6,9 @@
<section>
<ul>
{{ range .Pages }}
<li>
<a href="{{ .Permalink }}">{{ .Title }}</a>
</li>
{{ end }}
{{- range .Pages }}
<li><a href="{{ .Permalink }}">{{ .Title }}</a></li>
{{- end }}
</ul>
</section>
</main>