diff --git a/hugo.toml b/hugo.toml index ccb7ef71..06df9b90 100644 --- a/hugo.toml +++ b/hugo.toml @@ -957,6 +957,10 @@ enableEmoji = true footer = [] widgets = [] assets = [] + postTocBefore = [] + postTocAfter = [] + postContentBefore = [] + postContentAfter = [] postFooterBefore = [] postFooterAfter = [] diff --git a/layouts/partials/custom.html b/layouts/partials/custom.html index dc0b2109..74141f2f 100644 --- a/layouts/partials/custom.html +++ b/layouts/partials/custom.html @@ -61,6 +61,34 @@ {{- end -}} {{- end -}} +{{- define "custom-post__toc:before" -}} + {{- $ctx := . -}} + {{- range .Site.Params.customPartials.postTocBefore -}} + {{- partial . $ctx -}} + {{- end -}} +{{- end -}} + +{{- define "custom-post__toc:after" -}} + {{- $ctx := . -}} + {{- range .Site.Params.customPartials.postTocAfter -}} + {{- partial . $ctx -}} + {{- end -}} +{{- end -}} + +{{- define "custom-post__content:before" -}} + {{- $ctx := . -}} + {{- range .Site.Params.customPartials.postContentBefore -}} + {{- partial . $ctx -}} + {{- end -}} +{{- end -}} + +{{- define "custom-post__content:after" -}} + {{- $ctx := . -}} + {{- range .Site.Params.customPartials.postContentAfter -}} + {{- partial . $ctx -}} + {{- end -}} +{{- end -}} + {{- define "custom-post__footer:before" -}} {{- $ctx := . -}} {{- range .Site.Params.customPartials.postFooterBefore -}} diff --git a/layouts/partials/init/index.html b/layouts/partials/init/index.html index c6e9a012..a29dda5c 100644 --- a/layouts/partials/init/index.html +++ b/layouts/partials/init/index.html @@ -1,4 +1,4 @@ -{{- .Scratch.Set "version" "v0.3.17-21750077" -}} +{{- .Scratch.Set "version" "v0.3.17-469af95f" -}} {{- .Scratch.Set "this" dict -}} {{- partial "init/detection-env.html" . -}} diff --git a/layouts/partials/single/post-author.html b/layouts/partials/single/post-author.html index d81308c7..e9bfaa43 100644 --- a/layouts/partials/single/post-author.html +++ b/layouts/partials/single/post-author.html @@ -5,7 +5,7 @@ {{- $content := $author.name | default "Anonymous" -}} {{- $icon := dict "Class" "fa-solid fa-user-circle" -}} - {{- /* Deprecate $params.authorAvatar in favor of $params.showAvatar and dd front matter gravatar {bool} */ -}} + {{- /* Deprecate $params.authorAvatar in favor of $params.showAvatar and add front matter gravatar {bool} */ -}} {{- if $author.avatar | and $params.authorAvatar -}} {{- $content = printf "%v %v" (dict "Src" $author.avatar "Class" "avatar" "Alt" $content "Width" 20 "Height" 20 | partial "plugin/image.html") $content -}} {{- $icon = "" -}} diff --git a/layouts/posts/single.html b/layouts/posts/single.html index b2592a39..eb4fea2b 100644 --- a/layouts/posts/single.html +++ b/layouts/posts/single.html @@ -159,6 +159,9 @@ {{- end -}} + {{- /* Custom block before post content */ -}} + {{- block "custom-post__content:before" . }}{{ end -}} + {{- /* Content */ -}} {{- $content := dict "Content" .Content "Ruby" $params.ruby "Fraction" $params.fraction "Fontawesome" $params.fontawesome | partial "function/content.html" | safeHTML -}}
@@ -169,6 +172,9 @@ {{- end -}}
+ {{- /* Custom block after post content */ -}} + {{- block "custom-post__content:after" . }}{{ end -}} + {{- /* Related Content */ -}} {{- partial "single/related.html" . -}} @@ -203,6 +209,9 @@ {{- end -}}