From f37622a1557bd7ccff20364c5ce042b13714ce48 Mon Sep 17 00:00:00 2001 From: Cell <1024@lruihao.cn> Date: Sun, 28 Aug 2022 20:34:49 +0800 Subject: [PATCH] :bug: Fix: menu item invalid params `draft` in submenu --- CHANGELOG.md | 1 + layouts/partials/header.html | 84 +++++++++++++++++++----------------- 2 files changed, 45 insertions(+), 40 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 757063a8..823d3830 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,7 @@ All notable changes to this project will be documented in this file. - :bug: Fix: attribute `media` not allowed on element meta in `[name=theme-color]` - :bug: Fix: support smooth migration from LoveIt to FixIt ([#174](https://github.com/hugo-fixit/FixIt/discussions/174) [#182](https://github.com/hugo-fixit/FixIt/issues/182)) - :bug: Fix: `center-quote` shortcode rendering error when config `unsafe = false` (@yureiita[#160](https://github.com/hugo-fixit/FixIt/pull/160)) +- :bug: Fix: menu item invalid params `draft` in submenu - :art: Style: change the default icons of some social links - :globe_with_meridians: Docs(i18n): update pt-br, de in i18n - :mag: Perf(SEO): enhance SEO performance diff --git a/layouts/partials/header.html b/layouts/partials/header.html index a9f01634..0c9f3348 100644 --- a/layouts/partials/header.html +++ b/layouts/partials/header.html @@ -43,7 +43,7 @@ {{- with .Page -}} {{- $url = .RelPermalink -}} {{- end -}} - {{- if (ne .Params.Draft true) | or $buildDrafts | and (ne .Params.Type "mobile") -}} + {{- if (ne .Params.Draft true) | or $buildDrafts | and (ne .Params.Type "mobile") -}} + + {{- with .Pre -}}{{- . | safeHTML }} {{ end }} + {{- with .Params.Icon -}}{{ dict "Class" (printf "%v fa-fw fa-sm" .) | partial "plugin/icon.html" }} {{ end }} + {{- .Name }} + {{- with .Post }} {{ . | safeHTML -}}{{- end -}} + + + {{- end -}} {{- end -}} {{- end -}} @@ -237,35 +239,37 @@ {{- with .Page -}} {{- $url = .RelPermalink -}} {{- end -}} - + + {{- with .Pre -}}{{- . | safeHTML }} {{ end }} + {{- with .Params.Icon -}}{{ dict "Class" (printf "%v fa-fw fa-sm" .) | partial "plugin/icon.html" }} {{ end }} + {{- .Name }} + {{- with .Post }} {{ . | safeHTML -}}{{- end -}} + + + {{- end -}} {{- end -}} {{- else -}} - - {{- with .Pre -}}{{- . | safeHTML }} {{ end }} - {{- with .Params.Icon -}}{{ dict "Class" (printf "%v fa-fw fa-sm" .) | partial "plugin/icon.html" }} {{ end }} - {{- .Name }} - {{- with .Post }} {{ . | safeHTML -}}{{- end -}} - + + {{- with .Pre -}}{{- . | safeHTML }} {{ end }} + {{- with .Params.Icon -}}{{ dict "Class" (printf "%v fa-fw fa-sm" .) | partial "plugin/icon.html" }} {{ end }} + {{- .Name }} + {{- with .Post }} {{ . | safeHTML -}}{{- end -}} + {{- end -}} {{- end -}}