diff --git a/assets/css/_core/_header.scss b/assets/css/_core/_header.scss index a231c86f6..7a43ebe3f 100644 --- a/assets/css/_core/_header.scss +++ b/assets/css/_core/_header.scss @@ -279,6 +279,8 @@ header { border-radius: $global-border-radius; border: 1px solid $menu-border-color; background-color: $header-background-color; + max-height: 60vh; + overflow-y: auto; @include transition(box-shadow 0.3s ease); @include box-shadow(0 0 1.5rem 0 rgba(0, 0, 0, 0.1)); diff --git a/hugo.toml b/hugo.toml index 89a688972..f8decf497 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 8af789867..dc0b21097 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 7abafef86..67587a8fd 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 01548bfab..912c5f225 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-fda3fa66" -}} {{- .Scratch.Set "this" dict -}} {{- partial "init/detection-env.html" . -}}