diff --git a/src/pages/alltags.astro b/src/pages/alltags.astro deleted file mode 100644 index 79cca95..0000000 --- a/src/pages/alltags.astro +++ /dev/null @@ -1,32 +0,0 @@ ---- -import Container from "../components/container.astro"; -import Layout from "../layouts/Layout.astro"; -import { latestPosts } from "../utils/content"; ---- - - -
-
-

All Tags

-

Explore the tags used in the blog posts.

-
-
- {latestPosts.map((post) => post.data.tags).flat().reduce((uniqueTags, tag) => { - if (!uniqueTags.includes(tag)) { - uniqueTags.push(tag); - } - return uniqueTags; - }, []).map((tag) => ( - - ))} -
-
-
-
; diff --git a/src/pages/tags/[tags].astro b/src/pages/tags/[tags].astro deleted file mode 100644 index b2545fe..0000000 --- a/src/pages/tags/[tags].astro +++ /dev/null @@ -1,53 +0,0 @@ ---- -import Container from "../../components/container.astro"; -import Postlist from "../../components/postlist.astro"; -import Layout from "../../layouts/Layout.astro"; -import { latestPosts } from "../../utils/content"; - -export const postsForTags = (tagsSlug) => { - return latestPosts.filter((post) => post.data.tags.includes(tagsSlug)); -}; - -const { params } = Astro; -const tagSlug = params.tag; - -const tagPosts = postsForTags(tagSlug); - -export function getStaticPaths() { - const allTags = Array.from( - new Set(latestPosts.flatMap((post) => post.data.tags).flat()) - ); - - console.log('All Tags:', allTags); - - const paths = allTags.map((tag) => ({ - params: { tag: encodeURIComponent(tag) }, - })); - - console.log('Paths:', paths); - - return paths; -} - - - - - ---- - - - -
-
-

Tag: {tagSlug}

-

Hello

-
-
- {tagPosts.map((post) => ( - - ))} -
-
-
-