aboutsummaryrefslogtreecommitdiffstats
path: root/layouts/partials/metadata.html
blob: 4a9129e8f9b4d04e303ea5da5b2c5d8f42d4894c (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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
{{ $dateTime := .PublishDate.Format "2006-01-02" }}
{{ $dateFormat := .Site.Params.dateFormat | default "Jan 2, 2006" }}


<p class="f6 lh-copy mv0 ph4 pv2">
  By
  {{ with .Params.author }}
    <span class="author"> &mdash; {{ delimit . ", " }} </span>
  {{ end }}


  <br />
  <i class="far fa-calendar"></i>
  <time datetime="{{ $dateTime }}">
    {{ .Date.Format $dateFormat }}
  </time>
  {{ with .Params.location }}
    &mdash;
    {{ . }}
  {{ end }}

  {{ if eq .Section "post" }}
    | {{ .ReadingTime }} mins read
  {{ end }}

  {{ with .Params.tags }}
    | <i class="fas fa-tags"></i>
    {{ range . }}
      {{ $href := print (absURL "tags/") (urlize .) }}
      <a class="link underline near-black" href="{{ $href }}">{{ . }}</a>
    {{ end }}
  {{ end }}

  {{ with .Params.categories }}
    | <i class="fas fa-folder-open"></i>
    {{ range . }}
      {{ $href := print (absURL "categories/") (urlize .) }}
      <a class="link underline near-black" href="{{ $href }}">{{ . }}</a>
    {{ end }}
  {{ end }}


  <br />
  {{ range $key, $val := (dict "DOI" .Params.doi
    "PDF" .Params.url_pdf
    "Slides" .Params.url_slides
    "Video" .Params.url_video
    "Code" .Params.url_code
    )
  }}
    {{ with $val }}
      <a
        class="f6 link ba br3 ma2 ph2 pv1 dib w3-text-theme w3-hover-theme"
        href="{{ . }}"
        target="_blank"
        rel="noopener"
      >
        {{ $key }}
      </a>
    {{ end }}
  {{ end }}

</p>