): string | null => {
+ if (!post.data.tags?.length) {
+ return null;
+ }
+ // TODO: turn those into links, but links to where?
+ return post.data.tags
+ .map((tag) => `#${tag}`)
+ .join(" ");
+};
diff --git a/src/components/starlight/PageTitle.astro b/src/components/starlight/PageTitle.astro
index 9745ce1..b1e1aec 100644
--- a/src/components/starlight/PageTitle.astro
+++ b/src/components/starlight/PageTitle.astro
@@ -3,7 +3,7 @@ import { render } from "astro:content";
import Default from "@astrojs/starlight/components/PageTitle.astro";
-import { getCreatedDate } from "@components/get-posts";
+import { getCreatedDate, getTagsHtml } from "@components/get-posts";
const { remarkPluginFrontmatter } = await render(
// @ts-expect-error – this works, but for some reasons, it doesn’t seem to be compatible at the type level
@@ -11,6 +11,7 @@ const { remarkPluginFrontmatter } = await render(
);
const createdDate = getCreatedDate(Astro.locals.starlightRoute.entry);
+const tags = getTagsHtml(Astro.locals.starlightRoute.entry);
---
@@ -18,9 +19,12 @@ const createdDate = getCreatedDate(Astro.locals.starlightRoute.entry);
{
// Only display the reading time & last updated when it is a doc
Astro.locals.starlightRoute.entry.data.template === "doc" ? (
-
- {remarkPluginFrontmatter.readingTime.displayedText}
- {createdDate ? ` • ${createdDate}` : ""}
-
+ <>
+ {tags ? : null}
+
+ {remarkPluginFrontmatter.readingTime.displayedText}
+ {createdDate ? ` • ${createdDate}` : ""}
+
+ >
) : null
}
diff --git a/src/content/docs/posts/drafts.mdx b/src/content/docs/posts/drafts.mdx
index bb9d063..622ba33 100644
--- a/src/content/docs/posts/drafts.mdx
+++ b/src/content/docs/posts/drafts.mdx
@@ -8,4 +8,4 @@ import { getDraftPosts } from "@components/get-posts";
List of all posts that are in the process, but not ready to be open to public:
-{(await getDraftPosts()).slice(0, 10).map((post) => )}
+{(await getDraftPosts()).slice(0, 10).map((post) => )}
diff --git a/src/content/docs/posts/full.mdx b/src/content/docs/posts/full.mdx
index 0da283d..249952c 100644
--- a/src/content/docs/posts/full.mdx
+++ b/src/content/docs/posts/full.mdx
@@ -4,11 +4,11 @@ template: splash
---
import LinkToPost from "@components/LinkToPost.astro";
-import { getPublishablePostsBySection } from "@components/get-posts";
+import { getPublishablePostsByYear } from "@components/get-posts";
{
-Object.entries(await getPublishablePostsBySection()).map(([section, posts]) => {
-return (<>{section}
-{posts.map(post => )}>)
+Object.entries(await getPublishablePostsByYear()).reverse().map(([year, posts]) => {
+return (<>{year}
+{posts.map(post => )}>)
})
}
diff --git a/src/content/docs/posts/index.mdx b/src/content/docs/posts/index.mdx
index d4f0b27..be5f815 100644
--- a/src/content/docs/posts/index.mdx
+++ b/src/content/docs/posts/index.mdx
@@ -8,7 +8,7 @@ import { getPublishablePosts } from "@components/get-posts";
### Latest posts
-{(await getPublishablePosts()).slice(0, 10).map((post) => )}
+{(await getPublishablePosts()).slice(0, 10).map((post) => )}
### See more
diff --git a/src/content/docs/posts/tags.mdx b/src/content/docs/posts/tags.mdx
index a3f1489..f952fcb 100644
--- a/src/content/docs/posts/tags.mdx
+++ b/src/content/docs/posts/tags.mdx
@@ -6,9 +6,10 @@ template: splash
import LinkToPost from "@components/LinkToPost.astro";
import { getPostsByTags } from "@components/get-posts";
+← View all
{
Object.entries(await getPostsByTags()).map(([tag, posts]) => {
-return (<>#{tag} ({posts.length})
+return (<>
{posts.map(post => - {post.data.title} | {post.data.tags.map(tag => `#${tag}`).join(' ')}
)}
@@ -16,3 +17,18 @@ return (<>#{tag} ({posts.length})
>)
})
}
+
+