fix: update hybrid menu as well

pull/705/head
Wen Junhua 2023-11-26 23:15:17 +08:00
parent 8ae115e95c
commit 2ca6096cdf
3 changed files with 3 additions and 2 deletions

View File

@ -17,7 +17,7 @@ enableImageLazyLoading = true
fingerprintAlgorithm = "sha256" fingerprintAlgorithm = "sha256"
[header] [header]
layout = "hamburger" # valid options: basic, hamburger, hybrid, custom layout = "hybrid" # valid options: basic, hamburger, hybrid, custom
# logo = "img/logo.jpg" # logo = "img/logo.jpg"
# logoDark = "img/dark-logo.jpg" # logoDark = "img/dark-logo.jpg"
showTitle = true showTitle = true

View File

@ -47,7 +47,7 @@
{{ $jsCode := resources.Get "js/code.js" }} {{ $jsCode := resources.Get "js/code.js" }}
{{ $assets.Add "js" (slice $jsCode) }} {{ $assets.Add "js" (slice $jsCode) }}
{{ end }} {{ end }}
{{ if eq .Site.Params.header.layout "hamburger" }} {{ if or (eq .Site.Params.header.layout "hamburger") (eq .Site.Params.header.layout "hybrid") }}
{{ $jsMenu := resources.Get "js/menu.js" }} {{ $jsMenu := resources.Get "js/menu.js" }}
{{ $assets.Add "js" (slice $jsMenu) }} {{ $assets.Add "js" (slice $jsMenu) }}
{{ end }} {{ end }}

View File

@ -93,6 +93,7 @@
<a <a
href="{{ .URL }}" href="{{ .URL }}"
title="{{ .Title }}" title="{{ .Title }}"
onclick="close_menu()"
{{ with .Params.target }}target="{{ . }}"{{ end }} {{ with .Params.target }}target="{{ . }}"{{ end }}
>{{ with .Params.icon }} >{{ with .Params.icon }}
<span <span