Skip to content
This repository has been archived by the owner on Oct 29, 2019. It is now read-only.

Optional Meta Page Support #398

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open

Optional Meta Page Support #398

wants to merge 4 commits into from

Conversation

Nekmo
Copy link

@Nekmo Nekmo commented May 22, 2016

Adds optional support for Django-Page-Meta. If Django-Page-Meta is not in INSTALLED_APPS, will not be used.

Include in your html:

<html {% block html_tag %}{% endblock %}>
<head>
...
{block meta}{% endblock %}

And install and configure Django-Page-Meta.

Thanks to Djangocms-Blog for the list of metadata.

@coveralls
Copy link

coveralls commented May 22, 2016

Coverage Status

Coverage decreased (-0.2%) to 90.559% when pulling 395d37f on Nekmo:master into cc69d86 on aldryn:master.

@coveralls
Copy link

coveralls commented May 23, 2016

Coverage Status

Coverage decreased (-0.2%) to 90.559% when pulling 395d37f on Nekmo:master into cc69d86 on aldryn:master.

{% block html_tag %} itemscope itemtype="http://schema.org/Blog" {% endblock %}

{% block meta_tags %}
<meta name="viewport" content="width=device-width,initial-scale=1">
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

meta_tags is very generic here, that can break your frontend. Should be something like {% blog_meta_tags %} or so. Also the viewport meta tag should be handled by the project frontend, not the blog /cc @vxsx

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To elaborate further: https://github.com/aldryn/aldryn-newsblog/blob/master/aldryn_newsblog/boilerplates/bootstrap3/templates/aldryn_newsblog/base.html#L3 is the standard template. If you want meta integration you just adapt the base.html template to look like:

{% block meta_tags %}
    {{ block.super }}
    {% block newsblog_meta_tags %}{% endblock %}
{% endblock %}
{% block content %}{% endblock content %}

and the article_detail.html just provides the facilities to overwrite it:

{% block newsblog_meta_tags %}
    {% if meta %}
        {% include "aldryn_newsblog/includes/meta.html" with meta=meta %}
    {% endif %}
{% endif %}

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like this solution :D If you want I can add it to the pull request.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

aye 👍

{% endif %}
{% if meta.use_googleplus %}
{% if meta.gplus_author %}
<link rel="author" href="{{ meta.gplus_author }}"/>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove slash at />

@coveralls
Copy link

coveralls commented May 27, 2016

Coverage Status

Coverage decreased (-0.2%) to 90.559% when pulling fd8d705 on Nekmo:master into 7092ad8 on aldryn:master.

@mkoistinen
Copy link
Contributor

@FinalAngel what's the status of this PR?

@FinalAngel
Copy link
Member

there needs to be code adaptions by @Nekmo will you be able to address them?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants