Feat: open custom blocks: custom-menu:desktop and custom-menu:mobile

This commit is contained in:
Cell
2024-12-02 17:08:19 +08:00
parent 83d25c36b8
commit fda3fa66ef
4 changed files with 23 additions and 1 deletions
+2
View File
@@ -901,6 +901,8 @@ enableEmoji = true
# Depends on open custom blocks https://fixit.lruihao.cn/references/blocks/
[params.customPartials]
head = []
menuDesktop = []
menuMobile = []
profile = []
aside = []
comment = []
+14
View File
@@ -5,6 +5,20 @@
{{- end -}}
{{- end -}}
{{- define "custom-menu:desktop" -}}
{{- $ctx := . -}}
{{- range .Site.Params.customPartials.menuDesktop -}}
{{- partial . $ctx -}}
{{- end -}}
{{- end -}}
{{- define "custom-menu:mobile" -}}
{{- $ctx := . -}}
{{- range .Site.Params.customPartials.menuMobile -}}
{{- partial . $ctx -}}
{{- end -}}
{{- end -}}
{{- define "custom-profile" -}}
{{- $ctx := . -}}
{{- range .Site.Params.customPartials.profile -}}
+6
View File
@@ -144,6 +144,9 @@
</ul>
</li>
{{- end -}}
{{- /* Custom menu items in the desktop header */ -}}
{{- block "custom-menu:desktop" . }}{{ end -}}
</ul>
</nav>
</div>
@@ -305,6 +308,9 @@
</select>
</span>
{{- end -}}
{{- /* Custom menu items in the mobile header */ -}}
{{- block "custom-menu:mobile" . }}{{ end -}}
</li>
</ul>
</nav>
+1 -1
View File
@@ -1,4 +1,4 @@
{{- .Scratch.Set "version" "v0.3.16-f66dc32e" -}}
{{- .Scratch.Set "version" "v0.3.16-83d25c36" -}}
{{- .Scratch.Set "this" dict -}}
{{- partial "init/detection-env.html" . -}}