Skip to content

npardington/wagtail-metadata-mixin

 
 

Repository files navigation

wagtail-metadata-mixin

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

Authored by Basil Shubin, and some great contributors.

image

image

image

image

Requirements

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

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 django.utils import six
from wagtail.core.models import Page, PageBase

from wagtailmetadata.models import MetadataPageMixin

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

Please see example application. This application is used to manually test the functionalities of this package. This also serves as good example...

You need Django 1.8.1 or above to run that. It might run on older versions but that is not tested.

Contributing

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

About

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

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Python 80.6%
  • HTML 19.4%