summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoão Augusto Costa Branco Marado Torres <torres.dev@disroot.org>2025-07-27 20:09:43 -0300
committerJoão Augusto Costa Branco Marado Torres <torres.dev@disroot.org>2025-07-27 20:09:43 -0300
commitb40682ace35b590c909e60d0c8c2556496370a51 (patch)
treec16555866c500e0131ba4a077e9d110ae2646e23
parent4e2b619fe93ac332c8e238ca5dc03d744d3562bd (diff)
feat: style keywords page
Signed-off-by: João Augusto Costa Branco Marado Torres <torres.dev@disroot.org>
-rw-r--r--src/pages/blog/keywords/[keyword].astro (renamed from src/pages/blog/keywords/[...slug].astro)34
1 files changed, 29 insertions, 5 deletions
diff --git a/src/pages/blog/keywords/[...slug].astro b/src/pages/blog/keywords/[keyword].astro
index 724e8b7..8f0494b 100644
--- a/src/pages/blog/keywords/[...slug].astro
+++ b/src/pages/blog/keywords/[keyword].astro
@@ -2,6 +2,7 @@
import { type CollectionEntry, getCollection } from "astro:content";
import Base from "@layouts/Base.astro";
import BlogCard from "@components/BlogCard.astro";
+import SimplePostList from "@components/templates/SimplePostList.astro";
type Props = { posts: CollectionEntry<"blog">[] };
@@ -15,7 +16,7 @@ export async function getStaticPaths() {
).values(),
];
return keywords.map((k) => ({
- params: { slug: k },
+ params: { keyword: k },
props: {
posts: posts.filter((post) =>
post.data.keywords.some((i) => i.localeCompare(k) === 0)
@@ -24,8 +25,8 @@ export async function getStaticPaths() {
}));
}
-const title = "Blog";
-const description = "Latest articles.";
+const title = `Blogue &ndash ${Astro.params.keyword}`;
+const description = `Últimas postagens da categoria ${Astro.params.keyword}.`;
const posts = Astro.props.posts.sort((a, b) =>
new Date(b.data.dateCreated).valueOf() -
@@ -34,7 +35,30 @@ const posts = Astro.props.posts.sort((a, b) =>
---
<Base {title} {description}>
- <main>
- <h2>Blogue</h2> {posts.map((post) => <BlogCard {...post} />)}
+ <main
+ itemprop="mainContentOfPage"
+ itemscope
+ itemtype="https://schema.org/WebPageElement"
+ >
+ <section
+ id="posts"
+ itemprop="citation"
+ itemscope
+ itemtype="http://schema.org/Blog"
+ >
+ <h2 itemprop="name description" set:html={title} />
+ <SimplePostList
+ {posts}
+ dateOptions={{
+ weekday: "long",
+ year: "numeric",
+ month: "long",
+ day: "numeric",
+ hour: "2-digit",
+ minute: "2-digit",
+ timeZoneName: "long",
+ }}
+ />
+ </section>
</main>
</Base>