{{ define "title" }}{{ .Title }} – {{ .Site.Title }}{{ end }} {{ define "main" }}

{{ if .Draft }}(Draft) {{ end }}{{ .Title }}

{{- if eq .Date.IsZero false }} {{- end }} {{- if (and (eq .Lastmod.IsZero false) (ne .Lastmod .Date)) }} — last updated {{- end }}
{{ if or (.Params.toc) (and (ne .Params.toc false) (isset .Site.Params "tocwordthreshold") (ge .Site.Params.TocWordThreshold 0) (gt .WordCount .Site.Params.TocWordThreshold)) }} {{/* If the front matter parameter is true, show the toc */}} {{/* Elif the front matter parameter is false, don't show the toc */}} {{/* Elif the front matter parameter is not set, show the toc if the site parameter is set, non-negative, and less than the word count */}}

Table of Contents {{ $toc := .TableOfContents -}} {{/* Workaround for an extra layer of indentation (https://discourse.gohugo.io/t/2303) */}} {{- $toc := replaceRE `(\s*)
    \s*
  • \s*
      ` `${2}
        ` $toc -}} {{- $toc := replaceRE `
      \s*\s*
    (\s*)` `
${1}` $toc -}} {{- safeHTML $toc }}
{{ end }}
{{ .Content | replaceRE "()" (printf "${1}${3}" ("images/chain-link.svg" | relURL)) | safeHTML }} {{ end }}