diff options
| author | aethrvmn <me@aethrvmn.gr> | 2025-09-20 22:27:35 +0000 |
|---|---|---|
| committer | aethrvmn <me@aethrvmn.gr> | 2025-09-20 22:27:35 +0000 |
| commit | 9b5f3fad7068298265dbbc8a65077f7917a090a5 (patch) | |
| tree | 0905b29eb7c03d6bc6e16dd1ebcd1ec9b6b83320 /themes/hugo-book/layouts/posts | |
| parent | super simple setup guide (diff) | |
updated hugo-book theme
Diffstat (limited to 'themes/hugo-book/layouts/posts')
| -rw-r--r-- | themes/hugo-book/layouts/posts/list.html | 35 | ||||
| -rw-r--r-- | themes/hugo-book/layouts/posts/single.html | 8 |
2 files changed, 32 insertions, 11 deletions
diff --git a/themes/hugo-book/layouts/posts/list.html b/themes/hugo-book/layouts/posts/list.html index aff32f5..0d7df53 100644 --- a/themes/hugo-book/layouts/posts/list.html +++ b/themes/hugo-book/layouts/posts/list.html @@ -1,22 +1,39 @@ {{ 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 -}} - {{ if .Truncated }} - <a href="{{ .RelPermalink }}">...</a> - {{ end }} + <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 }} +{{ end }} - {{ template "_internal/pagination.html" . }} +{{ define "toc-container" }} +<aside class="book-toc"> + <div class="book-toc-content"> + {{ template "toc" . }} + </div> +</aside> {{ end }} {{ define "toc" }} {{ partial "docs/taxonomy" . }} {{ end }} + +{{ define "footer" }} + {{ partial "docs/pagination.html" . }} +{{ end }}
\ No newline at end of file diff --git a/themes/hugo-book/layouts/posts/single.html b/themes/hugo-book/layouts/posts/single.html index cebdd11..232e14e 100644 --- a/themes/hugo-book/layouts/posts/single.html +++ b/themes/hugo-book/layouts/posts/single.html @@ -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 }}
\ No newline at end of file |
