summaryrefslogtreecommitdiffstats
path: root/layouts/_partials/post-card.html
diff options
context:
space:
mode:
Diffstat (limited to 'layouts/_partials/post-card.html')
-rw-r--r--layouts/_partials/post-card.html16
1 files changed, 16 insertions, 0 deletions
diff --git a/layouts/_partials/post-card.html b/layouts/_partials/post-card.html
new file mode 100644
index 0000000..7dd8c9a
--- /dev/null
+++ b/layouts/_partials/post-card.html
@@ -0,0 +1,16 @@
+{{ $featured := .featured }}
+<article class="post-card {{ if $featured }}featured{{ end }}">
+ {{ if .image }}
+ <img src="{{ .image }}" alt="{{ .title }}" class="post-card-image">
+ {{ else }}
+ <div class="post-card-image" style="background: linear-gradient(135deg, var(--color-{{ .type }}), var(--bg2));"></div>
+ {{ end }}
+ <div class="post-card-body">
+ <div class="post-type-badge {{ .type }}">{{ .type }}</div>
+ <h3 class="post-card-title"><a href="{{ .url }}">{{ .title }}</a></h3>
+ <p class="post-card-excerpt">{{ .description }}</p>
+ <div class="post-card-meta">
+ <span>{{ dateFormat "Jan 2, 2006" .date }}</span>
+ </div>
+ </div>
+</article>