feat: make cards as partial (#474)

This commit is contained in:
Xin 2024-10-14 23:03:22 +01:00 committed by GitHub
parent a97a1791cc
commit 2565f372d1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 7 additions and 3 deletions

View File

@ -0,0 +1,6 @@
{{- $cols := .cols | default 3 -}}
{{- $content := .content -}}
<div class="hextra-cards hx-mt-4 hx-gap-4 hx-grid not-prose" style="--hextra-cards-grid-cols: {{ $cols }};">
{{- $content -}}
</div>

View File

@ -1,5 +1,3 @@
{{- $cols := .Get "cols" | default 3 -}}
<div class="hextra-cards hx-mt-4 hx-gap-4 hx-grid not-prose" style="--hextra-cards-grid-cols: {{ $cols }};">
{{- .Inner -}}
</div>
{{- partial "shortcodes/cards" (dict "cols" $cols "content" .Inner) -}}