Skip to content

Commit 9ddc1d1

Browse files
committed
Cards: Fix bugs with the card due to merge
1 parent 0c0867b commit 9ddc1d1

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

assets/css/v2/style.css

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1482,13 +1482,16 @@ h6:has(a):hover {
14821482

14831483
&.featured-section {
14841484
/* Hide all the cards past 3 if it is a featured card section */
1485-
.card-section-content > *:nth-child(n + 4 of div.card) {
1485+
.card-section-content > *:nth-child(n + 4 of a.card) {
14861486
display: none;
14871487
}
14881488
}
14891489
}
14901490

14911491
.card {
1492+
color: oklch(var(--color-foreground));
1493+
text-decoration: none;
1494+
14921495
.card-container {
14931496
display: flex;
14941497
flex-direction: column;
@@ -1500,6 +1503,7 @@ h6:has(a):hover {
15001503
flex-direction: row;
15011504
gap: 1rem;
15021505
align-items: center;
1506+
color: oklch(var(--color-brand));
15031507

15041508
.card-brand-icon {
15051509
height: 20px;

layouts/shortcodes/card.html

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,16 @@
3232
{{ $dataGrid = "half"}}
3333
{{ end }}
3434

35+
{{- /* Building the url */ -}}
36+
{{ $product := index (split .Page.RelPermalink "/") 1 }}
37+
{{ $href := printf "%s" $titleUrl }}
38+
{{ if not (eq $titleUrl ".") }}
39+
{{ $href = printf "/%s/%s" $product $titleUrl }}
40+
{{ end }}
41+
3542
{{- /* Validate that the parent is card-section and under 3 cards */ -}}
3643
{{- if (eq .Parent.Name "card-section") -}}
37-
<a href="{{- $titleUrl -}}" alt="{{- $title -}}" class="card{{ if eq $isFeatured "true" }} featured-card{{ end }}" data-grid="{{ $dataGrid }}" data-testid="{{ if eq $isFeatured "true" }}card__featured-card{{else}}card{{ end }}">
44+
<a href="{{- $href -}}" alt="{{- $title -}}" class="card{{ if eq $isFeatured "true" }} featured-card{{ end }}" data-grid="{{ $dataGrid }}" data-testid="{{ if eq $isFeatured "true" }}card__featured-card{{else}}card{{ end }}">
3845
<div class="card-container">
3946
{{- if $title -}}
4047
<div class="card-header">

0 commit comments

Comments
 (0)