2018-01-08 17:28:39 +01:00
|
|
|
{{ partial "header.html" . }}
|
|
|
|
{{ if not .IsHome }}
|
|
|
|
<header class="list-header">
|
|
|
|
{{ if eq .Data.Singular "tag" }}<span>Tagged in</span>
|
|
|
|
<h1 class="list-title">{{ .Data.Term }}</h1>
|
|
|
|
{{ else }}<h1 class="list-title">Posts</h1>
|
|
|
|
{{ end }}
|
|
|
|
</header>
|
|
|
|
{{ end }}
|
|
|
|
{{ $paginator := .Paginate (where .Pages ".Params.type" "!=" "page") (index .Site.Params "paginate" | default 10) }}
|
|
|
|
{{ if gt $paginator.TotalPages 0 }}
|
2018-04-19 16:03:25 +02:00
|
|
|
|
|
|
|
|
2018-01-08 17:28:39 +01:00
|
|
|
{{ range $index, $page := $paginator.Pages }}
|
2018-04-19 16:03:25 +02:00
|
|
|
|
2018-01-08 17:28:39 +01:00
|
|
|
{{ .Scratch.Set "postClass" "post-entry" }}
|
2018-04-19 16:03:25 +02:00
|
|
|
|
2018-01-08 17:28:39 +01:00
|
|
|
<article class="post {{ .Scratch.Get `postClass` }}">
|
|
|
|
<header class="post-header">
|
|
|
|
{{ safeHTML (.Scratch.Get `firstEmoji`) }}
|
2018-04-20 09:27:24 +02:00
|
|
|
<a href="{{ .Permalink }}"><h2 class="post-title">{{ .Title }}</h2></a>
|
|
|
|
<p class="post-meta">{{ .Date.Format "Jan 2, 2006" }} .
|
|
|
|
{{ with .Params.categories }}
|
|
|
|
{{ $categoriesLen := len . }}
|
|
|
|
{{ if gt $categoriesLen 0 }}
|
|
|
|
<span>{{ i18n "post.categorized_in" }}</span>
|
|
|
|
{{ range $k, $v := . }}
|
|
|
|
<a class="category-link" href="{{ . | printf "%s%s" "/categories/" | urlize | lower | relLangURL }}">{{ . }}</a>{{ if lt $k (sub $categoriesLen 1) }}, {{ end }}
|
|
|
|
{{ end }}
|
|
|
|
{{ end }}
|
|
|
|
{{ end }}
|
|
|
|
</p>
|
2018-01-08 17:28:39 +01:00
|
|
|
</header>
|
|
|
|
<p class="post-summary">{{ .Summary | plainify | htmlUnescape }}...</p>
|
|
|
|
<footer class="post-footer">
|
|
|
|
</footer>
|
2018-04-20 09:27:24 +02:00
|
|
|
<!-- <a class="post-link" href="{{ .Permalink }}"></a> -->
|
2018-01-08 17:28:39 +01:00
|
|
|
</article>
|
|
|
|
{{ end }}
|
|
|
|
{{ end }}
|
|
|
|
{{ if gt $paginator.TotalPages 1 }}
|
|
|
|
<footer class="list-footer">
|
|
|
|
<nav class="pagination">
|
|
|
|
{{ if $paginator.HasPrev }}
|
|
|
|
<a class="pagination-prev" href="{{ $paginator.Prev.URL }}">← 上一页</a>
|
|
|
|
{{ end }}
|
|
|
|
{{ if $paginator.HasNext }}
|
|
|
|
<a class="pagination-next" href="{{ $paginator.Next.URL }}">下一页 →</a>
|
|
|
|
{{ end }}
|
|
|
|
</nav>
|
|
|
|
</footer>
|
|
|
|
{{ end }}
|
|
|
|
{{ partial "footer.html" . }}
|