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

Uploaded Source

Built Distribution

wagtail_metadata_mixin-0.1.1-py3-none-any.whl (10.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: wagtail-metadata-mixin-0.1.1.tar.gz
  • Upload date:
  • Size: 8.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.2 CPython/3.8.10

File hashes

Hashes for wagtail-metadata-mixin-0.1.1.tar.gz
Algorithm Hash digest
SHA256 0f05ddb535556b59095fa1ca8a917536c68441b6c388522d8a11c4be0adc4ad5
MD5 2c1418eb4fb96fc75ba21b388dfd2595
BLAKE2b-256 5ad350d4813c5b288bd2260d237252a6beef6be2eab88bcd6aacfdfd4f33dea6

See more details on using hashes here.

File details

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

File metadata

  • Download URL: wagtail_metadata_mixin-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 10.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.2 CPython/3.8.10

File hashes

Hashes for wagtail_metadata_mixin-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 5e08112dcb3b7691f63292e8a4cd777d664add9a102dfd273a51d7e576110a67
MD5 8ac919ac6bce1a8a5e2b72df257e5bd7
BLAKE2b-256 999fadf124af98b17f29673f2345ceaa2617f7b8d3ab565d8622ba9a25809d61

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