Skip to main content

OpenGraph, Twitter Card and Google+ snippet tags for Wagtail CMS pages

Project description

wagtail-metadata-mixin

OpenGraph, Twitter Card and Google+ snippet tags for Wagtail CMS pages

Authored by Basil Shubin, and some great contributors.

https://img.shields.io/pypi/v/wagtail-metadata-mixin.svg https://img.shields.io/pypi/dm/wagtail-metadata-mixin.svg https://img.shields.io/github/license/bashu/wagtail-metadata-mixin.svg https://img.shields.io/travis/bashu/wagtail-metadata-mixin.svg

Requirements

You must have django-meta installed and configured, see the django-meta documentation for details and setup instructions.

The current version is tested for compatiblily with the following:

  • Wagtail versions 2.0 to 2.8

  • Django versions 1.11 to 3.0

  • Python versions 3.4 to 3.8

Installation

First install the module, preferably in a virtual environment. It can be installed from PyPI:

pip install wagtail-metadata-mixin

Setup

Make sure the project is configured for django-meta.

Then add the following settings:

INSTALLED_APPS += (
    'wagtailmetadata',
)

and just include meta/meta.html template in your templates

{% load meta %}

<html>
    <head {% meta_namespaces %}>
        {% include "meta/meta.html" %}
    </head>
    <body>...</body>
</html>

Usage

# models.py

from wagtail.core.models import Page, PageBase

from wagtailmetadata.models import MetadataPageMixin

# ensure MetadataPageMixin class goes before Page class
class CustomPage(MetadataPageMixin, Page):
    promote_panels = Page.promote_panels + MetadataPageMixin.panels

Contributing

If you like this module, forked it, or would like to improve it, please let us know! Pull requests are welcome too. :-)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

wagtail-metadata-mixin-0.0.8.tar.gz (5.6 kB view details)

Uploaded Source

Built Distribution

wagtail_metadata_mixin-0.0.8-py2.py3-none-any.whl (5.3 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file wagtail-metadata-mixin-0.0.8.tar.gz.

File metadata

File hashes

Hashes for wagtail-metadata-mixin-0.0.8.tar.gz
Algorithm Hash digest
SHA256 a43a8fe4db506ad14119157838ab2da21cfe23070e7e4f038c2b0d05cc0d6384
MD5 6fa98eed7147ae553935cb2f654559c0
BLAKE2b-256 709a66a78665f9998c42da676e96637efed8544011c7034ec5f9775f2dda7382

See more details on using hashes here.

File details

Details for the file wagtail_metadata_mixin-0.0.8-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for wagtail_metadata_mixin-0.0.8-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 a20fe8a2cbaee7910392e67811fd6fe9ac1af52e1090e7c69bc6a53f023134ba
MD5 2e35d679b42ee5a3d5b63e8abbb1c320
BLAKE2b-256 eb3f7dc394dd4f7d4046391199cee31a77fa8b2b3ba462d62e9bae142f0452e2

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page