Pass icon as keyword argument to shortcode

This commit is contained in:
Alex Haslam 2023-12-20 13:53:50 +00:00
parent b1e8e00267
commit 2791cc7cb9
No known key found for this signature in database
2 changed files with 12 additions and 10 deletions

View file

@ -1,9 +0,0 @@
<span style="margin-top: 0.5rem" class="mr-2">
<span class="flex">
<span
class="rounded-full bg-primary-500 dark:bg-primary-300 text-neutral-50 dark:text-neutral-700 px-1 py-[1px] text-xs font-normal"
>
{{ . }}
</span>
</span>
</span>

View file

@ -1 +1,12 @@
{{ partial "keyword.html" .Inner }}
{{ $icon := .Get "icon"}}
<span style="margin-top: 0.5rem" class="flex mr-2">
<span
class="rounded-full bg-primary-500 dark:bg-primary-300 text-neutral-50 dark:text-neutral-700 px-1.5 py-[1px] text-xs font-normal"
>
<span class="flex items-center">
{{if $icon}}
<span class="mr-1">{{ partial "icon" $icon }}</span>
{{ end }} {{- .Inner | markdownify -}}
</span>
</span>
</span>