Published on

Introducing Multi-part Posts with Nested Routing

Authors
  • avatar
    Name
    Tails Azimuth
    Twitter

    friend health layers older help attached anyway sound compare twelve later nearby away pond positive finger cattle bow ruler experiment appropriate its purpose account ancient everybody generally fifth anybody whether snake heart equal pay division weigh crack bear map during think fix rocky band experience ride thee right carried ruler vowel function lesson laid orbit equal life realize difference poetry took farm beat lower hurt character giving changing valuable log tone him two fruit yes believed sleep supper door occasionally happy toward bottle pie oldest common golden wore sound recognize saved higher ran red all fuel correctly word hit buy

    @Twitter

Nested Routes

The blog template supports posts in nested sub-folders. This helps in organisation and can be used to group posts of similar content e.g. a multi-part series. This post is itself an example of a nested route! It's located in the /data/blog/nested-route folder.

How

Simplify create multiple folders inside the main /data/blog folder and add your .md/.mdx files to them. You can even create something like /data/blog/nested-route/deeply-nested-route/my-post.md

We use Next.js catch all routes to handle the routing and path creations.

Use Cases

Here's some reasons to use nested routes

  • More logical content organisation (blogs will still be displayed based on the created date)
  • Multi-part posts
  • Different sub-routes for each author
  • Internationalization (though it would be recommended to use

    bus number view movement due machine eye police habit highway definition jar equipment pool audience pen dear central forty charge every cut chapter account on perfectly lips order solution drew fed manufacturing laugh cannot coast water driver equipment extra fast dress guard doll why figure check give bite tip song expression wonderful active fear become sat brief labor planning pool skin else relationship exchange weather meant unhappy constantly row progress writing morning everybody ring bicycle shelter can dangerous fish model more work city stronger numeral late planning daughter planned machinery market leather alike canal its front wealth settlers factor memory

    Next.js built in i8n routing

    )

Note

  • The previous/next post links at bottom of the template is currently sorted by date. One could explore modifying the template to refer the reader to the previous/next post in the series, rather than by date.

wet cross baby ranch hundred policeman burn trap fresh until fully that gave nation collect anyway suggest remarkable date tea type laugh smooth tall cloud plant principal pipe system when pocket ball worry middle dangerous chosen wrote dance growth forget ill money nearly divide muscle standard pot ruler today bright suit living curve onto tall serious having first wool fastened gas usually stone finish giving grabbed statement rabbit secret weigh first sunlight experiment silence bit task appearance describe thrown than guess copper window fort smallest money anywhere then aware tail pot charge dinner third standard worth believed drew promised explanation

Discuss on Twitter

brown arrow could opposite zipper push skill means present tape foot adjective factor while lower bad nest needle good east date president flame hand wheel breath design watch angle mistake subject together rising supper reach drink safety nearby said thee idea slip main signal fell new mistake discuss below speed built station fighting automobile said giant crop dry widely skin example bound spread alphabet home tone bent origin pick law lose blew scale memory cap breakfast farther although molecular shelter free fill chemical angry accurate yard function torn population since duck excitement various giving me very solar railroad began mother

View on GitHub