mirror of
https://github.com/nunocoracao/blowfish.git
synced 2026-01-30 16:31:52 +01:00
Add support for subnavigation menu
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
<div style="padding-left:0;padding-right:0"
|
||||
class="flex items-center justify-between px-4 py-6 sm:px-6 md:justify-start space-x-3">
|
||||
class="site-header flex items-center justify-between px-4 py-6 sm:px-6 md:justify-start space-x-3">
|
||||
{{ if .Site.Params.Logo -}}
|
||||
{{ $logo := resources.Get .Site.Params.Logo }}
|
||||
{{ if $logo }}
|
||||
@@ -15,14 +15,14 @@
|
||||
{{ end }}
|
||||
{{- end }}
|
||||
<div class="flex flex-1 items-center justify-between">
|
||||
<nav class="flex space-x-3">
|
||||
<nav class="site-header-title flex space-x-3">
|
||||
|
||||
<a href="{{ "" | relLangURL }}" class="text-base font-medium text-gray-500 hover:text-gray-900">{{ .Site.Title | markdownify
|
||||
| emojify }}</a>
|
||||
|
||||
|
||||
</nav>
|
||||
<div class="hidden md:flex items-center space-x-5 md:ml-12">
|
||||
<div class="site-header-menu-main hidden md:flex items-center space-x-5 md:ml-12">
|
||||
|
||||
{{ if .Site.Menus.main }}
|
||||
{{ range .Site.Menus.main }}
|
||||
@@ -117,8 +117,41 @@
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
|
||||
{{ if .Site.Menus.subnavigation }}
|
||||
<p>-</p>
|
||||
{{ range .Site.Menus.subnavigation }}
|
||||
<li class="mb-1">
|
||||
<a {{ if or (strings.HasPrefix .URL "http:" ) (strings.HasPrefix .URL "https:" ) }} target="_blank" {{ end }}
|
||||
class="decoration-primary-500 hover:underline hover:decoration-2 hover:underline-offset-2" href="{{ .URL }}"
|
||||
title="{{ .Title }}">
|
||||
<span class="inline-block align-text-bottom">{{ partial "icon.html" .Pre }}</span>
|
||||
{{ if and .Pre .Name }} {{ end }}
|
||||
{{ .Name | markdownify | emojify }}
|
||||
</a>
|
||||
</li>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
|
||||
</ul>
|
||||
</div>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{ if .Site.Menus.subnavigation }}
|
||||
<div class="site-header-menu-subnavigation flex items-center justify-between md:justify-start space-x-3">
|
||||
<div class="flex flex-1 items-center justify-between">
|
||||
<div class="hidden md:flex items-center space-x-5">
|
||||
{{ range .Site.Menus.subnavigation }}
|
||||
<a href="{{ .URL }}" class="prose dark:prose-invert"
|
||||
{{ if or (strings.HasPrefix .URL "http:" ) (strings.HasPrefix .URL "https:" ) }} target="_blank" {{ end }}
|
||||
class="text-base font-medium text-gray-500 hover:text-gray-900" title="{{ .Title }}">
|
||||
{{ partial "icon.html" .Pre }}
|
||||
{{ if and .Pre .Name }} {{ end }}
|
||||
{{ .Name | markdownify | emojify }}
|
||||
</a>
|
||||
{{ end }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{{ end }}
|
||||
|
||||
Reference in New Issue
Block a user