{{ define "main" }} {{ if or (eq .Section "post") (eq .Section "posts") (eq .Section "blog") (eq .Section "blogs") (eq .Section "news") (eq .Section "categories") (eq .Section "tags") }}
{{ $imagePath:= .Params.image }} {{ if $imagePath }}
{{ partial "image.html" (dict "Src" $imagePath "Alt" .Title "Class" "img-fluid mb-5 w-100 rounded-4" ) }}
{{ else }} {{ range .Params.categories }} {{. | title}} {{ end }} {{ end }}

{{.Title | markdownify}}

{{.Content}}
{{ if .Site.DisqusShortname }}
{{ template "_internal/disqus.html" . }}
{{ end }}

{{ site.Params.related_posts }}

{{ $related := (where site.RegularPages "Section" "in" site.Params.mainSections) | intersect (where site.RegularPages ".Title" "!=" .Title) | union (site.RegularPages.Related . ) }} {{ range first 3 $related }}
{{ .Render "post" }}
{{ end }}
{{ else }} {{ partial "page-header.html" . }}
{{.Content}}
{{ end }} {{ end }}