aboutsummaryrefslogtreecommitdiffstats
path: root/layouts/project/single.html
blob: eacb6d1e4814de7cbc71a9078d6c6e33d061daf2 (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
{{- 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 }}

    {{ partial "meta_links.html" . }}
    {{ partial "leading_image.html" . }}
  </header>
  <div class="main-content mw7 center lh-copy f5 f4-ns ph1">
    {{ .Content }}
  </div>

  <div class="mw7 center ph1">
    {{ $page := . }}
    {{ $project := .File.ContentBaseName }}

    {{ $items := where (where site.RegularPages "Type" "post") ".Params.projects" "intersect" (slice $project) }}
    {{ $count := len $items }}
    {{ if ge $count 1 }}
      <h2 class="f2 fw3 ma0">Related Posts</h2>
      {{ range $index, $item := $items }}
        {{ partial "post.html" . }}
      {{ end }}
    {{ end }}

    {{ $items := where (where site.RegularPages "Type" "publication") ".Params.projects" "intersect" (slice $project) }}
    {{ $pubs_len := len $items }}
    {{ if ge $pubs_len 1 }}
      <h2 class="f2 fw3 ma0">Related Publications</h2>
      {{ range $index, $item := $items }}
        {{ partial "post.html" . }}
      {{ end }}
    {{ end }}

    {{ $items := where (where site.RegularPages "Type" "event") ".Params.projects" "intersect" (slice $project) }}
    {{ $talks_len := len $items }}
    {{ if ge $talks_len 1 }}
      <h2 class="f2 fw3 ma0">Related Talks</h2>
      {{ range $index, $item := $items }}
        {{ partial "post.html" . }}
      {{ end }}
    {{ end }}
    {{ partial "post_pager" . }}
  </div>
{{- end -}}