Skip to content

Commit

Permalink
feat: make cards as partial (#474)
Browse files Browse the repository at this point in the history
  • Loading branch information
imfing authored Oct 14, 2024
1 parent a97a179 commit 2565f37
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
6 changes: 6 additions & 0 deletions layouts/partials/shortcodes/cards.html
Original file line number Diff line number Diff line change
@@ -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>
4 changes: 1 addition & 3 deletions layouts/shortcodes/cards.html
Original file line number Diff line number Diff line change
@@ -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) -}}

0 comments on commit 2565f37

Please sign in to comment.