How to put /dashboard in dashboard/index.ts?

Hello! Let’s say I have a Dashboard page and I want it to be located at dashboard/index.ts inside the pages directory. How would I go about doing this?

I am wanting to have my Dashboard Home page path be /dashboard but still stored in a folder so I can use a middleware file for the folder.

Any help is appreciate!

Hey @royal_fox,
I think setting page path to /dashboard/index in studio, should work. PFA


Just tried it out and it makes the url path /dashboard/index which is not what I want.

It made an index folder inside of dashboard instead of just an index.ts file.

Are you using headless API or codegen? If the former, follow the quickstart, and create your file as pages/dashboard/index.ts. If the latter, you can relocate the generated wrapper file there and update plasmic.json accordingly.

I am using codegen. That makes sense. Thank you!

Is there anyway to stop the file recreation notifications for plasmic watch since I moved the file location?

@yang shouldn’t /dashboard/index create an index file inside dashboard folder??

It seems like there might not be support for file structuring where you have pages inside folders that are named index.tsx.

This is the structure it creates with dashboard/index

Screen Shot 2022-02-23 at 2.24.09 PM.png

I asked because it works perfectly fine with dynamic routes. PFA.



It works when I use brackets for a dynamic route, just not index. Very interesting haha