blob: fefffe43b9c3a303af3467e4e489d30b571874ab (
plain)
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
39
40
41
42
43
44
45
46
|
<!DOCTYPE html>
<html>
{{ partial "header.html" . }}
<body>
<div class="container wrapper">
{{ partial "head.html" . }}
<div class="recent-posts section">
<h2 class="section-header">
Recent posts
</h2>
<div class="posts">
{{- $.Scratch.Set "counter" 0 -}}
{{- range .Data.Pages -}}
{{- if (in (.Site.Params.excludedTypes | default (slice "page")) .Type) -}}
{{- else -}}
{{- if lt ($.Scratch.Get "counter") (.Site.Params.RecentPostsCount | default 10) -}}
<div class="post">
<div class="meta">{{ dateFormat "Jan 2, 2006" .Date }}</div>
<a class="title" href="{{ .RelPermalink }}">{{.Title}}</a> —
<span class="description">
{{ if isset .Params "description" }}
{{ .Description }}
{{ else if gt (len .RawContent) 120 }}
{{ slicestr .RawContent 0 120 }}...
{{ else }}
{{ .RawContent }}
{{ end }}
</span>
</div>
{{- $.Scratch.Set "counter" (add ($.Scratch.Get "counter") 1) -}}
{{- end -}}
{{- end -}}
{{- end -}}
<a href="/posts">All articles →</a>
</div>
</div>
</div>
{{ partial "footer.html" . }}
{{ template "_internal/google_analytics_async.html" . }}
{{- with .Site.Params.Social -}}
<script>feather.replace()</script>
{{- end -}}
</body>
</html>
|