upstream #1

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

View File

@ -1,5 +1,5 @@
import { slug } from 'github-slugger' import { slug } from 'github-slugger'
import { allCoreContent } from 'pliny/utils/contentlayer' import { allCoreContent, sortPosts } from 'pliny/utils/contentlayer'
import siteMetadata from '@/data/siteMetadata' import siteMetadata from '@/data/siteMetadata'
import ListLayout from '@/layouts/ListLayoutWithTags' import ListLayout from '@/layouts/ListLayoutWithTags'
import { allBlogs } from 'contentlayer/generated' import { allBlogs } from 'contentlayer/generated'
@ -34,8 +34,8 @@ export default function TagPage({ params }: { params: { tag: string } }) {
const tag = decodeURI(params.tag) const tag = decodeURI(params.tag)
// Capitalize first letter and convert space to dash // Capitalize first letter and convert space to dash
const title = tag[0].toUpperCase() + tag.split(' ').join('-').slice(1) const title = tag[0].toUpperCase() + tag.split(' ').join('-').slice(1)
const filteredPosts = allCoreContent( const filteredPosts = allCoreContent(sortPosts(
allBlogs.filter((post) => post.tags && post.tags.map((t) => slug(t)).includes(tag)) allBlogs.filter((post) => post.tags && post.tags.map((t) => slug(t)).includes(tag))
) ))
return <ListLayout posts={filteredPosts} title={title} /> return <ListLayout posts={filteredPosts} title={title} />
} }