#692, #723: Redesign blog, add thumbnails support and pagination

This commit is contained in:
Alex Shpak
2025-09-18 10:12:03 +02:00
parent 2745893250
commit 6f472b3009
9 changed files with 103 additions and 24 deletions
+19 -7
View File
@@ -1,17 +1,25 @@
{{ define "main" }}
{{ range sort .Paginator.Pages }}
<article class="markdown book-post">
<article class="book-post markdown">
<h2>
<a href="{{ .RelPermalink }}">{{ partial "docs/title.html" . }}</a>
<a href="{{ .RelPermalink }}">{{ partial "docs/title" . }}</a>
</h2>
{{ partial "docs/post-meta" . }}
<div class="book-post-content">
{{- .Summary -}}
<div class="book-post-container flex gap">
<div>
{{ partial "docs/post-meta" . }}
<div class="book-post-content markdown-inner">
{{- .Summary | truncate 256 -}}
</div>
</div>
{{- $thumbnail := default "thumbnail.*" .Params.BookPostThumbnail -}}
{{- with or (.Resources.GetMatch $thumbnail) (resources.GetMatch $thumbnail) -}}
<div class="book-post-thumbnail">
<img src="{{ .RelPermalink }}" />
</div>
{{- end -}}
</div>
</article>
{{ end }}
{{ template "_internal/pagination.html" . }}
{{ end }}
{{ define "toc-container" }}
@@ -25,3 +33,7 @@
{{ define "toc" }}
{{ partial "docs/taxonomy" . }}
{{ end }}
{{ define "footer" }}
{{ partial "docs/pagination.html" . }}
{{ end }}
+6 -2
View File
@@ -1,10 +1,10 @@
{{ define "main" }}
<article class="markdown book-post">
<h1>
{{ partial "docs/title.html" . }}
{{ partial "docs/title" . }}
</h1>
{{ partial "docs/post-meta" . }}
<div class="book-post-content">
<div class="book-post-content markdown-inner">
{{- .Content -}}
</div>
</article>
@@ -13,3 +13,7 @@
{{ define "toc" }}
{{ partial "docs/toc" . }}
{{ end }}
{{ define "footer" }}
{{ partial "docs/post-prev-next" . }}
{{ end }}