{{- define "title" -}} {{- cond (.Param "capitalizeTitles") (title .Title) .Title -}} {{- if .Site.Params.withSiteTitle }} {{ .Site.Params.titleDelimiter }} {{ .Site.Title }}{{- end -}} {{- end -}} {{- define "content" -}} {{- $title := cond (.Param "capitalizeTitles") (title .Title) .Title -}} {{- $params := partial "function/params.html" -}} {{- $toc := .Store.Get "toc" -}} {{- $tableOfContents := .Fragments.ToHTML ($toc.startlevel | int) ($toc.endlevel | int) ($toc.ordered | default false) -}} {{- $showToc := $toc.enable | and (ne $tableOfContents ``) -}} {{- .Store.Set "showToc" $showToc -}} {{- $tableOfContents = dict "Content" $tableOfContents "Ruby" $params.ruby "Fraction" $params.fraction "Fontawesome" $params.fontawesome | partial "function/content.html" | safeHTML -}} {{- $pagefindEnabled := and .Site.Params.search.enable (eq .Site.Params.search.type "pagefind") -}}
{{- /* Title */ -}}

{{- $repost := $params.repost | default dict -}} {{- with $repost -}} {{- if eq .Enable true -}} {{- $icon := dict "Class" "fa-solid fa-share" -}} {{- $iconTitle := 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" $iconTitle "ExternalIcon" false | partial "plugin/link.html" -}} {{- else -}} {{- $icon | partial "plugin/icon.html" -}} {{- end -}} {{- end -}} {{- end -}} {{ $title }}

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

{{ . | $.RenderString }}

{{- end -}}
{{- /* Meta */ -}}
{{- /* TODO add disclaimer or space between meta and content */ -}}
{{- /* Featured image */ -}} {{- $image := $params.featuredimage -}} {{- $matches := slice -}} {{- if .Resources.GetMatch "featured-image" -}} {{- $matches = $matches | append "featured-image" -}} {{- end -}} {{- if $image | or (gt (len $matches) 0) -}} {{- end -}} {{- /* Static TOC */ -}} {{- if $showToc -}}
{{ T "single.contents" }} {{ dict "Class" "details-icon fa-solid fa-angle-right" | partial "plugin/icon.html" }}
{{- $tableOfContents -}}
{{- end -}} {{- /* AI Summary */ -}} {{- $summaryConfig := (.Params | merge .Site.Params).postSummary -}} {{- if $summaryConfig.enable -}}
{{- end -}} {{- /* Custom block before post content */ -}} {{- block "custom-post__content:before" . }}{{ end -}} {{- /* Expiration Reminder */ -}} {{- partial "single/expiration-reminder.html" . -}} {{- /* Content */ -}} {{- $content := dict "Content" .Content "Ruby" $params.ruby "Fraction" $params.fraction "Fontawesome" $params.fontawesome | partial "function/content.html" | safeHTML -}}
{{- if not $params.password -}} {{- $content -}} {{- end -}}
{{- /* Custom block after post content */ -}} {{- block "custom-post__content:after" . }}{{ end -}} {{- /* Related Content */ -}} {{- partial "single/related.html" . -}} {{- /* Reward before Footer */ -}} {{- $reward := .Store.Get "reward" -}} {{- if eq $reward.position "before" -}} {{- partial "single/reward.html" . -}} {{- end -}} {{- /* Content Encryption */ -}} {{- dict "Content" $content "Password" $params.password "Message" $params.message "Page" . | partial "plugin/fixit-encryptor.html" -}} {{- /* Collection Navigation */ -}} {{- partial "single/collection-nav.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 -}}
{{- /* TOC Dialog */ -}} {{- if $showToc -}}

{{ T "single.contents" }}

{{- replace $tableOfContents `id="TableOfContents"` "" | safeHTML -}}
{{- end -}} {{- end -}} {{- define "comments" -}} {{- partial "base/comment.html" . -}} {{- end -}}