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

index.html « layouts - github.com/de-souza/hugo-flex.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: af8e2c2ec599b69680360768584340a341cb8252 (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
47
{{ 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. These
  resources are then loaded in the head of the page from the global
  .Scratch variable (see layout baseof.html).
*/}}
{{ $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>
{{ end }}
{{ partial "pagination.html" $paginator }}

{{ end }}