Releases: torchbox/wagtail-headless-preview
v0.8 - overridable `get_client_root_url` and Wagtail 6
The main change is that get_client_root_url
is overridable on your page model inheriting from our mixins. The method takes the request
parameter.
What's Changed
- Update API view endpoint in README.md by @ElectronicRU in #56
- [pre-commit.ci] pre-commit autoupdate by @pre-commit-ci in #55
- Tooling updates and tests against Wagtail 6.0 by @zerolab in #60 and @katdom13 in #62
- Make
get_client_root_url
overridable both in both mixins by @zerolab in #59
New Contributors
- @ElectronicRU made their first contribution in #56
- @katdom13 made their first contribution in #62
Full Changelog: v0.7.0...v0.8
v0.7 - Wagtail 5.1 and 5.2
This release adds official support for Wagtail 5.1 and 5.2, Python 3.12 (via Wagtail 5.2).
It also switches to using Flit for packaging, and PyPI trusted publishing
What's Changed
- Make Wagtail 5.1 support official by @lparsons396 in #50
- Add Wagtail 5.2, Django 5.0 and Python 3.12 to the test matrix by @zerolab in #51
- Flit by @zerolab in #52
- Switch to using PyPI trusted publishing by @zerolab in #53
- Add coverage report on GitHub Action summary by @zerolab in #54
New Contributors
- @lparsons396 made their first contribution in #50
Full Changelog: v0.6.0...v0.7.0
v0.6 - Wagtail 4.1+ and internal 📦 tidy ups
This release makes Wagtail 4.1+ only support official.
It also moves to using ruff under the hood
What's Changed
- Support wagtail 4.2 by @nickmoreton in #44
- Update tox and CI testing by @nickmoreton in #46
New Contributors
- @nickmoreton made their first contribution in #44
Full Changelog: v0.5.0...v0.6.0
v0.5 - fewer race conditions 🏎 and lighter package 🪶
This release fixes a race condition when creating tokens, thanks to @johncarter-phntm.
It also drops the "live preview" functionality as it was somewhat broken, and with Wagtail 4.0 introducing live preview it just made sense to keep things leaner.
What's Changed
- Fix race condition in create_page_preview by @johncarter-phntm in #35
- Prepare 0.5.0 release by @zerolab in #36
New Contributors
- @johncarter-phntm made their first contribution in #35
Full Changelog: v0.4.0...v0.5.0
v0.4 - trailing slashes ///
This is a small maintenance release.
It adds a new ENFORCE_TRAILING_SLASH
setting option to control the preview URL behaviour. It defaults to True
to match the previous logic where the trailing slash was enforced. Set it to False
to respect the URLs defined in CLIENT_URLS
# settings.py
WAGTAIL_HEADLESS_PREVIEW = {
# ...
"ENFORCE_TRAILING_SLASH": True, # set to False in order to disable the trailing slash enforcement
}
HEADLESS_PREVIEW_CLIENT_URLS
and HEADLESS_PREVIEW_LIVE
was now removed. You will get a runtime error if you are still using these settings.
What's Changed
- Add setting for enforcing trailing slash for the preview URL and various other tidy ups by @zerolab in #32
Full Changelog: v0.3.0...v0.4.0
v0.3 - Wagtail 2.15 to 3.0
This is a maintainance release to add support for Wagtail 3.0, and drop support for Wagtail < 2.15.
Thanks @BrianXu20 for the work, and @Tobeyforce for the initial PR
v0.2.1 - deprecated settings not forgotten
This is bug fix for the deprecated settings not picked up correctly. Kudos @Schille for the report 🥷
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 🤘
Changed
0.1.4 - The black release
You can have any linter as long as it is black
New
- Black-ified
- Added linting step and simplified test matrix
Fixes
UNIQUE constraint failed: wagtail_headless_preview_pagepreview.token
- Static files not packaged
- Wrong JS file loaded for live preview
- Wrong token used in live preview.
- Explicit utf-8 encoding for long description to fix
UnicodeDecodeError: 'ascii' codec can't decode byte 0xf0 in position 6282: ordinal not in range(128)
on some systems when trying topip install
Live preview
Adds live preview support.
To enable, set
# settings.py
HEADLESS_PREVIEW_LIVE = True
Note: Your front-end app must be set up for live preview, a feature that usually requires Django Channels or other WebSocket/async libraries.
For an example front-end implementation, see https://github.com/torchbox/wagtail-grapple and its documentation