-
Notifications
You must be signed in to change notification settings - Fork 119
Optional Meta Page Support #398
base: master
Are you sure you want to change the base?
Conversation
{% block html_tag %} itemscope itemtype="http://schema.org/Blog" {% endblock %} | ||
|
||
{% block meta_tags %} | ||
<meta name="viewport" content="width=device-width,initial-scale=1"> |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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 %}
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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 }}"/> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove slash at />
@FinalAngel what's the status of this PR? |
there needs to be code adaptions by @Nekmo will you be able to address them? |
Adds optional support for Django-Page-Meta. If Django-Page-Meta is not in INSTALLED_APPS, will not be used.
Include in your html:
And install and configure Django-Page-Meta.
Thanks to Djangocms-Blog for the list of metadata.