Taxonomy page in Next.js

I try to implement taxonomy page for all the posts in the blog. I want to show something similar to this https://devakimbo.com/authors/adam-faryna/ in terms of nine thumbnail posts per page + pagination. Any idea how it's done in Next.js? thanks

This should be fairly simple but mostly depends on what you use for content management. If you want to group the articles by author, you need to create a page with a dynamic slug, like /authors/[author_name.tsx], otherwise you can just create a new page articles.tsx. On that page, just fetch all articles from your CMS or wherever the data is stored inside your getStaticProps function (or getServerSideProps if you opted for SSR) and render the list of articles.

0 Likes
Adam Faryna Author

@scriptifyjs thanks. Yes, it looks like this problem is solved by using /taxonomy/[taxonomy-term.js] construction. For example: /tag/[tag-slug.js]. I found good example how to fetch content in https://github.com/vercel/next.js/tree/canary/examples/blog-starter.

0 Likes

Please sign in to leave a comment.