{{ define "body" }} {{ end }} {{ define "main" }} {{ $scratch := newScratch }} {{ if .Site.Params.writers }} {{ $scratch.Set "writer" (index .Site.Params.writers (lower .Params.writer) | default dict) }} {{ else }} {{ $scratch.Set "writer" (.Site.Params.social | default dict) }} {{ end }} {{ $writer := $scratch.Get "writer" }}
{{ if and (isset .Params "image") .Params.image }}
{{ else }}
{{ end }}

{{ .Title }}

{{ .Content }}
{{ if and (isset .Site.Params "author") .Site.Params.author }}
{{ if and (isset .Params "writer") $writer.email }} {{ .Params.writer | default .Site.Params.author }} {{ else }} {{ .Params.writer | default .Site.Params.author }} {{ end }} Written by:
{{ if and (isset .Params "writer") $writer.bio }} {{ range $writer.bio }}

{{ . | default "" | safeHTML }}

{{ end }} {{ else }} {{ range .Site.Params.bio }}

{{ . | default "" | safeHTML }}

{{ end }} {{ end }} {{ if isset .Params "writer" }} {{ with $writer.facebook }} {{end}} {{ with $writer.googleplus }} {{end}} {{ with $writer.twitter }} {{end}} {{ with $writer.linkedin }} {{end}} {{ with $writer.email }} {{end}} {{ with $writer.instagram }} {{end}} {{ with $writer.stackoverflow }} {{end}} {{ with $writer.github }} {{end}} {{ with $writer.mastodon }} {{end}} {{ else }} {{ with .Site.Params.social.facebook }} {{end}} {{ with .Site.Params.social.googleplus }} {{end}} {{ with .Site.Params.social.twitter }} {{end}} {{ with .Site.Params.social.linkedin }} {{end}} {{ with .Site.Params.social.email }} {{end}} {{ with .Site.Params.social.instagram }} {{end}} {{ with .Site.Params.social.stackoverflow }} {{end}} {{ with .Site.Params.social.github }} {{end}} {{ with .Site.Params.social.mastodon }} {{end}} {{ end }}
{{ end }}
{{ template "_internal/disqus.html" . }}
{{ end }}