tinloof / sanity-kit

74 stars 10 forks source link

Rename folders #21

Open Jamiewarb opened 5 months ago

Jamiewarb commented 5 months ago

I was asked about renaming whole folders in the Pages tool, rather than going into each document and changing the pathname manually.

I couldn't see an option for this, so I wanted to float the idea over and see if it's something you'd be interested in?

Happy to discuss an initial implementation plan and then open a PR with it, if it's something you'd like included

siffogh commented 5 months ago

@Jamiewarb thanks for opening this. It's definitely helpful and I'm very curious to see your initial implementation. Could you first share more details on your solution? E.g. Renaming a folder means changing the pathname field of all page documents inside of it, at all levels. It seems pretty dangerous to publish the change directly, so would you show a popup for confirmation?

Jamiewarb commented 5 months ago

Yeah if you're interested then I can write up some initial thoughts on implementation. Agree we need to be clear on the impact and ensure it can't happen accidentally

We'd likely also need to change the slug of both the published and the draft versions