Skip to main content

OpenGraph, Twitter Card and Schema.org snippet tags for Wagtail CMS pages

Project description

wagtail-metadata-mixin

OpenGraph, Twitter Card and Schema.org 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

Compatibility

The current version is tested for compatiblily with the following:

  • Wagtail versions 2.7 to 2.11

  • Django versions 2.2 to 3.2

  • Python versions 3.6 and 3.9

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 {% meta_namespaces_schemaorg %}>
    <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.1.0.tar.gz (12.4 kB view details)

Uploaded Source

Built Distribution

wagtail_metadata_mixin-0.1.0-py3-none-any.whl (15.5 kB view details)

Uploaded Python 3

File details

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

File metadata

File hashes

Hashes for wagtail-metadata-mixin-0.1.0.tar.gz
Algorithm Hash digest
SHA256 190a7100dd1f21d56b4f5915caaffac5296ec0cc75c76f517e48320ab7dd15ba
MD5 c633ee2d76bf81c2016e808c7ee14f2b
BLAKE2b-256 70a13322e96c5d25c8d9a6e2df2565894dddebb1e5861fe4a03647dd13cb9076

See more details on using hashes here.

File details

Details for the file wagtail_metadata_mixin-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for wagtail_metadata_mixin-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f96c0378d2f8768520e3ed2c63b89a5b1d51dcaf5f7422cd43cb6d284b641f96
MD5 b2fef561ae4cc7953e5610142402f404
BLAKE2b-256 97bcbd47d290456bdc4c1b508ca96e2a2acf67c86e00b3c3fe1bdcb30f454995

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