Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Card component/partial min-height #1720

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 23 additions & 22 deletions layouts/partials/card.html
Original file line number Diff line number Diff line change
@@ -1,26 +1,27 @@
{{/* hover:drop-shadow-[0_0_2px_rgba(249,115,22,1) */}}

<article
class="max-w-sm overflow-hidden shadow-xl bg-gray6 y-6 hover:scale-105 rounded-xl transition-transform ease-in-out duration-500"
>
<a href="{{ .context.RelPermalink }}" class="no-underline">
{{/* if img is defined, use it, otherwise default */}} {{ $img := cond
(isset . "img") .img (print .context.RelPermalink "img/featured.webp") }}
{{/* make sure file exists */}} {{ $img := cond (fileExists $img) $img
"/img/default-cover.webp" }}

{{/* hover:drop-shadow-[0_0_2px_rgba(249,115,22,1) */}}
<img
class="w-full m-0 mb-1 rounded-t-xl"
src="{{ $img }}"
alt="{{ .context.Title }}"
/>


<article class="max-w-sm overflow-hidden shadow-xl bg-gray6 y-6 hover:scale-105 rounded-xl transition-transform ease-in-out duration-500">
<a href="{{ .context.RelPermalink }}" class="no-underline">

{{/* if img is defined, use it, otherwise default */}}
{{ $img := cond (isset . "img") .img (print .context.RelPermalink "img/featured.webp") }}
{{/* make sure file exists */}}
{{ $img := cond (fileExists $img) $img "/img/default-cover.webp" }}

<img class="w-full m-0 mb-1 rounded-t-xl" src="{{ $img }}" alt="{{ .context.Title }}">

<section class="p-5">
<h5>{{ .context.Title }}</h5>
<p class="text-gray3 min-h-[100px]">{{ .context.Description }}</p>
{{ range .context.Params.tags }}
<span class="tag tag-{{ . }}">
#{{ . }}
</span>
{{ end }}
</section>
</a>
<section class="p-5 min-h-[250px] flex flex-col justify-between">
<h5>{{ .context.Title }}</h5>
<p class="text-gray3">{{ .context.Description }}</p>
<div class="row">
{{ range .context.Params.tags }}
<span class="tag tag-{{ . }}"> #{{ . }} </span> {{ end }}
</div>
</section>
</a>
</article>