{{ define "title" -}}
  {{ .Title }} | {{ .Site.Title }}
{{- end }}
{{ define "header" }}
  {{ partial "masthead.html" . }}
{{ end }}
{{ define "main" }}
  <header>
    <h1>{{ .Title }}</h1>
    {{ if .Description }}
      <blockquote itemprop="description">{{ .Description }}</blockquote>
    {{ end }}
  </header>
  {{ with .Params.slug }}
    {{ partial "module-latest.html" (dict "slug" .) }}
    <img alt="Minimum Required After Dark Version" src="https://img.shields.io/badge/dynamic/json.svg?url=https://git.habd.as/comfusion/{{ . | safeURL }}/raw/branch/master/package.json&label=after%20dark&query=$..['after-dark']&colorB=000000&style=for-the-badge&longCache=false&maxAge=86400">
    {{ if eq . "toxic-swamp" }}
      <svg height="34px" fill="#f60" role="presentation" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><title>Monero icon</title><path d="M12 0C5.365 0 0 5.373 0 12.015c0 1.335.228 2.607.618 3.81h3.577V5.729L12 13.545l7.805-7.815v10.095h3.577c.389-1.203.618-2.475.618-3.81C24 5.375 18.635 0 12 0zm-1.788 15.307l-3.417-3.421v6.351H1.758C3.87 21.689 7.678 24 12 24s8.162-2.311 10.245-5.764h-5.04v-6.351l-3.386 3.421-1.788 1.79-1.814-1.79h-.005z"/></svg>
    {{ end }}
  {{ end }}
  {{/* TODO: Allow schema specification by type */}}
  {{/* {{ template "_internal/schema.html" . }} */}}
  {{ .Content }}
  <footer>
    <hr>
    <p>
      Published
      {{ with .Params.categories }}
        in <span itemprop="articleSection">{{ delimit (apply (apply (sort .) "partial" "category-link.html" ".") "chomp" ".") ", " " and " }}</span>
      {{ end }}
      {{ with .Params.features }}
        using {{ delimit (apply (apply (sort .) "partial" "feature-link.html" ".") "chomp" ".") ", " " and " }}.
      {{ else }}
        using basic features.
      {{ end }}
    </p>
    {{ partial "post/related-content.html" . }}
  </footer>
{{ end }}
{{ define "footer" }}
  {{ partial "powered-by.html" . }}
  {{ partial "cookie-disclaimer.html" . }}
  {{ if in .Page.RelPermalink "toxic-swamp" }}
    {{ if eq .Params.slug "toxic-swamp" }}
      {{ $config_generator := resources.Get "/js/config-generator.js" }}
      <script src="{{ $config_generator.Permalink }}" integrity="{{ ($config_generator | resources.Fingerprint "sha512").Data.Integrity }}"></script>
    {{ else if in .Page.RelPermalink "configuration" }}
      {{ $configuration := resources.Get "/js/configuration.js" }}
      <script src="{{ $configuration.Permalink }}" integrity="{{ ($configuration | resources.Fingerprint "sha512").Data.Integrity }}"></script>
    {{ end }}
  {{ end }}
{{ end }}
