Skip to main content

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

Project description

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

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

The current version is tested for compatiblily with the following:

  • Wagtail versions 2.7 to 2.15

  • Django versions 2.2 to 3.2

  • Python versions 3.6 and 3.9

Authored by Basil Shubin, and some great contributors.

Installation

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

pip install wagtail-metadata-mixin

Requirements

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

Setup

First 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>

Check django-meta documentation for more details.

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):
    schemaorg_type = "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. :-)

License

wagtail-embedvideos is released under the MIT license.

Changes

2.0.1 (2021-11-29)

  • Added ru translation.

2.0.0 (2021-11-28)

  • Added Wagtail 2.15 and Django 3.2 support.

  • Dropped Wagtail 2.7 support.

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-2.0.1.tar.gz (9.0 kB view details)

Uploaded Source

Built Distribution

wagtail_metadata_mixin-2.0.1-py3-none-any.whl (11.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: wagtail-metadata-mixin-2.0.1.tar.gz
  • Upload date:
  • Size: 9.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.6.0 importlib_metadata/4.8.2 pkginfo/1.8.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.10.0

File hashes

Hashes for wagtail-metadata-mixin-2.0.1.tar.gz
Algorithm Hash digest
SHA256 c60a739caa3840171ca45f56e795b873e73958f3b6ef8da6b61935f9e9b3c185
MD5 2802c2bd3f0c633bd251e4a0f059bbec
BLAKE2b-256 87a407135fb05735bd3930039d8435f41c629a17984f8503d19aae6e76305c3b

See more details on using hashes here.

File details

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

File metadata

  • Download URL: wagtail_metadata_mixin-2.0.1-py3-none-any.whl
  • Upload date:
  • Size: 11.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.6.0 importlib_metadata/4.8.2 pkginfo/1.8.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.10.0

File hashes

Hashes for wagtail_metadata_mixin-2.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 2fb649f555ff4fd16c36593c6382d78f66b732365a33ee66c6fb73134f2f9e05
MD5 63771b4ef565b8929baf895cbbd2113a
BLAKE2b-256 af001ae6081f80ec6eb6ae05f685b0ee1d6de40cd98120990cce0154e147dfa8

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