{{- define "main" }}
  {{- $site := . }}
  {{- $topic := .Site.Data.topics }}

  {{- range (split .Title "/") }}
    {{- with $topic.topics }}
      {{- $topic = $topic.topics}}
    {{- end }}
    {{- $topic = index $topic . }}
  {{- end }}

  {{- with $topic.classification }}
    <h2>Subject Classification</h2>
    {{- range . }}
      <p>{{ .type }}: <a href="{{ .url }}">{{ .desc }}</a></p>
    {{- end }}
  {{- end }}

  {{- range (where (uniq .Data.Pages) "Params.topics" "intersect" (slice $site.Title)).GroupByDate
      "2006" }}
    <h2 class="head">{{ .Key }}</h2>
    {{- range .Pages }}
      <article class="entry">
        <div class="item-text">
          <h5><a class="title" href="{{ .RelPermalink }}">{{ htmlUnescape .Title }}</a></h5>
          <br>
          {{- with .Params.authors }}
            by {{ partial "authors.html" (dict "site" $site "authors" .) }}
          {{- end }}
        </div>
        <span class="date">{{ .Date.Format "Jan 02" }}</span>
      </article>
    {{- end }}
  {{- end }}
{{- end }}