themes/default/templates/home.html
54 Zeilen · 2.0 KB · HTML
| 1 | {{define "title"}}{{.Site.Title}}{{end}} |
| 2 | {{define "content"}} |
| 3 | <div class="hero"> |
| 4 | <h1 class="hero-title">{{.Site.Title}}</h1> |
| 5 | <p class="hero-sub">{{.Site.Description}}</p> |
| 6 | </div> |
| 7 | <div class="post-list"> |
| 8 | {{range .Posts}} |
| 9 | <article class="post-card{{if .GetCover}} has-cover{{end}}"> |
| 10 | {{if .GetCover}} |
| 11 | <a href="/posts/{{.Slug}}/" class="post-card-cover"> |
| 12 | <img src="{{.GetCover}}" alt="{{.Title}}" loading="lazy"> |
| 13 | </a> |
| 14 | {{end}} |
| 15 | <div class="post-card-body"> |
| 16 | <div class="post-card-meta"> |
| 17 | <time datetime="{{isoDate .Date.Time}}">{{formatDate .Date.Time}}</time> |
| 18 | <div class="post-tags"> |
| 19 | {{range .Tags}}<a href="/tags/{{lower .}}/" class="tag">{{.}}</a>{{end}} |
| 20 | </div> |
| 21 | </div> |
| 22 | <h2 class="post-card-title"><a href="/posts/{{.Slug}}/">{{.Title}}</a></h2> |
| 23 | <p class="post-card-preview">{{.GetPreview}}</p> |
| 24 | <a href="/posts/{{.Slug}}/" class="read-more">Weiterlesen →</a> |
| 25 | </div> |
| 26 | </article> |
| 27 | {{end}} |
| 28 | </div> |
| 29 | {{if gt .TotalPages 1}} |
| 30 | <nav class="pagination"> |
| 31 | {{if gt .Page 1}} |
| 32 | <a href="{{pageURL (sub .Page 1)}}" class="pagination-btn pagination-prev">← Neuere</a> |
| 33 | {{else}} |
| 34 | <span class="pagination-btn pagination-prev disabled">← Neuere</span> |
| 35 | {{end}} |
| 36 | <div class="pagination-pages"> |
| 37 | {{range paginationRange $.Page $.TotalPages}} |
| 38 | {{if isEllipsis .}} |
| 39 | <span class="pagination-ellipsis">…</span> |
| 40 | {{else if eq . $.Page}} |
| 41 | <span class="pagination-num active">{{.}}</span> |
| 42 | {{else}} |
| 43 | <a href="{{pageURL .}}" class="pagination-num">{{.}}</a> |
| 44 | {{end}} |
| 45 | {{end}} |
| 46 | </div> |
| 47 | {{if lt .Page .TotalPages}} |
| 48 | <a href="{{pageURL (add .Page 1)}}" class="pagination-btn pagination-next">Ältere →</a> |
| 49 | {{else}} |
| 50 | <span class="pagination-btn pagination-next disabled">Ältere →</span> |
| 51 | {{end}} |
| 52 | </nav> |
| 53 | {{end}} |
| 54 | {{end}} |