File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed
Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change 11import { slug } from 'github-slugger'
2- import { allCoreContent } from 'pliny/utils/contentlayer'
2+ import { allCoreContent , sortPosts } from 'pliny/utils/contentlayer'
33import siteMetadata from '@/data/siteMetadata'
44import ListLayout from '@/layouts/ListLayoutWithTags'
55import { allBlogs } from 'contentlayer/generated'
@@ -35,7 +35,7 @@ export default function TagPage({ params }: { params: { tag: string } }) {
3535 // Capitalize first letter and convert space to dash
3636 const title = tag [ 0 ] . toUpperCase ( ) + tag . split ( ' ' ) . join ( '-' ) . slice ( 1 )
3737 const filteredPosts = allCoreContent (
38- allBlogs . filter ( ( post ) => post . tags && post . tags . map ( ( t ) => slug ( t ) ) . includes ( tag ) )
38+ sortPosts ( allBlogs . filter ( ( post ) => post . tags && post . tags . map ( ( t ) => slug ( t ) ) . includes ( tag ) ) )
3939 )
4040 return < ListLayout posts = { filteredPosts } title = { title } />
4141}
You can’t perform that action at this time.
0 commit comments