Integrate Google Web Stories Editor in Wagtail Projects.
Project description
wagtail-webstories-editor
Integrate Google Web Stories Editor in Wagtail Projects.
This is an effort to integrate the standalone version of Web Stories for WordPress plugin into wagtail.
Table of Contents
- Overview
- Features
- Installation
- Usage
- Example App
Overview
This package brings Web Stories for WordPress plugin to Wagtail by providing integrations with the Wagtail Admin, mainly by use of custom snippet viewsets
Features
- Editor for creating webstories. The editor brings most features provided by the Web Stories for WordPress
- Dashboard for listing and managing stories
- Settings interface for configuring web stories settings including:
- Google Analytics Integration
- Setting publisher logos
- Opt-in to use Google Cache for videos
- Integration with
Wagtail Images
to use the Wagtail image chooser and Wagtail Media to use it'sMedia Choosers
forAudio
andVideo
- On top of the features provided by the Editor and Dashboard, the package uses most of
the Snippets Optional Features to bring enable
the following features:
- Making WebStories previewable using the wagtail
PreviewableMixin
- Saving revisions for WeStories using
RevisionMixin
- Saving draft changes for WebStories using
DraftStateMixin
- Locking WebStories using
LockableMixin
- Enabling workflows for WebStories using
WorkflowMixin
- Making WebStories previewable using the wagtail
Installation
pip install wagtail-webstories-editor
The following dependencies will be installed as well if not yet installed:
- django-filter
- wagtailmedia
Usage
Add the following to your INSTALLED_APPS
if not yet added:
INSTALLED_APPS = [
...
"wagtail_webstories_editor",
"wagtail.api.v2",
"wagtailmedia",
"django_filters",
"wagtail.contrib.settings",
"django.contrib.sitemaps",
...
]
Run migrations
python manage.py migrate wagtail_webstories_editor
If everything went ok, a new Web Stories
menu item will be to your Wagtail Admin Menu
- Click to show the WebStories dashboard
- Create a new WebStory
- Access WebStories Settings
Settings
WAGTAIL_WEBSTORIES_EDITOR_LISTING_PAGE_MODEL
: Model for your WebStories listing Page. This will be used to generate urls for individual stories, since stories are saved as snippets and not Wagtail Pages. See below for details
Integrating with Wagtail pages for story links and SEO
WebStories uses Wagtail Snippets to integrate the Editor and Dashboard. The settings component uses Wagtail Site Settings.
To get links for individual WebStories on publishing, you create a listing page and tell the WebStories package about it. The package provides an abstract page that you could inherit from:
# app/models.py
from wagtail_webstories_editor.models import AbstractWebStoryListPage
class WebStoryListPage(AbstractWebStoryListPage):
pass
and then in your settings.py
, tell webstories of the page using the setting defined above:
# settings.py
WAGTAIL_WEBSTORIES_EDITOR_LISTING_PAGE_MODEL = "app.WebStoryListPage"
Ideally you should create only one
instance of this WebStoryListPage in your Wagtail Project. If you create multiple,
the first one to be queried will be used
The AbstractWebStoryListPage
adds a few functionalities to help working with WebStories:
- By using Wagtail's RoutablePageMixin,WebStories will be served to users using sub-urls from the listing page
- By extending
get_sitemap_urls
method of the Wagtail's Page model, we are able to add all the urls oflive
WebStories to Wagtail's autogenerated sitemap, and thus making sure your WebStories are well indexed for SEO
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for wagtail-webstories-editor-0.0.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 54f2d72110cdebd5f4b3631b313bda709a0d4d3ff42b1e6f25b56dd3b150074c |
|
MD5 | 88914e51f08d76be58fd740e69a3aed5 |
|
BLAKE2b-256 | 719eadddda5bd09fce672be2da15df72d980135992a8a782764ebf1d8d8c9f8b |
Hashes for wagtail_webstories_editor-0.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 74a28ad7917a983b5cac67f54783b15327127b10e6a0df4b9aea8e2458a462a9 |
|
MD5 | 9d210ea6b9a3370e602c50515ce5cec3 |
|
BLAKE2b-256 | 771b34d1c4a67c87b96e1a89f8e6687a19dfc7cf63ae42c3a41bb340db395e12 |