mirror of
https://github.com/hugo-fixit/FixIt.git
synced 2026-08-24 15:28:57 +00:00
✨ Feat: open more custom blocks for posts page
This commit is contained in:
@@ -957,6 +957,10 @@ enableEmoji = true
|
||||
footer = []
|
||||
widgets = []
|
||||
assets = []
|
||||
postTocBefore = []
|
||||
postTocAfter = []
|
||||
postContentBefore = []
|
||||
postContentAfter = []
|
||||
postFooterBefore = []
|
||||
postFooterAfter = []
|
||||
|
||||
|
||||
@@ -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 -}}
|
||||
|
||||
@@ -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" . -}}
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
<span class="post-author">
|
||||
{{- $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 = "" -}}
|
||||
|
||||
@@ -159,6 +159,9 @@
|
||||
</div>
|
||||
{{- 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 -}}
|
||||
<div class="content" id="content"{{ with $params.endFlag }} data-end-flag="{{ . }}"{{ end }}>
|
||||
@@ -169,6 +172,9 @@
|
||||
{{- end -}}
|
||||
</div>
|
||||
|
||||
{{- /* Custom block after post content */ -}}
|
||||
{{- block "custom-post__content:after" . }}{{ end -}}
|
||||
|
||||
{{- /* Related Content */ -}}
|
||||
{{- partial "single/related.html" . -}}
|
||||
|
||||
@@ -203,6 +209,9 @@
|
||||
</article>
|
||||
|
||||
<aside class="toc" id="toc-auto" aria-label="{{ T "single.contents" }}">
|
||||
{{- /* Custom block before post toc */ -}}
|
||||
{{- block "custom-post__toc:before" . }}{{ end -}}
|
||||
|
||||
{{- /* Auto TOC */ -}}
|
||||
{{- if $showToc -}}
|
||||
<h2 class="toc-title{{ with $params.password }} encrypted-hidden{{ end }}">
|
||||
@@ -211,5 +220,8 @@
|
||||
</h2>
|
||||
<div class="toc-content{{ if eq $toc.auto false }} always-active{{ end }}{{ with $params.password }} encrypted-hidden{{ end }}" id="toc-content-auto"></div>
|
||||
{{- end -}}
|
||||
|
||||
{{- /* Custom block after post toc */ -}}
|
||||
{{- block "custom-post__toc:after" . }}{{ end -}}
|
||||
</aside>
|
||||
{{- end -}}
|
||||
|
||||
Reference in New Issue
Block a user