diff --git a/hugo.toml b/hugo.toml index 9e42372c..af580825 100644 --- a/hugo.toml +++ b/hugo.toml @@ -825,6 +825,20 @@ enableEmoji = true # whether to show the full text content in feed. fullText = true + # FixIt 0.3.12 | NEW Custom partials config + # Custom partials must be stored in the /layouts/partials/ directory. + # Depends on open custom blocks https://fixit.lruihao.cn/references/blocks/ + [params.customPartials] + head = [] + profile = [] + aside = [] + comment = [] + footer = [] + widgets = [] + assets = [] + postFooterBefore = [] + postFooterAfter = [] + # FixIt 0.2.15 | NEW Developer options # Select the scope named `public_repo` to generate personal access token, # Configure with environment variable `HUGO_PARAMS_GHTOKEN=xxx`, see https://gohugo.io/functions/os/getenv/#examples diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html index d9ed9ced..14668a42 100644 --- a/layouts/_default/baseof.html +++ b/layouts/_default/baseof.html @@ -1,5 +1,4 @@ {{- partial "init/index.html" . -}} -{{- partial "custom.html" . -}} diff --git a/layouts/partials/custom.html b/layouts/partials/custom.html index c3e1a683..8af78986 100644 --- a/layouts/partials/custom.html +++ b/layouts/partials/custom.html @@ -1,31 +1,62 @@ -{{- /* - To avoid upgrade conflicts and facilitate the reference of theme components, - it's strongly recommended to copy this file from the theme to your project and override it. -*/ -}} - {{- define "custom-head" -}} + {{- $ctx := . -}} + {{- range .Site.Params.customPartials.head -}} + {{- partial . $ctx -}} + {{- end -}} {{- end -}} {{- define "custom-profile" -}} + {{- $ctx := . -}} + {{- range .Site.Params.customPartials.profile -}} + {{- partial . $ctx -}} + {{- end -}} {{- end -}} {{- define "custom-aside" -}} + {{- $ctx := . -}} + {{- range .Site.Params.customPartials.aside -}} + {{- partial . $ctx -}} + {{- end -}} {{- end -}} {{- define "custom-comment" -}} + {{- $ctx := . -}} + {{- range .Site.Params.customPartials.comment -}} + {{- partial . $ctx -}} + {{- end -}} {{- end -}} {{- define "custom-footer" -}} + {{- $ctx := . -}} + {{- range .Site.Params.customPartials.footer -}} + {{- partial . $ctx -}} + {{- end -}} {{- end -}} {{- define "custom-widgets" -}} + {{- $ctx := . -}} + {{- range .Site.Params.customPartials.widgets -}} + {{- partial . $ctx -}} + {{- end -}} {{- end -}} {{- define "custom-assets" -}} + {{- $ctx := . -}} + {{- range .Site.Params.customPartials.assets -}} + {{- partial . $ctx -}} + {{- end -}} {{- end -}} {{- define "custom-post__footer:before" -}} + {{- $ctx := . -}} + {{- range .Site.Params.customPartials.postFooterBefore -}} + {{- partial . $ctx -}} + {{- end -}} {{- end -}} {{- define "custom-post__footer:after" -}} -{{- end -}} \ No newline at end of file + {{- $ctx := . -}} + {{- range .Site.Params.customPartials.postFooterAfter -}} + {{- partial . $ctx -}} + {{- end -}} +{{- end -}} diff --git a/layouts/partials/init/index.html b/layouts/partials/init/index.html index 1b9de465..8dc84e70 100644 --- a/layouts/partials/init/index.html +++ b/layouts/partials/init/index.html @@ -1,4 +1,4 @@ -{{- .Scratch.Set "version" "v0.3.12-185c6803" -}} +{{- .Scratch.Set "version" "v0.3.12-314d24a3" -}} {{- .Scratch.Set "this" dict -}} {{- partial "init/detection-env.html" . -}}