aboutsummaryrefslogtreecommitdiffstats
path: root/layouts/_default/single.html
blob: 076e4e72841b16349432a35617356c261b61657d (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
{{ define "main" }}
  <header class="mw7 center">
    <h2 class="baskerville f2 lh-title mv3 ph1">
      {{ .Title }}
    </h2>

    {{ with .Params.subtitle }}
      <h3 class="f3 baskerville mv3 pa1">{{ . }}</h3>
    {{ end }}

    {{ if in (slice "post" "talk" "publication") .Section }}
      {{ partial "metadata.html" . }}
    {{ end }}

    {{ $image := "" }}
    {{ if (.Resources.ByType "image").GetMatch "*featured*" }}
      {{ $image =  (.Resources.ByType "image").GetMatch "*featured*" }}
    {{ else if resources.Get (index .Params.images 0) }}
      {{ $image =  resources.Get (index .Params.images 0) }}
    {{ end }}
    {{ with $image }}
      {{ if ne $image.MediaType.SubType "svg" }}
        {{ $image := .Fit (default "400x400" $.Params.image_size) }}
      {{ end }}
      <div class="tc">
        <div class="relative dib">
          <img
            src="{{ if ne .MediaType.SubType "svg" }}
              {{ $image := .Fit (default "400x400" $.Params.image_size) }}
              {{ $image.RelPermalink }}
            {{ else }}
              {{ $image.RelPermalink }}
            {{ end }}"
            class="ma0"
            alt="{{ .Title }}"
          />
          {{ with $.Params.caption }}
            <a
              href="{{ .url }}"
              class="link near-white db absolute bottom-0 right-0 pa2 bg-black-30 br2"
            >
              {{ .text }}
            </a>
          {{ end }}
        </div>
      </div>
    {{ end }}
  </header>
  <div class="main-content mw7 center lh-copy f5 f4-ns ph1">
    {{ .Content }}
  </div>
  {{ partial "image-gallery" . }}

  {{ if .Site.Params.tipping }}
    {{ partial "tipping" . }}
  {{ end }}
  <div class="f5 f4-ns lh-copy pv2">
    {{ if in (slice "post" "talk") .Section }}
      {{ partial "author_card" .Site.Author }}
    {{ end }}
    {{ partial "post_pager" . }}
  </div>
{{ end }}