Skip to content

Commit 68af0f4

Browse files
committed
Only link to selected blog categories in /blog
1 parent d2200f7 commit 68af0f4

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/components/blog-page/index.tsx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import { BlogCard } from "./blog-card"
1111
import { BlogMdxContent } from "./mdx-types"
1212
import { FeaturedBlogPosts } from "./featured-blog-posts"
1313
import { tagColors } from "@/app/conf/_design-system/tag-colors"
14+
import { blogCategories } from "./blog-categories"
1415

1516
const mask = `url(${new URL("./blur-bean.webp", import.meta.url).href})`
1617

@@ -61,6 +62,11 @@ export function BlogPage({
6162
<h3 className="typography-menu">Categories</h3>
6263
<ul className="mt-4 flex gap-2 pb-2 max-sm:overflow-auto sm:flex-wrap">
6364
{Object.entries(tags)
65+
.filter(([tag]) =>
66+
// we generate pages for all tags, but link only to a selected subset
67+
// to avoid category pages with 1 post
68+
(blogCategories as readonly string[]).includes(tag),
69+
)
6470
.sort((a, b) => b[1] - a[1])
6571
.map(([tag, count], i) => (
6672
<NextLink

0 commit comments

Comments
 (0)