RC: (add) filter by blog tag
Some checks failed
Build and Update Flux / build-push-update (push) Has been cancelled
Some checks failed
Build and Update Flux / build-push-update (push) Has been cancelled
This commit is contained in:
@@ -5,6 +5,7 @@ const posts = (await getCollection('blog'))
|
||||
.sort((a, b) => b.data.pubDate.valueOf() - a.data.pubDate.valueOf())
|
||||
.slice(0, 3);
|
||||
---
|
||||
|
||||
<section class="section recent-posts" id="recent-posts">
|
||||
<div class="container">
|
||||
<div class="section-header">
|
||||
@@ -31,7 +32,7 @@ const posts = (await getCollection('blog'))
|
||||
</time>
|
||||
<div class="post-card-tags">
|
||||
{(post.data.tags ?? []).slice(0,3).map((t: string) => (
|
||||
<span class="tag">{t}</span>
|
||||
<a href={`/tags/${t}`} class="tag" onclick="event.stopPropagation()">{t}</a>
|
||||
))}
|
||||
</div>
|
||||
</div>
|
||||
@@ -51,9 +52,7 @@ const posts = (await getCollection('blog'))
|
||||
</section>
|
||||
|
||||
<style>
|
||||
.recent-posts {
|
||||
padding-bottom: 1rem;
|
||||
padding-top: 15rem; }
|
||||
.recent-posts { padding-bottom: 2rem; }
|
||||
|
||||
.section-header { margin-bottom: 3rem; }
|
||||
|
||||
@@ -128,4 +127,4 @@ const posts = (await getCollection('blog'))
|
||||
@media (max-width: 900px) {
|
||||
.posts-grid { grid-template-columns: 1fr; }
|
||||
}
|
||||
</style>
|
||||
</style>
|
||||
Reference in New Issue
Block a user