mirror of
https://github.com/hugo-fixit/FixIt.git
synced 2026-08-24 15:28:57 +00:00
✨ Feat: add custom partials options params.customPartials
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
{{- partial "init/index.html" . -}}
|
||||
{{- partial "custom.html" . -}}
|
||||
|
||||
<!DOCTYPE html>
|
||||
<html itemscope itemtype="http://schema.org/WebPage" lang="{{ .Site.LanguageCode }}">
|
||||
|
||||
@@ -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 -}}
|
||||
{{- $ctx := . -}}
|
||||
{{- range .Site.Params.customPartials.postFooterAfter -}}
|
||||
{{- partial . $ctx -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
@@ -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" . -}}
|
||||
|
||||
Reference in New Issue
Block a user