|
| 1 | +{{ define "main" }} |
| 2 | + {{ if .Content }} |
| 3 | + <div class="index-content {{ if .Params.framed -}}framed{{- end -}}"> |
| 4 | + {{ .Content }} |
| 5 | + </div> |
| 6 | + {{ end }} |
| 7 | + <div class="posts"> |
| 8 | + {{ $isntDefault := not (or (eq (trim $.Site.Params.contentTypeName " ") "posts") (eq (trim $.Site.Params.contentTypeName " ") "")) }} |
| 9 | + {{ $contentTypeName := cond $isntDefault (string $.Site.Params.contentTypeName) "posts" }} |
| 10 | + |
| 11 | + {{ $PageContext := . }} |
| 12 | + {{ if .IsHome }} |
| 13 | + {{ $PageContext = .Site }} |
| 14 | + {{ end }} |
| 15 | + {{ $allPages := (where $PageContext.RegularPages "Type" $contentTypeName).ByDate.Reverse }} |
| 16 | + {{ $paginator := .Paginate $allPages }} |
| 17 | + |
| 18 | + {{ range $paginator.Pages }} |
| 19 | + <article class="post on-list"> |
| 20 | + <h2 class="post-title"> |
| 21 | + <a href="{{ .Permalink }}">{{ .Title | markdownify }}</a> |
| 22 | + </h2> |
| 23 | + |
| 24 | + <div class="post-meta"> |
| 25 | + {{- if .Date -}} |
| 26 | + <time class="post-date"> |
| 27 | + {{- partial "post-date" . -}} |
| 28 | + </time> |
| 29 | + {{- end -}} |
| 30 | + {{- with .Params.Author -}} |
| 31 | + <span class="post-author">{{ . }}</span> |
| 32 | + {{- end -}} |
| 33 | + </div> |
| 34 | + |
| 35 | + {{ if .Params.tags }} |
| 36 | + <span class="post-tags"> |
| 37 | + {{ range .Params.tags }} |
| 38 | + #<a href="{{ (urlize (printf "tags/%s/" . )) | absLangURL }}"> |
| 39 | + {{- . -}} |
| 40 | + </a> |
| 41 | + {{ end }} |
| 42 | + </span> |
| 43 | + {{ end }} |
| 44 | + |
| 45 | + {{ partial "cover.html" . }} |
| 46 | + |
| 47 | + <div class="post-content"> |
| 48 | + {{ if .Params.showFullContent }} |
| 49 | + {{ .Content }} |
| 50 | + {{ else if .Description }} |
| 51 | + <p>{{ .Description | markdownify }}</p> |
| 52 | + {{ else }} |
| 53 | + {{ .Summary }} |
| 54 | + {{ end }} |
| 55 | + </div> |
| 56 | + |
| 57 | + {{ if not .Params.showFullContent }} |
| 58 | + <div> |
| 59 | + <a class="read-more button inline" href="{{ .RelPermalink }}">[{{ $.Site.Params.ReadMore }}]</a> |
| 60 | + </div> |
| 61 | + {{ end }} |
| 62 | + </article> |
| 63 | + {{ end }} |
| 64 | + |
| 65 | + {{ partial "pagination.html" . }} |
| 66 | + </div> |
| 67 | +{{ end }} |
0 commit comments