{{- define "title" -}} {{- title .Title -}} {{- if .Site.Params.withSiteTitle }} {{ .Site.Params.titleDelimiter }} {{ .Site.Title }}{{- end -}} {{- end -}} {{- define "content" -}} {{- $title := title .Title -}} {{- $params := partial "function/params.html" -}} {{- $toc := .Scratch.Get "toc" -}} {{- $tocEmpty := eq .TableOfContents `` -}}
{{- /* Title */ -}}

{{- $repost := $params.repost | default dict -}} {{- with $repost -}} {{- if eq .Enable true -}} {{- $icon := dict "Class" "fa-solid fa-share fa-fw" -}} {{- $title := cond (hasPrefix .Url "http") (printf "%v -> %v" (T "single.repost") .Url ) (T "single.repost") -}} {{- if hasPrefix .Url "http" -}} {{ dict "Destination" .Url "Icon" $icon "Class" "icon-repost" "Title" $title | partial "plugin/link.html" -}} {{- else -}} {{- $icon | partial "plugin/icon.html" -}} {{- end -}} {{- end -}} {{- end -}} {{- .Title -}}

{{- /* Subtitle */ -}} {{- with $params.subtitle -}}

{{ . }}

{{- end -}}
{{- /* Meta */ -}}
{{- /* TODO add disclaimer or space between meta and content */ -}}
{{- /* Featured image */ -}} {{- $image := $params.featuredimage -}} {{- with .Resources.GetMatch "featured-image" -}} {{- $image = .RelPermalink -}} {{- end -}} {{- with $image -}} {{- end -}} {{- /* Static TOC */ -}} {{- if (ne $toc.enable false) | and (ne $tocEmpty true) -}}
{{ T "single.contents" }} {{ dict "Class" "details-icon fa-solid fa-angle-right" | partial "plugin/icon.html" }}
{{- dict "Content" .TableOfContents "Ruby" $params.ruby "Fraction" $params.fraction "Fontawesome" $params.fontawesome | partial "function/content.html" | safeHTML -}}
{{- end -}} {{- /* Content */ -}} {{- $content := dict "Content" .Content "Ruby" $params.ruby "Fraction" $params.fraction "Fontawesome" $params.fontawesome | partial "function/content.html" | safeHTML -}}
{{- if not $params.password -}} {{- /* Expiration Reminder */ -}} {{- partial "single/expiration-reminder.html" . -}} {{- $content -}} {{- end -}}
{{- /* Related Content */ -}} {{- partial "single/related.html" . -}} {{- /* Reward before Footer */ -}} {{- $reward := .Scratch.Get "reward" -}} {{- if eq $reward.position "before" -}} {{- partial "single/reward.html" . -}} {{- end -}} {{- /* Collection Navigation */ -}} {{- partial "single/collection-nav.html" . -}} {{- /* Content Encryption */ -}} {{- dict "Content" $content "Password" $params.password "Message" $params.message | partial "plugin/fixit-encryptor.html" -}} {{- /* Custom block before post footer */ -}} {{- block "custom-post__footer:before" . }}{{ end -}} {{- /* Footer */ -}} {{- partial "single/footer.html" . -}} {{- /* Reward after post footer */ -}} {{- if eq $reward.position "after" -}} {{- partial "single/reward.html" . -}} {{- end -}} {{- /* Custom block after post footer */ -}} {{- block "custom-post__footer:after" . }}{{ end -}} {{- /* Comment */ -}} {{- partial "single/comment.html" . -}}
{{- end -}}