aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/layouts/partials/card.html
diff options
context:
space:
mode:
authorJean-Pierre Appel <jeanpierre.appel01@gmail.com>2023-12-25 17:17:21 -0500
committerJean-Pierre Appel <jeanpierre.appel01@gmail.com>2023-12-25 17:17:21 -0500
commitcc1220bfd794dff1fc28bd39cafb63c4b1093cf8 (patch)
tree8d51983970fc62457ed97599d784cfa150b5c766 /layouts/partials/card.html
parenta181759e4a108c35fcf6898abbf17f2a424d85dc (diff)
rewrite layouts
Diffstat (limited to 'layouts/partials/card.html')
-rw-r--r--layouts/partials/card.html53
1 files changed, 53 insertions, 0 deletions
diff --git a/layouts/partials/card.html b/layouts/partials/card.html
new file mode 100644
index 0000000..c451066
--- /dev/null
+++ b/layouts/partials/card.html
@@ -0,0 +1,53 @@
+{{ $cardConfig := .Scratch.Get "cardConfig" }}
+<div class="card">
+<a href="{{ .RelPermalink }}">
+ <li class="card-content">
+ <div class="card-body">
+ <h3 class="card-title">{{ .LinkTitle }}</h3>
+ <p>{{ partial "card/date.html" . }}</p>
+ {{ if $cardConfig.fullSummary }}
+ {{ partial "card/full_summary.html" . }}
+ {{ else }}
+ <p>{{ .Summary }}</p>
+ {{ end }}
+ </div>
+
+ {{ with .Resources.GetMatch .Params.thumbnail }}
+ {{ $image := .Fit "800x500" }}
+ <div>
+ <img class="card-image" src="{{ $image.RelPermalink }}" alt="{{ .Name }}">
+ </div>
+ {{ else }}
+ {{ with .Resources.GetMatch "thumbnail.*" }}
+ {{ $image := .Fit "400x400" }}
+ <div>
+ <img class="card-image" src="{{ $image.RelPermalink }}" alt="{{ $image.Name }}">
+ </div>
+ {{ end }}
+ {{ end }}
+ </li>
+</a>
+{{ if $cardConfig.showMeta }}
+ <hr>
+ {{ with .Params.github }}
+ {{ partial "links/github.html" . }}
+ {{ end }}
+ {{ with .Params.link }}
+ {{ partial "links/link.html" . }}
+ {{ end }}
+ {{ with .Params.site }}
+ {{ partial "links/site.html" . }}
+ {{ end }}
+ {{ $hasMetaAttrs := or $cardConfig.showCategories $cardConfig.showTags }}
+ {{ if $hasMetaAttrs }}
+ <div class="card-meta">
+ {{ if $cardConfig.showCategories }}
+ {{ partial "categories.html" . }}
+ {{ end }}
+ {{ if $cardConfig.showTags }}
+ {{ partial "tags.html" . }}
+ {{ end }}
+ </div>
+ {{ end }}
+{{ end }}
+</div>