How to do nested dynamic routing in Gatsby

55 Views Asked by At

I would like a URL structure in my app like:

// Example
https://simplywall.st/stocks/us/tech/nasdaq-aapl/apple

// Route example with params
https://simplywall.st/stocks/:countryCode/:sector/:index/:companyName

How would you make a nested folder structure like this in Gatsby? Ideally, I would love a modal to show the company information if /:index is a list of stocks.

As this feels wrong and I'm not even sure if it's possible...

src
  /pages
    /stocks
      index.tsx
      /{countryCode}
        index.tsx
        /{sector}
          index.tsx
0

There are 0 best solutions below