-
Notifications
You must be signed in to change notification settings - Fork 67
Description
Description
The doc says:
object_type
This key is used to render the og:type property.
however, when adding it to the model _metadata, I could only get og:type Article. .as_meta() method outputted object_type of my choosing but og_type is always set as Article.
-> Setting og_type instead of object_type fixes the issue, but it doesn't seem to be what the docs recommend?
Steps to reproduce
- Set
object_type: 'website'in_metadata; or even in settings.py of the django site setMETA_SITE_TYPE = "website" - Observe the
object_typegets assigned correctly but the template renders og:type as Article
Versions
Python 3.11, Django 4.2.7, django-meta 2.4.0
Expected behaviour
Docs seem to imply that setting object_type or META_SITE_TYPE will have effect on og:type.
Actual behaviour
Object type seems to have no effect on og:type because of the defaults
Additional information
The template (meta/meta.html) checks for og_type first:
{% if meta.og_type %}{% og_prop 'type' meta.og_type %}
{% elif meta.object_type %}{% og_prop 'type' meta.object_type %}{% endif %}og_type gets filled with defaults, so it'll never fail over. It also doesn't get filled with META_SITE_TYPE or object_type during meta building as far as i understand.