Welcome to mirror list, hosted at ThFree Co, Russian Federation.

home.html « _default « layouts - github.com/de-souza/hugo-flex.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 5052769f9b39e62b60b4ca87b36fd6d51957308b (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.
*/}}
{{ $pag := where site.RegularPages "Type" "in" site.Params.mainSections | .Paginate }}
{{ range $pag.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" $pag }}

{{ end }}

{{ define "main" }}

{{ $pag := .Scratch.Get "paginator" }}
{{ range $pag.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" . }}

{{ end }}