delete tags pages for now
This commit is contained in:
parent
1fc9ee94c1
commit
e161f95aa4
|
@ -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>
|
|
|
@ -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>
|
|
Loading…
Reference in New Issue