Skip to main content

DjangoCMS HTML Meta tags for OpenGraph.

Project description

DjangoCMS Meta OG

HTML Meta tags OpenGraph for DjangoCMS. The project is based on the Django Meta OG project.

Install

pip install djangocms-meta-og

Add into settings.py:

INSTALLED_APPS = [
    "django_meta_og",
    "djangocms_meta_og",
    ...
]

TEMPLATES  = [
    {"OPTIONS": {
            "context_processors": [
                "djangocms_meta_og.context_processors.meta",
                ...
            ]
        }
    }
]

Add into the templates:

{% load djangocms_meta_og %}
{% djangocms_meta_og_prefix as og_prefix %}
<head{% if og_prefix %} prefix="{{ og_prefix }}"{% endif %}>
    {% include "django_meta_og/header_meta.html" %}

The result can be:

<head prefix="og: https://ogp.me/ns#">
    <meta property="og:type" content="website" />
    <meta property="og:title" content="The Title" />
    ...
</head>

Prefix for Meta tags in template

Some Meta tags may already be defined in the template. Their prefix is ​​included in the prefix list via the definition in settings:

META_OG_PREFIX_IN_TEMLATES = (
    ("og", "https://ogp.me/ns#"),
    ("article", "https://ogp.me/ns/article#"),
)

License

BSD License

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

djangocms_meta_og-1.0.2.tar.gz (7.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

djangocms_meta_og-1.0.2-py3-none-any.whl (10.9 kB view details)

Uploaded Python 3

File details

Details for the file djangocms_meta_og-1.0.2.tar.gz.

File metadata

  • Download URL: djangocms_meta_og-1.0.2.tar.gz
  • Upload date:
  • Size: 7.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.12.3

File hashes

Hashes for djangocms_meta_og-1.0.2.tar.gz
Algorithm Hash digest
SHA256 9160bbcd4b48377d88771bdc23225d7b236f9c1cba6acfd8fafdc86aa96c95df
MD5 3bf2d465936bbdec8bf9fa14f227294b
BLAKE2b-256 75660f6ffc45398c021428b195ddca095f4a7b418907a7d4b7c8a8b3819c55f6

See more details on using hashes here.

File details

Details for the file djangocms_meta_og-1.0.2-py3-none-any.whl.

File metadata

File hashes

Hashes for djangocms_meta_og-1.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 942da46e08f5a2166a0ce186134ec82e44de406acc83a26221de6c06b4ed02a2
MD5 f7c7c564c762ad6a28d8b13940cd29f3
BLAKE2b-256 a5bd3a1204a1c6f8447b9070bd366589ede7e570ddb65b57efba6d8dd42e8eea

See more details on using hashes here.

Supported by

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