summaryrefslogtreecommitdiff
path: root/layouts/shortcodes/ep-table.html
blob: 5614cb3a01c9f88a9ee83891e5da447ecc7da8ad (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
{{- $caption := .Inner }}
{{- $page := .Page }}
{{- $site := .Site }}

{{ with $file := .Get 0 }}
{{ with resources.Get $file}}
{{ with . | transform.Unmarshal }}
<table class="eptab">
  <tr>
    <th scope="col">Air date</th>
    <th scope="col">Ep#</th>
    <th scope="col">Prod#</th>
    <th scope="col">Title</th>
  </tr>
  {{ range  .episodes }}

  {{ $detailUrl := where site.RegularPages "Params.episode_id" .Episode }}

  <tr>
    <td>{{ .USRelDate }}</td>
    <td>{{ .Episode }}</td>
    <td>{{ .ProductionNo }}</td>
    <td>
      {{ if $detailUrl}}
      <a href="{{ (index $detailUrl 0).Permalink }}">{{ .Title }}</a>
      {{ else }}
      {{ .Title }}
      {{ end }}
    </td>
  </tr>
</tr>
{{ end }}
</table>
{{ end }}
{{ end }}
{{ end }}