plentico / plenti

Static Site Generator with Go backend and Svelte frontend
https://plenti.co
Apache License 2.0
985 stars 50 forks source link

Evaluate path and redirect on content creation #232

Open jimafisk opened 1 year ago

jimafisk commented 1 year ago

When creating new content we use hash routing like http://localhost:3000/#add/pages/test - not the actual path that the content will eventually live at.

This is because we don't necessarily know what the full path is going to be when first adding the content. We allow for route overrides that use :field() to get value from the content source, so those values wouldn't have been created yet.

After the first save of new content, we should compute the path and redirect to it. doing a hard refresh from there is still a race against the CI clock, but it's probably better than staying on the hash which is always expecting to be starting from scratch on reload.