File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed
Expand file tree Collapse file tree 1 file changed +3
-3
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'
@@ -34,8 +34,8 @@ export default function TagPage({ params }: { params: { tag: string } }) {
3434 const tag = decodeURI ( params . tag )
3535 // Capitalize first letter and convert space to dash
3636 const title = tag [ 0 ] . toUpperCase ( ) + tag . split ( ' ' ) . join ( '-' ) . slice ( 1 )
37- const filteredPosts = allCoreContent (
37+ const filteredPosts = allCoreContent ( sortPosts (
3838 allBlogs . filter ( ( post ) => post . tags && post . tags . map ( ( t ) => slug ( t ) ) . includes ( tag ) )
39- )
39+ ) )
4040 return < ListLayout posts = { filteredPosts } title = { title } />
4141}
You can’t perform that action at this time.
0 commit comments