🐛 Fix search not showing when main menu empty

pull/231/head
James Panther 2022-06-25 10:40:24 +10:00
parent 7fa433ddab
commit 84e5e46971
No known key found for this signature in database
GPG Key ID: D36F789E45745D17
2 changed files with 17 additions and 11 deletions

View File

@ -10,6 +10,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
- Upgrade to Tailwind v3.1.4 ([#225](https://github.com/jpanther/congo/pull/225))
### Fixed
- Search would not appear in header if main menu had no links to display
## [2.2.3] - 2022-06-22
### Changed

View File

@ -27,20 +27,22 @@
{{ partial "translations.html" . }}
</div>
{{/* Main menu */}}
{{ if .Site.Menus.main }}
{{ if or .Site.Menus.main (.Site.Params.enableSearch | default false) }}
<nav>
<ul class="flex flex-col list-none sm:flex-row">
{{ range .Site.Menus.main }}
<li
class="mb-1 ltr:text-right rtl:text-left sm:mb-0 ltr:sm:mr-7 ltr:sm:last:mr-0 rtl:sm:ml-7 rtl:sm:last:ml-0"
>
<a
class="decoration-primary-500 hover:underline hover:decoration-2 hover:underline-offset-2"
href="{{ .URL }}"
title="{{ .Title }}"
>{{ .Name | markdownify | emojify }}</a
{{ if .Site.Menus.main }}
{{ range .Site.Menus.main }}
<li
class="mb-1 ltr:text-right rtl:text-left sm:mb-0 ltr:sm:mr-7 ltr:sm:last:mr-0 rtl:sm:ml-7 rtl:sm:last:ml-0"
>
</li>
<a
class="decoration-primary-500 hover:underline hover:decoration-2 hover:underline-offset-2"
href="{{ .URL }}"
title="{{ .Title }}"
>{{ .Name | markdownify | emojify }}</a
>
</li>
{{ end }}
{{ end }}
{{ if .Site.Params.enableSearch | default false }}
<li