CloudCannon / bookshop

📚 A component development workflow for static websites.
MIT License
249 stars 21 forks source link

Support Astro.locals inside live editor #180

Open oliverlynch opened 11 months ago

oliverlynch commented 11 months ago

I have setup my site navigation code using astro middleware to make it accessible sitewide via Astro.locals. Astro.locals is constant once the middleware is run - so I am wondering if it would be possible to define the Astro.locals constant inside the live editor.

This would also prove useful as a workaround for #154 - allowing collections information to be accessed within bookshop components in the live editor. I wouldn't expect the collections information to update live, only at build time.