Skip to content

Commit

Permalink
Merge branch 'main' into dependabot/github_actions/gethinode-actions/…
Browse files Browse the repository at this point in the history
…create-pull-request-6
  • Loading branch information
markdumay authored Mar 4, 2024
2 parents 769faa5 + 7af4a9c commit 81e0a8e
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 6 deletions.
5 changes: 5 additions & 0 deletions data/structures/card-group.yml
Original file line number Diff line number Diff line change
Expand Up @@ -94,3 +94,8 @@ arguments:
optional: true
comment: >-
Flag indicating if the number of columns should be responsive, defaults to `true`.
hook:
type: string
optional: true
comment: Render hook for the card partial.
group: partial
5 changes: 5 additions & 0 deletions data/structures/card.yml
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,11 @@ arguments:
release: v0.23.0-beta
comment: >-
Flag indicating the cards should include a button that links to the provided address.
hook:
type: string
optional: true
comment: Render hook for the image partial.
group: partial
body:
optional: true
comment: >-
Expand Down
3 changes: 2 additions & 1 deletion layouts/partials/assets/card-group.html
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
{{- $subtle := .subtle }}
{{- $loading := .loading -}}
{{- $button := .button -}}
{{- $hook := .hook | default "assets/card.html" }}

<!-- Override arguments -->
{{ $isPages := in (slice "page.Pages" "resource.Resources") (printf "%T" $pages) }}
Expand Down Expand Up @@ -107,7 +108,7 @@
{{- $params = merge $params $element }}

<div class="col">
{{- partial "assets/card.html" $params -}}
{{- partial $hook $params -}}
</div>
{{- if and (lt $index (sub $max 1)) $separator -}}
<div class="col d-block d-sm-none">
Expand Down
5 changes: 3 additions & 2 deletions layouts/partials/assets/card.html
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
{{- $colorStyle = printf "bg-%s text-bg-%s" $color $color -}}
{{ end }}
{{ end }}
{{- $hook := .hook | default "assets/image.html" }}

<!-- Override arguments -->
{{- $page := "" }}
Expand Down Expand Up @@ -125,7 +126,7 @@
<div class="row g-0 row-cols-1 h-100{{ if $button }} pb-5{{ end }}">
<div class="{{ if eq $orientation "horizontal-sm" }}col-4 col-md-2{{ else }}col-4{{ end }}">
{{- if $thumbnail -}}
{{- partial "assets/image.html" (dict "url" $thumbnail "ratio" (or $ratio "1x1") "wrapper" "h-100 card-img-wrap" "class" "rounded-start card-img-h100" "title" $title "loading" $loading) -}}
{{- partial $hook (dict "url" $thumbnail "ratio" (or $ratio "1x1") "wrapper" "h-100 card-img-wrap" "class" "rounded-start card-img-h100" "title" $title "loading" $loading) -}}
{{- else if $icon -}}
<div class="card-icon p-{{ $padding }} h-100 fa-wrapper d-flex align-items-{{ $align}} justify-content-center {{ $iconStyle }}">
{{- partial "assets/icon.html" (dict "icon" (printf "%s %s" $icon $style)) -}}
Expand All @@ -151,7 +152,7 @@
<!-- Render stacked / default card -->
<div class="card {{ $colorStyle }} {{ $class }} text-{{ $align }}">
{{- if $thumbnail -}}
{{- partial "assets/image.html" (dict "url" $thumbnail "ratio" (or $ratio "16x9") "wrapper" "card-img-wrap" "class" "card-img-top" "title" (or $alt $title) "loading" $loading) -}}
{{- partial $hook (dict "url" $thumbnail "ratio" (or $ratio "16x9") "wrapper" "card-img-wrap" "class" "card-img-top" "title" (or $alt $title) "loading" $loading) -}}
{{- else if $icon -}}
<div class="card-icon p-{{ $padding }} {{ $iconStyle }} text-{{ $align }}">
{{- partial "assets/icon.html" (dict "icon" (printf "%s %s" $icon $style)) -}}
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@gethinode/hinode",
"version": "0.23.0-beta8",
"version": "0.23.0-beta9",
"description": "Hinode is a clean documentation and blog theme for Hugo, an open-source static site generator",
"keywords": [
"hugo",
Expand Down

0 comments on commit 81e0a8e

Please sign in to comment.