summaryrefslogtreecommitdiffstats
path: root/layouts/page.html
blob: 09cf39fcd35457aa5e02f27d1f72ad6b9e72bb3e (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
{{ define "main" }}
  <article class="page-page">
    <div class="container-narrow">
      <h1>{{ .Title }}</h1>
      <div class="post-card-meta" style="margin-bottom: 2rem;">
        <span>{{ dateFormat "Jan 2, 2006" .Date }}</span>
        {{ if .Params.type }}<span class="post-type-badge {{ .Params.type }}">{{ .Params.type }}</span>{{ end }}
      </div>

      <div class="post-content">
        {{ .Content }}
      </div>
    </div>
  </article>

  {{ if eq .Type "is" }}
    <div class="container-narrow" style="margin-top: 3rem; padding-top: 2rem; border-top: 1px solid var(--border);">
      <nav class="page-nav">
        <h3 style="margin-bottom: 1rem;">Other pages</h3>
        <ul style="list-style: none; margin: 0;">
          {{ range .Site.Sections.By }}
            {{ if eq .Type "is" }}
              {{ range .Pages }}
                <li style="margin-bottom: 0.5rem;">
                  <a href="{{ .RelPermalink }}" {{ if eq $.RelPermalink .RelPermalink }}class="active"{{ end }}>
                    {{ .Title }}
                  </a>
                </li>
              {{ end }}
            {{ end }}
          {{ end }}
        </ul>
      </nav>
    </div>
  {{ end }}
{{ end }}