blob: c3425e5e618eef09811540a79bc5177d45618bee (
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
|
{{ define "loadshortcodes" }}
{{/*
Here Hugo is forced to cycle through all the items that will appear on
the page, effectively pre-rendering all their shortcodes. Afterwards,
when a shortcode contains a "css" or a "js" entry in their local
.Scratch variable, the content of this entry is merged to the content
of the corresponding entry in the global .Scratch variable.
*/}}
{{ $paginator := where site.RegularPages "Type" "in" site.Params.mainSections | .Paginate }}
{{ range $paginator.Pages }}
{{ with .Content }}{{ end }}
{{ with .Scratch.Get "css" }}
{{ . | merge ($.Scratch.Get "css") | $.Scratch.Set "css" }}
{{ end }}
{{ with .Scratch.Get "js" }}
{{ . | merge ($.Scratch.Get "js") | $.Scratch.Set "js" }}
{{ end }}
{{ end }}
{{ .Scratch.Set "paginator" $paginator }}
{{ end }}
{{ define "main" }}
{{ $paginator := .Scratch.Get "paginator" }}
{{ range $paginator.Pages }}
<article>
{{ partial "heading.html" . }}
{{ if site.Params.summaries }}
{{ .Summary }}
{{ if .Truncated }}
<p>
<a class="u-clickable" href="{{ .Permalink }}">Read More…</a>
</p>
{{ end }}
{{ else }}
{{ .Content }}
{{ end }}
{{ partial "tags.html" . }}
</article>
{{ with site.Params.divider }}<div class="Divider"></div>{{ end }}
{{ end }}
{{ partial "pagination.html" $paginator }}
{{ end }}
|