{{ define "main" }} {{ .Scratch.Set "scope" "single" }}
{{ if .Params.showHero | default (.Site.Params.article.showHero | default false) }} {{ $heroStyle := .Params.heroStyle }} {{ if not $heroStyle }}{{ $heroStyle = .Site.Params.article.heroStyle }}{{ end }} {{ $heroStyle := print "partials/hero/" $heroStyle ".html" }} {{ if templates.Exists $heroStyle }} {{ partial $heroStyle . }} {{ else }} {{ partial "partials/hero/basic.html" . }} {{ end }} {{ end }}
{{ if .Params.showBreadcrumbs | default (.Site.Params.article.showBreadcrumbs | default false) }} {{ partial "breadcrumbs.html" . }} {{ end }}

{{ .Title | emojify }}

{{ partial "article-meta/basic.html" (dict "context" . "scope" "single") }}
{{ $authorsData := .Site.Data.authors }} {{ $taxonomies := .Site.Taxonomies.authors }} {{ $baseURL := .Site.BaseURL }} {{ $taxonomyLink := 0 }} {{ $showAuthor := 0 }} {{ if not (strings.HasSuffix $baseURL "/") }} {{ $baseURL = delimit (slice $baseURL "/") "" }} {{ end }} {{ if not (.Params.showAuthorBottom | default ( .Site.Params.article.showAuthorBottom | default false)) }} {{ if .Params.showAuthor | default (.Site.Params.article.showAuthor | default true) }} {{ $showAuthor = 1 }} {{ partial "author.html" . }} {{ end }} {{ range $author := .Page.Params.authors }} {{ $authorData := index $authorsData $author }} {{- if $authorData -}} {{ range $taxonomyname, $taxonomy := $taxonomies }} {{ if (eq $taxonomyname $author) }} {{ $taxonomyLink = delimit (slice $baseURL "/authors/" $author) "" }} {{ end }} {{ end }} {{ partial "author-extra.html" (dict "context" . "data" $authorData "link" $taxonomyLink) }} {{- end -}} {{ end }} {{ if or $taxonomyLink $showAuthor }}
{{ end }} {{ end }}
{{ if or (and (.Params.showTableOfContents | default (.Site.Params.article.showTableOfContents | default false)) (in .TableOfContents "
{{ if and (.Params.showTableOfContents | default (.Site.Params.article.showTableOfContents | default false)) (in .TableOfContents "
{{ end }}
{{ partial "series/series.html" . }}
{{ .Content }}
{{ if (.Params.showAuthorBottom | default ( .Site.Params.article.showAuthorBottom | default false)) }} {{ if .Params.showAuthor | default (.Site.Params.article.showAuthor | default true) }} {{ $showAuthor = 1 }} {{ partial "author.html" . }} {{ end }} {{ range $author := .Page.Params.authors }} {{ $authorData := index $authorsData $author }} {{- if $authorData -}} {{ range $taxonomyname, $taxonomy := $taxonomies }} {{ if (eq $taxonomyname $author) }} {{ $taxonomyLink = delimit (slice $baseURL "/authors/" $author) "" }} {{ end }} {{ end }} {{ partial "author-extra.html" (dict "context" . "data" $authorData "link" $taxonomyLink) }} {{- end -}} {{ end }} {{ if or $taxonomyLink $showAuthor }}
{{ end }} {{ end }} {{ partial "series/series-closed.html" . }} {{ partial "sharing-links.html" . }} {{ partial "related.html" . }}
{{ $translations := .AllTranslations }} {{ with .File }} {{ $path := .Path }} {{range $translations}} {{ $lang := print "." .Lang ".md" }} {{ $path = replace $path $lang ".md" }} {{end}} {{ end }} {{ $jsPage := resources.Get "js/page.js" }} {{ $jsPage = $jsPage | resources.Minify | resources.Fingerprint "sha512" }}
{{ end }}