{{- define "title" -}} {{- cond (.Param "capitalize_titles") (title .Title) .Title -}} {{- if .Site.Params.with_site_title }} {{ .Site.Params.title_delimiter }} {{ .Site.Title }}{{- end -}} {{- end -}} {{- define "content" -}} {{- $title := cond (.Param "capitalize_titles") (title .Title) .Title -}} {{- $toc := dict "Page" . "Key" "toc" | partial "function/param.html" -}} {{- $tableOfContents := .Fragments.ToHTML ($toc.start_level | int) ($toc.end_level | int) ($toc.ordered | default false) -}} {{- $showToc := $toc.enable | and (ne $tableOfContents ``) -}} {{- .Store.Set "showToc" $showToc -}} {{- $tableOfContents = dict "Content" $tableOfContents "Ruby" (.Param "ruby") "Fraction" (.Param "fraction") "Fontawesome" (.Param "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 */ -}} {{- $cover := dict "Page" . | partial "function/get-cover.html" -}} {{- if $cover.Source | or (gt (len $cover.Matches) 0) -}} {{- end -}} {{- if $showToc -}} {{- /* Static TOC */ -}}
{{ T "single.contents" }} {{ dict "Class" "details-icon fa-solid fa-angle-right" | partial "plugin/icon.html" }}
{{- /* TOC source (copied to containers by initToc, encrypted by fixit-encrypt when password is set) */ -}} {{- end -}} {{- /* AI Summary */ -}} {{- $summaryConfig := dict "Page" . "Key" "post_summary" | partial "function/param.html" -}} {{- if $summaryConfig.enable -}}
{{- end -}} {{- /* Custom block before post content */ -}} {{- block "custom-post__content:before" . }}{{ end -}} {{- /* Encryption Dev Warning */ -}} {{- if (.Params.password | or (.Store.Get "hasEncryptor")) | and (not hugo.IsProduction) -}} {{- dict "Type" "danger" "Title" (printf "%s
%s" (T "single.encryptionWarning") (T "single.encryptionCommand") | $.RenderString) "Foldable" false | partial "plugin/admonition.html" -}} {{- end -}} {{- /* Expiration Reminder */ -}} {{- partial "single/expiration-reminder.html" . -}} {{- /* Content */ -}} {{- $content := dict "Content" .Content "Ruby" (.Param "ruby") "Fraction" (.Param "fraction") "Fontawesome" (.Param "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 := dict "Page" . "Key" "reward" | partial "function/param.html" -}} {{- 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" }}

{{- end -}} {{- end -}} {{- define "comments" -}} {{- partial "base/comment.html" . -}} {{- end -}}