Fix HTML for menu items that only have an icon

This commit is contained in:
Miles Barr
2025-09-14 09:03:43 -07:00
parent 9cc808ea93
commit bf85845bc2
2 changed files with 14 additions and 8 deletions
@@ -6,14 +6,17 @@
}} }}
target="_blank" target="_blank"
{{ end }} {{ end }}
class="flex items-center text-gray-500 hover:text-primary-600 dark:hover:text-primary-400"> class="flex items-center text-gray-500 hover:text-primary-600 dark:hover:text-primary-400"
title="{{ .Title }}">
{{ if .Pre }} {{ if .Pre }}
<div {{ if and .Pre .Name }}class="mr-2"{{ end }}> <div {{ if and .Pre .Name }}class="mr-2"{{ end }}>
{{ partial "icon.html" .Pre }} {{ partial "icon.html" .Pre }}
</div> </div>
{{ end }} {{ end }}
<p class="text-bg font-bg" title="{{ .Title }}"> {{ if .Name }}
{{ .Name | markdownify }} <p class="text-bg font-bg">
</p> {{ .Name | markdownify }}
</p>
{{ end }}
</a> </a>
</li> </li>
@@ -1,13 +1,16 @@
<a <a
href="{{ .URL }}" href="{{ .URL }}"
{{ if or (strings.HasPrefix .URL "http:" ) (strings.HasPrefix .URL "https:" ) }}target="_blank"{{ end }} {{ if or (strings.HasPrefix .URL "http:" ) (strings.HasPrefix .URL "https:" ) }}target="_blank"{{ end }}
class="flex items-center text-gray-500 hover:text-primary-600 dark:hover:text-primary-400"> class="flex items-center text-gray-500 hover:text-primary-600 dark:hover:text-primary-400"
title="{{ .Title }}">
{{ if .Pre }} {{ if .Pre }}
<span {{ if and .Pre .Name }}class="mr-1"{{ end }}> <span {{ if and .Pre .Name }}class="mr-1"{{ end }}>
{{ partial "icon.html" .Pre }} {{ partial "icon.html" .Pre }}
</span> </span>
{{ end }} {{ end }}
<p class="text-base font-medium" title="{{ .Title }}"> {{ if .Name }}
{{ .Name | markdownify }} <p class="text-base font-medium">
</p> {{ .Name | markdownify }}
</p>
{{ end }}
</a> </a>