1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
{{ $paginator := .Paginate (where .Data.Pages.ByDate.Reverse "Type" "post") }}
{{ range $paginator.Pages }}
<article class="post-card post">
{{if .Params.image}}
<a class="post-card-image-link" href="{{ .Permalink }}">
<div class="post-card-image" style="background-image: url({{.Params.image | absURL}})"></div>
</a>
{{else}}
<a class="post-card-image-link" href="{{ .Permalink }}">
<div class="post-card-image" style="background-image: url({{$.Site.BaseURL}}defimg/{{ index (seq 7 | shuffle) 0 }}.jpg)"></div>
</a>
{{end}}
<div class="post-card-content">
<a class="post-card-content-link" href="{{ .Permalink }}">
<header class="post-card-header">
{{if .Params.tags }}<span class="post-card-tags">{{ range $index, $tag := .Params.tags }}
#{{$tag}} {{end}} </span>
{{ end }}
<h2 class="post-card-title">{{.Title}}</h2>
</header>
<section class="post-card-excerpt">
{{ if .Description }}
<p>{{ .Description | markdownify }}</p>
{{else}}
<p>{{ .Summary | plainify | safeHTML }}{{ if .Truncated }} ... {{end}} </p>
{{end}}
</section>
</a>
<footer class="post-card-meta">
<img class="author-profile-image" src="{{ (.Params.authorAvatar | default .Site.Params.authorAvatar) | absURL}}" alt="Author" />
<span class="post-card-author"><a href="/">{{.Params.author | default .Site.Params.author}}</a></span>
</footer>
</div>
</article>
{{ end }}