#Best place to scan all routes?

2 messages · Page 1 of 1 (latest)

surreal sluice
#

Where would be the best place, to scan for all availiable routes, by extending the metadata object within a page.tsx with a custom navigation object?

My idea is to build the navigation dynamically based on an object is exported within the metadata object:

/app/statistics/page.tsx

  title: 'Stats',
  navigation: {
    name: 'Stats',
    url: '/statistics',
    icon: 'stats'
  },
};```
I want this to work dynamically as I add pages, but not on every render. (Yes, the dynamic routes will be treated otherwise)
hollow depotBOT
#

🔎 This post has been indexed in our web forum and will be seen by search engines so other users can find it outside Discord

🕵️ Your user profile is private by default and won't be visible to users outside Discord, if you want to be visible in the web forum you can add the "Public Profile" role in id:customize

✅ You can mark a message as the answer for your post with Right click -> Apps -> Mark Solution
(if you don't see the option, try refreshing Discord with Ctrl + R)