Skip to content

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
* dev:
  💄 Style: update sub menu overflow to auto scroll
  ✨ Feat: open custom blocks: custom-menu:desktop and custom-menu:mobile
  • Loading branch information
Lruihao committed Dec 3, 2024
2 parents c0115f6 + c3d6347 commit ac4418e
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 1 deletion.
2 changes: 2 additions & 0 deletions assets/css/_core/_header.scss
Original file line number Diff line number Diff line change
Expand Up @@ -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));

Expand Down
2 changes: 2 additions & 0 deletions hugo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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 = []
Expand Down
14 changes: 14 additions & 0 deletions layouts/partials/custom.html
Original file line number Diff line number Diff line change
Expand Up @@ -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 -}}
Expand Down
6 changes: 6 additions & 0 deletions layouts/partials/header.html
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,9 @@
</ul>
</li>
{{- end -}}

{{- /* Custom menu items in the desktop header */ -}}
{{- block "custom-menu:desktop" . }}{{ end -}}
</ul>
</nav>
</div>
Expand Down Expand Up @@ -305,6 +308,9 @@
</select>
</span>
{{- end -}}

{{- /* Custom menu items in the mobile header */ -}}
{{- block "custom-menu:mobile" . }}{{ end -}}
</li>
</ul>
</nav>
Expand Down
2 changes: 1 addition & 1 deletion layouts/partials/init/index.html
Original file line number Diff line number Diff line change
@@ -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" . -}}
Expand Down

0 comments on commit ac4418e

Please sign in to comment.