upstream #1

Merged
jblu merged 1007 commits from upstream into main 2024-11-04 22:35:57 -06:00
Showing only changes of commit 30e77eda9a - Show all commits

View File

@ -6,6 +6,7 @@ import { allBlogs } from 'contentlayer/generated'
import tagData from 'app/tag-data.json' import tagData from 'app/tag-data.json'
import { genPageMetadata } from 'app/seo' import { genPageMetadata } from 'app/seo'
import { Metadata } from 'next' import { Metadata } from 'next'
import { notFound } from 'next/navigation'
export async function generateMetadata({ params }: { params: { tag: string } }): Promise<Metadata> { export async function generateMetadata({ params }: { params: { tag: string } }): Promise<Metadata> {
const tag = decodeURI(params.tag) const tag = decodeURI(params.tag)
@ -37,5 +38,8 @@ export default function TagPage({ params }: { params: { tag: string } }) {
const filteredPosts = allCoreContent( const filteredPosts = allCoreContent(
sortPosts(allBlogs.filter((post) => post.tags && post.tags.map((t) => slug(t)).includes(tag))) sortPosts(allBlogs.filter((post) => post.tags && post.tags.map((t) => slug(t)).includes(tag)))
) )
if (filteredPosts.length === 0) {
return notFound()
}
return <ListLayout posts={filteredPosts} title={title} /> return <ListLayout posts={filteredPosts} title={title} />
} }