nephila/djangocms-page-meta

View on GitHub
djangocms_page_meta/templates/djangocms_page_meta/meta.html

Summary

Maintainability
Test Coverage
{% load meta_extra %}
{% if meta %}
    {% autoescape off %}
    {% if meta.description %}{% meta 'description' meta.description %}{% endif %}
    {% if meta.keywords %}{% meta_list 'keywords' meta.keywords %}{% endif %}
    {% if meta.use_og %}
        {% if meta.title %}{% og_prop 'title' meta.title %}{% endif %}
        {% if meta.url %}{% og_prop 'url' meta.url %}{% endif %}
        {% if meta.og_description %}{% og_prop 'description' meta.og_description %}{% endif %}
        {% if meta.image %}{% og_prop 'image' meta.image %}{% endif %}
        {% if meta.og_type %}{% og_prop 'type' meta.og_type %}{% endif %}
        {% if meta.site_name %}{% og_prop 'site_name' meta.site_name %}{% endif %}
        {% if meta.og_author_url %}
            {% generic_prop 'article' 'author' meta.og_author_url %}
        {% elif meta.og_author %}
            {% generic_prop 'article' 'author:first_name' meta.og_author.first_name %}
            {% generic_prop 'article' 'author:last_name' meta.og_author.last_name %}
        {% endif %}
        {% if meta.published_time %}{% generic_prop 'article' 'published_time' meta.published_time %}{% endif %}
        {% if meta.modified_time %}{% generic_prop 'article' 'modified_time' meta.modified_time %}{% endif %}
        {% if meta.expiration_time %}{% generic_prop 'article' 'expiration_time' meta.expiration_time %}{% endif %}
        {% if meta.og_publisher %}{% generic_prop 'article' 'publisher' meta.og_publisher %}{% endif %}
        {% if meta.og_app_id %}{% generic_prop 'fb' 'app_id' meta.og_app_id %}{% endif %}
        {% if meta.og_profile_id %}{% generic_prop 'fb' 'profile_id' meta.og_profile_id %}{% endif %}
        {% if meta.fb_pages %}{% generic_prop 'fb' 'pages' meta.fb_pages %}{% endif %}
        {% if meta.tag %}{% generic_prop 'article' 'tag' meta.tag %}{% endif %}
        {% if meta.locale %}{% og_prop 'locale' meta.locale %}{% endif %}
    {% endif %}
    {% if meta.use_twitter %}
        {% twitter_prop 'domain' meta.get_domain %}
        {% if meta.twitter_type %}{% twitter_prop 'card' meta.twitter_type %}{% endif %}
        {% if meta.title %}{% twitter_prop 'title' meta.title %}{% endif %}
        {% if meta.url %}{% twitter_prop 'url' meta.url %}{% endif %}
        {% if meta.twitter_description %}{% twitter_prop 'description' meta.twitter_description %}{% endif %}
        {% if meta.image %}{% twitter_prop 'image:src' meta.image %}{% endif %}
        {% if meta.twitter_author %}{% twitter_prop 'creator' meta.twitter_author %}{% endif %}
        {% if meta.twitter_site %}{% twitter_prop 'site_name' meta.twitter_site %}{% endif %}
    {% endif %}
  {% if meta.robots %}{% meta_list 'robots' meta.robots %}{% endif %}
    {% if meta.use_schemaorg %}
        {% if meta.schemaorg_name %}{% schemaorg_prop 'name' meta.schemaorg_name %}{% endif %}
        {% if meta.schemaorg_datePublished %}{% schemaorg_prop 'datePublished' meta.schemaorg_datePublished %}{% endif %}
        {% if meta.schemaorg_dateModified %}{% schemaorg_prop 'dateModified' meta.schemaorg_dateModified %}{% endif %}
        {% if meta.schemaorg_description %}{% schemaorg_prop 'description' meta.schemaorg_description %}{% endif %}
        {% if meta.schemaorg_image %}{% schemaorg_prop 'image' meta.schemaorg_image %}{% endif %}
        {% if meta.schemaorg_url %}{% schemaorg_prop 'url' meta.schemaorg_url %}{% endif %}
    {% endif %}
    {% custom_meta_extras meta.extra_custom_props %}
    {% endautoescape %}
{% endif %}