Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve documentation to enable social meta tags rendering
- Loading branch information
Showing
6 changed files
with
75 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Improve documentation to enable social meta tags rendering |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
.. _meta: | ||
|
||
############################### | ||
Setup social metatags rendering | ||
############################### | ||
|
||
djangocms-blog implements `django-meta <https://github.com/nephila/django-meta>`_ and it come ready to provide a | ||
fairly complete social meta tags set. | ||
|
||
Custom metatags are rendered on the blog post detail page only, while on the list page (which is a basically django CMS page) | ||
you can use `djangocms-page-meta <https://github.com/nephila/djangocms-page-meta/>`_ to render meta tags based on the django CMS | ||
page object. | ||
|
||
In order to enable its rendering you must follow two steps: | ||
|
||
* Enable ``django-meta`` settings in the project ``settings.py`` | ||
|
||
.. code-block:: python | ||
META_SITE_PROTOCOL = 'https' # set 'http' for non ssl enabled websites | ||
META_USE_SITES = True | ||
META_USE_OG_PROPERTIES=True | ||
META_USE_TWITTER_PROPERTIES=True | ||
META_USE_GOOGLEPLUS_PROPERTIES=True # django-meta 1.x+ | ||
META_USE_SCHEMAORG_PROPERTIES=True # django-meta 2.x+ | ||
* Include ``meta/meta.html`` in the ``head`` tag of the template used to render ``djangocms-blog``. | ||
|
||
a. The recommended way is to include in your project base templates: | ||
|
||
.. code-block:: html+django | ||
:name: my_base.html | ||
|
||
<html> | ||
<head> | ||
<title>{% block title %}{% page_attribute 'title' %}{% endblock title %}</title> | ||
{% include "meta/meta.html" %} | ||
... | ||
|
||
b. alternatively djangocms-blog base template provide a ``meta`` block you can place in your templates to only include ``meta.html`` | ||
for the blog posts: | ||
|
||
.. code-block:: html+django | ||
:name: base.html | ||
|
||
<html> | ||
<head> | ||
<title>{% block title %}{% page_attribute 'title' %}{% endblock title %}</title> | ||
{% block meta %}{% endblock meta %} | ||
... | ||
|
||
For complete social meta tags rendering, configure default properties (see ``BLOG_FB``, ``BLOG_TWITTER``, ``BLOG_GPLUS``/``BLOG_SCHEMAORG`` in :ref:`settings`) and apphook ones. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters