Skip to content

thibaudcolas/wagtail-bakerydemo-archive

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

40 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Wagtail bakerydemo archive

Static snapshots of Wagtail’s bakerydemo across past versions of the CMS.

Supported features

Due to the snapshots being static, there are a few clear limitations:

  • Content / data is not editable. Form fields can be updated, but saving the changes won’t work.
  • Parts of the CMS relying on API calls only show their most basic functionality, such as:
    • Choosers
    • Live previews

Creating a new snapshot

First get a new bakerydemo copy set up:

mkdir v7.4
cd v7.4
git clone git@github.com:wagtail/bakerydemo.git
cd bakerydemo
# Remove the bakerydemodb from the list.
vim .gitignore
# Edit the wagtail requirement to target the desired version.
# Depending on the selected version, you may also need to switch to a specific commit of the bakerydemo, or make arbitrary changes to the code.
vim requirements/base.txt
uv venv
source venv/bin/activate
uv pip install -r requirements.txt
uv run ./manage.py migrate
uv run ./manage.py load_initial_data
uv run ./manage.py collectstatic
uv run ./manage.py shell < ../../evergreen/demo_data.py
uv run ./manage.py import_redirects --src ../../evergreen/redirects.csv

Then manually create additional data:

  • Redirects

Make sure to configure the demo correctly for static exports:

cp -R ../evergreen/static_demo bakerydemo

And edit the dev.py settings to add:

MIDDLEWARE.append("static_demo.middleware.AutoLoginMiddleware")
WAGTAILADMIN_BASE_URL = "https://static-wagtail-v7-4.netlify.app"

Then:

uv run ./manage.py runserver 0:8000

Then prepare the backup,

cd v7.4
cp ../evergreen/backup.sh .
./backup.sh --user admin --path /admin --site static-wagtail-v7-4
# Make sure to update the urlpatterns before running each script.
./backup.sh --user german --path /admin-german --site static-wagtail-v7-4
./backup.sh --user arabic --path /admin-arabic --site static-wagtail-v7-4
./backup.sh --user editor --path /admin-editor --site static-wagtail-v7-4
./backup.sh --user dark --path /admin-dark --site static-wagtail-v7-4
# See which files are taking up a lot of place.
cd static-wagtail-v7-4
du -h admin-*/*/* | sort -h
rm -rf admin-*/pages/add
mogrify -quality 35 media/images/*.avif
for f in media/images/*.jpg; do ~/.bin/jpegli/build/tools/cjpegli -q 45 "${f}" "${f}"; done
# Final touches
netlify deploy --dir .
zip -r static-wagtail-v7-4.zip static-wagtail-v7-4

The last step of the backup script is to copy API response payloads, and set up redirects in Netlify so the right payload is served based on query parameter. This is only needed for the page explorer – other parts of the CMS will work with any static files server.

See also: Wagtail UI experiments.

About

Static snapshots of Wagtail’s bakerydemo across past versions of the CMS.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors