delete tags pages for now

This commit is contained in:
Nico 2023-02-03 11:27:12 +01:00
parent 1fc9ee94c1
commit e161f95aa4
2 changed files with 0 additions and 50 deletions

View File

@ -1,30 +0,0 @@
---
import BaseLayout from "../../layouts/BaseLayout.astro";
export async function getStaticPaths({}) {
const allPosts = await Astro.glob("../../content/**/*.mdx");
const uniqueTags = [
...new Set(allPosts.map((post) => post.frontmatter.tags).flat()),
];
return uniqueTags.map((tag) => {
const filteredPosts = allPosts.filter((post) =>
post.frontmatter.tags.includes(tag)
);
return {
params: { tag },
props: { posts: filteredPosts },
};
});
}
const { tag } = Astro.params;
const { posts } = Astro.props;
---
<BaseLayout pageTitle={tag}>
<p>Posts tagged with {tag}</p>
<ul>
{posts.map((post) => <li>{post.frontmatter.title}</li>)}
</ul>
</BaseLayout>

View File

@ -1,20 +0,0 @@
---
import BaseLayout from "../../layouts/BaseLayout.astro";
const pageTitle = "Tag Index";
const allPosts = await Astro.glob("../../content/**/*.mdx");
const tags = [...new Set(allPosts.map((post) => post.frontmatter.tags).flat())];
---
<BaseLayout pageTitle={pageTitle}>
<h2>All the categories</h2>
<ul>
{
tags.map((tag) => (
<li>
<a href={`/tags/${tag}`}>{tag}</a>
</li>
))
}
</ul>
</BaseLayout>