Skip to content

Commit

Permalink
Contain aspect ratio of svg card thumbnails
Browse files Browse the repository at this point in the history
  • Loading branch information
markdumay committed Nov 20, 2024
1 parent 2c2cd59 commit 261c174
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 7 deletions.
15 changes: 12 additions & 3 deletions exampleSite/hugo_stats.json
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,7 @@
"mt-5",
"mt-auto",
"mt-md-0",
"multi-docs-collapse-15",
"multi-docs-collapse-41",
"multi-file-collapse-1",
"mx-auto",
"mx-md-0",
Expand Down Expand Up @@ -500,7 +500,7 @@
"badge",
"barre-de-navigation",
"blog",
"body-docs-collapse-15",
"body-docs-collapse-41",
"body-file-collapse-1",
"bouton",
"breadcrumb",
Expand All @@ -517,6 +517,8 @@
"collapse",
"collapse-1",
"command-prompt",
"comment-nous-partageons-vos-informations",
"comment-utilisons-nous-les-cookies-",
"cookies-etc",
"custom-activity",
"data-tables",
Expand Down Expand Up @@ -557,13 +559,14 @@
"fichier",
"fil-dariane",
"file",
"footer-docs-collapse-15",
"footer-docs-collapse-41",
"footer-file-collapse-1",
"formula-katex",
"formule-katex",
"gegevenstabellen",
"groupe-de-boutons",
"groupe-de-cartes",
"gérer-les-préférences-des-cookies",
"how-do-we-use-cookies",
"how-we-share-your-information",
"icon",
Expand All @@ -577,6 +580,7 @@
"language-selector",
"leaflet-map-0",
"lien",
"liens-vers-des-tiers-et-utilisation-de-vos-informations",
"link",
"lottie-animation-0",
"manage-cookie-preferences",
Expand All @@ -602,12 +606,14 @@
"projects",
"projets",
"publication",
"que-sont-les-cookies-",
"release",
"réduire",
"security",
"spinner",
"sub",
"sup",
"sécurité",
"table",
"third-party-links--use-of-your-information",
"timeline",
Expand All @@ -619,8 +625,11 @@
"toast-message-email-4",
"toc-collapse",
"tooltip",
"types-de-cookies-que-nous-utilisons",
"types-of-cookies-we-use",
"video",
"vidéo",
"vos-droits",
"what-are-cookies",
"your-rights"
]
Expand Down
14 changes: 13 additions & 1 deletion layouts/partials/assets/card.html
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,19 @@
<div class="row g-0 row-cols-2 h-100{{ if $button }} pb-5{{ end }}">
{{- if $thumbnail -}}
<div class="{{ $col1 }}">
{{- partial $hook (dict "url" $thumbnail "ratio" (or $ratio "1x1") "portrait" $portrait "sizes" $sizes "anchor" $anchor "wrapper" "h-100 card-img-wrap" "class" "rounded-start card-img-h100 card-img-bg" "title" $title "loading" $loading) -}}
{{ $fullHeight := "card-img-h100" }}
{{ if eq (lower (path.Ext $thumbnail)) ".svg" }}{{ $fullHeight = "" }}{{ end }}
{{- partial $hook (dict
"url" $thumbnail
"ratio" (or $ratio "1x1")
"portrait" $portrait
"sizes" $sizes
"anchor" $anchor
"wrapper" "h-100 card-img-wrap d-flex align-items-center"
"class" (printf "rounded-start card-img-bg %s" $fullHeight)
"title" $title
"loading" $loading
) -}}
</div>
{{- else if $icon -}}
<div class="{{ $col1 }} p-{{ $padding }}">
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.27.10",
"version": "0.27.11",
"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 261c174

Please sign in to comment.