summaryrefslogtreecommitdiff
path: root/layouts/home.html
blob: 86c1fa147fc689c24a812d343db667cb01c41b0a (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
{{ define "main" }}
  {{ .Content }}
  {{ $mainSections := .Site.Params.mainSections | default (slice "posts" "post" "blog" "notes") }}
  {{ $pages := where .Site.RegularPages "Section" "in" $mainSections }}
  {{ if $pages }}
    <h2>Recent Notes</h2>
    {{ range $pages }}
      <section>
        <h3><a href="{{ .RelPermalink }}">{{ .LinkTitle }}</a></h3>
        <p><small>{{ .Date.Format "2006-01-02" }}</small></p>
        {{ .Summary }}
      </section>
    {{ end }}
  {{ else }}
    {{ $allPages := where .Site.AllPages "Kind" "page" }}
    {{ if $allPages }}
      <h2>All Pages</h2>
      {{ range $allPages }}
        <section>
          <h3><a href="{{ .RelPermalink }}">{{ .LinkTitle }}</a></h3>
          <p><small>{{ .Date.Format "2006-01-02" }} | {{ .Section }}</small></p>
          {{ .Summary }}
        </section>
      {{ end }}
    {{ end }}
  {{ end }}

  {{ partial "components/h-card" . }}
{{ end }}