wagtail / guide

A website to teach Wagtail CMS to content editors, moderators and administrators.
https://guide.wagtail.org
BSD 3-Clause "New" or "Revised" License
32 stars 26 forks source link

Add ability to export current content (automated or manual) #160

Open lb- opened 2 years ago

lb- commented 2 years ago

With the removal of the versioning solution (see https://github.com/wagtail/guide/issues/62 & https://github.com/wagtail/guide/pull/143 ) we will lose the ability to have a historic record of the Guide.

This will be a reasonably but downgrade from the current RTD solution where anyone can link to the guide for any older version. This is particularly useful for those who only use the LTS versions.

It would be good to be able to provide some kind of future proofing of this loss of detail via a way to export the current site.

This way we can store these somehow and when we do add versioning back we can import this content.

Proposed solution idea 1 - nightly JSON dump to this repo

We automatically use the Django dump data feature and get the CI to commit to this repo - replacing one large JSON file each day.

This would need to be sanitized somewhat (user emails / names) but could be a quick way to resolve this.

Proposed solution idea 2 - Static html export

Similar to above but we have a manual or automatic way to export a static html build of the entire guide. This could be good for those that want to host the content locally/ offline or even remix it.

Could be extended to an epub and even markdown export in the future.

This could also save the html to the rpo. But maybe a seperate isloated branch to avoid too much noise.

This could use bakery or Wagtail freeze.

saevarom commented 2 years ago

@thibaudcolas I'm guessing this is not relevant after yesterday's discussion and decisions?

lb- commented 2 years ago

I still think there's a case for this feature - being able to remix / reuse the content (similar to how current docs explort pdf/epub).

But as per Slack - if we will have versioning still within the CMS (via translations) - it's probably lower priority.

saevarom commented 2 years ago

Yes, I agree that a historic record is very useful.

allcaps commented 1 year ago

Other reasons to provide a 'dump of the contents' are:

Brain dump

A management command that:

  1. Runs dumpdata to output a YYYMMDD-data.json
  2. Automatically create a Wagtail Document for that dump
  3. ZIP the relevant parts of the media folder (documents and original images).
  4. Create a Wagtail Document for the media zip

A periodic task could call this management command. Snapshots can be presented on a download page.

Example of a dumpdata command:

./manage.py dumpdata --natural-foreign --indent 2 \
    -e contenttypes -e auth.permission -e postgres_search.indexentry \
    -e wagtailcore.groupcollectionpermission \
    -e wagtailcore.grouppagepermission -e wagtailimages.rendition \
    -e sessions > YYYMMDD-data.json

The -e excludes tables that we don't want to share. We should exclude users, comments, feedback, etc.

To load the dump./manage.py loaddata data.json and unzip the media into the correct directory.