statamic / ideas

💡Discussions on ideas and feature requests for Statamic
https://statamic.dev
30 stars 1 forks source link

Ability to use different domain for preview mode #1046

Closed lotarbo closed 9 months ago

lotarbo commented 9 months ago

In doc https://statamic.dev/live-preview#headless-frontend-frameworks it says that we need to write frontend domain, and that mean that we hardcoded it. It's not very useful, if we have multisite or many envs, and i can't use permalink, because i need custom url for preview endpoint. Maybe It's possible to add something like {site_url} which uses sites.*.url from config or similar, to build a preview target like this {site_url}/api/preview?slug={slug}?

jasonvarga commented 9 months ago

You'll be able to do this in the next release due to https://github.com/statamic/cms/pull/8780

{site:permalink}/api/preview?slug={slug}