v0.2 - zoom, enhance and one setting to rule them all
This release adds a number of useful features such as a default client URL placeholder,
ability to redirect to the front-end URLs when viewing a page in the Wagtail admin, and
an option to redirect the preview to the client URL rather than use the default iframe embed mechanism.
A big change is the move to a single, namespaced settings dictionary - WAGTAIL_HEADLESS_PREVIEW
:
WAGTAIL_HEADLESS_PREVIEW = {
"CLIENT_URLS": {}, # previously HEADLESS_PREVIEW_CLIENTS_URLS
"LIVE_PREVIEW": False, # previously HEADLESS_PREVIEW_LIVE
"SERVE_BASE_URL": None, # new optional setting for HeadlessServeMixin / HeadlessMixin
"REDIRECT_ON_PREVIEW": False, # new optional setting to redirect the preview to the client preview URL
}
We added the HeadlessServeMixin
and HeadlessMixin
mixins for a fuller headless experience. HeadlessMixin
is a combination of HeadlessPreviewMixin
and HeadlessServeMixin
. The latter changes the Page.serve()
method to redirect the page to the front-end URL rather than try to render it. With this, the "View live" buttons in the Wagtail admin are usable again 🥳
Finally, the project structure has changed, with tests moving to the project root and the source code to src/
. This should make for smaller packaged releases 🌍
Changelog
Added
- Add support for a
{SITE_ROOT_URL}
placeholder in "default" preview client URL (#20) - Thanks @jaap3 - Add pre-commit support (#21) - @zerolab
- Add
HeadlessMixin
andHeadlessServeMixin
(#22) - @zerolab based on code from @tbrlpld 🙌 - Add setting to redirect to the client preview URL (#23) - @zerolab based on real world code from @jaap3 🤘