diff --git a/src/pages/posts/post-1.md b/src/pages/posts/post-1.md index e980348..6d0250e 100644 --- a/src/pages/posts/post-1.md +++ b/src/pages/posts/post-1.md @@ -7,9 +7,7 @@ author: Ruidy image: url: "https://docs.astro.build/assets/rose.webp" alt: "The Astro logo on a dark background with a pink glow." -tags: - - astro - - blog +tags: ["astro", "blogging", "learning in public"] --- Welcome to my _new blog_ about learning Astro! Here, I will share my learning journey diff --git a/src/pages/tags/[tag].astro b/src/pages/tags/[tag].astro new file mode 100644 index 0000000..9df9821 --- /dev/null +++ b/src/pages/tags/[tag].astro @@ -0,0 +1,27 @@ +--- +import BLogPost from "../../components/BLogPost.astro"; +import BaseLayout from "../../layouts/BaseLayout.astro" + +export async function getStaticPaths() { + const posts = Object.values(import.meta.glob('../posts/*.md', { eager: true })); + return [ +{params: {tag: "astro"}, props: {posts }}, + { params: { tag: "successes" }, props:{ posts} }, + { params: { tag: "community" } , props:{ posts} }, + { params: { tag: "blogging" }, props:{ posts} }, + { params: { tag: "setbacks" }, props:{ posts} }, + { params: { tag: "learning in public" }, props:{ posts} }, + ] +} + +const { tag } = Astro.params +const { posts } = Astro.props +const filteredPosts = posts.filter((post:any) => post.frontmatter.tags?.includes(tag)) +--- + + +

Posts tagged with {tag}

+ +