-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathindex.html
executable file
·48 lines (39 loc) · 1.53 KB
/
index.html
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
47
48
{{ define "main" }}
<article class="cf">
<div class="fl w-100 w-20-ns ph0 ph0-ns pv1 f4 left lh-copy sidebar">
{{ partial "sidebar.html" . }}
</div>
{{ $mainSections := .Site.Params.mainSections | default (slice "post") }}
{{ $section := where .Site.RegularPages "Section" "in" $mainSections }}
{{ $section_count := len $section }}
{{ if ge $section_count 1 }}
{{ $section_name := index (.Site.Params.mainSections) 0 }}
<div class="fl ph1 ph1-ns pv5 w-100 w-70-ns center">
{{ $n_posts := $.Param "recent_posts_number" | default 100 }}
<section class="w-100 mw8">
{{ range (first $n_posts $section) }}
<div class="relative w-100 mb4">
{{ partial "summary.html" . }}
</div>
{{ end }}
</section>
{{ if ge $section_count (add $n_posts 1) }}
<section class="w-100">
<h1 class="f3">{{ i18n "more" }}</h1>
{{/* Now, range through the next four after the initial $n_posts items. Nest the requirements, "after" then "first" on the outside */}}
{{ range (first 4 (after $n_posts $section)) }}
<h2 class="f5 fw4 mb4 dib mr3">
<a href="{{ .URL }}" class="link black dim">
{{ .Title }}
</a>
</h2>
{{ end }}
{{ with .Site.GetPage "section" $section_name }}
<a href="{{ .URL }}" class="link db f6 pa2 br3 bg-mid-gray white dim w4 tc">{{ i18n "allTitle" . }}</a>
{{ end }}
</section>
{{ end }}
</div>
</article>
{{ end }}
{{ end }}