aboutsummaryrefslogtreecommitdiff
path: root/themes/hugo-pt2021/layouts/articles/list.html
blob: 3b7f853a70c3fadab4916bd7260c22b972f1978e (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
{{- define "title" -}}
  Articles
{{- end -}}

{{- define "main" -}}
  {{/* get visible articles */}}
  {{- $rows := union (where .Pages "Params.show" true) (where .Pages "Params.show" nil) -}}

  <div class='container'>
    <div class='section is-small'>
      <h1 class='title' title='{{.Title}}' aria-label='{{.Title}}'>
        Articles
      </h1>

      <div class='content'>
        <ul>
          {{- range $rows.ByTitle -}}
            <li>
              <a
                href='{{.Permalink}}'
                title='{{.Title}}'
                aria-label='{{.Title}}'
              >
                {{- .Title -}}
              </a>

              {{- if .Date}}
                -
                <span
                  class='date'
                  title='Date for "{{.Title}}".'
                  aria-label='Date for "{{.Title}}".'
                >
                  {{- .Date.Format "January 2, 2006" -}}
                </span><!-- date -->
              {{- end -}}
            </li>
          {{- else -}}
            <li>No articles.</li>
          {{- end -}}
        </ul>
      </div><!-- content -->
    </div><!-- section -->
  </div><!-- container -->
{{- end -}}