Api to get all routes #1411
-
hello. Is there an api to get all routes ? I saw it in I would like to gen a menu using _pageRoutes . But it might suffer from a breaking change some day. Is there a more suitable way to do that? Additionally,Can I add some metadata for a route like vue-route's usage ? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
I think you should create an API route, or use Telefunc RPC to read your const onRenderHtml: OnRenderHtmlAsync = async (pageContext) => {
return {
documentHtml,
pageContext: {
menu,
},
};
} |
Beta Was this translation helpful? Give feedback.
I think you should create an API route, or use Telefunc RPC to read your
pages
structure --> Transform that like you want.If you always need that menu, inject it in the
renderPage
function if you using a server. Vice versa, inject it in return inonRenderHtml
like