BeaconCMS / beacon

Open-source content management system (CMS) built with Phoenix LiveView. Faster render times to boost SEO performance, even for the most content-heavy pages.
https://beaconcms.org
MIT License
1.04k stars 101 forks source link

`BeaconAssigns` should not rely on page modules on Visual Editor #667

Closed leandrocp closed 2 days ago

leandrocp commented 1 week ago

Building BeaconAssigns for the Visual Editor should not depend on published pages nor published layouts, ie: it can't depend on page_module or layout_module because they might not be published.

We should add a source arg to let https://github.com/BeaconCMS/beacon/blob/main/lib/beacon/web/controllers/api/page_json.ex build a @beacon assign without published pages.

We'll need a function to build the page assigns that returns the same result as https://github.com/BeaconCMS/beacon/blob/f0413a0861c17b54abfd11100a6279fc5cfff40a/lib/beacon/loader/page.ex#L71 so we can change https://github.com/BeaconCMS/beacon/blob/f0413a0861c17b54abfd11100a6279fc5cfff40a/lib/beacon/web/beacon_assigns.ex#L68 to use it when the source is the visual editor.