diff --git a/hugo.toml b/hugo.toml index 89a68897..f8decf49 100644 --- a/hugo.toml +++ b/hugo.toml @@ -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 = [] diff --git a/layouts/partials/custom.html b/layouts/partials/custom.html index 8af78986..dc0b2109 100644 --- a/layouts/partials/custom.html +++ b/layouts/partials/custom.html @@ -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 -}} diff --git a/layouts/partials/header.html b/layouts/partials/header.html index 7abafef8..67587a8f 100644 --- a/layouts/partials/header.html +++ b/layouts/partials/header.html @@ -144,6 +144,9 @@ {{- end -}} + + {{- /* Custom menu items in the desktop header */ -}} + {{- block "custom-menu:desktop" . }}{{ end -}} @@ -305,6 +308,9 @@ {{- end -}} + + {{- /* Custom menu items in the mobile header */ -}} + {{- block "custom-menu:mobile" . }}{{ end -}} diff --git a/layouts/partials/init/index.html b/layouts/partials/init/index.html index 01548bfa..87a99102 100644 --- a/layouts/partials/init/index.html +++ b/layouts/partials/init/index.html @@ -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" . -}}