Support for OpenGraph and Twitter cards in blogposts

This commit is contained in:
2017-07-13 12:34:54 +02:00
parent c9af6fe44f
commit 3d1757476a
2 changed files with 33 additions and 0 deletions

View File

@@ -1,6 +1,22 @@
| {% extends 'projects/view.html' %} | {% extends 'projects/view.html' %}
| {% set title = 'blog' %} | {% set title = 'blog' %}
| {% block og %}
meta(property="og:title", content="{{ node.name }}")
meta(property="og:url", content="{{ url_for('main.project_blog', project_url=project.url, url=node.properties.url, _external=True)}}")
meta(property="og:type", content="website")
| {% if node.picture %}
meta(property="og:image", content="{{ node.picture.thumbnail('l', api=api) }}")
| {% endif %}
meta(property="og:description", content="Blender Cloud is a web based service developed by Blender Institute that allows people to access the training videos and all the data from the open projects.")
meta(name="twitter:title", content="{{ node.name }}")
meta(name="twitter:description", content="Blender Cloud is a web based service developed by Blender Institute that allows people to access the training videos and all the data from the open projects.")
| {% if node.picture %}
meta(property="og:image", content="{{ node.picture.thumbnail('l', api=api) }}")
| {% endif %}
| {% endblock %}
| {% block page_title %}{{node.name}} - Blog{% endblock%} | {% block page_title %}{{node.name}} - Blog{% endblock%}
| {% block css %} | {% block css %}

View File

@@ -1,4 +1,21 @@
| {% extends 'layout.html' %} | {% extends 'layout.html' %}
| {% block og %}
meta(property="og:title", content="{{ node.name }}")
meta(property="og:url", content="{{ url_for('main.main_blog', url=node.properties.url, _external=True)}}")
meta(property="og:type", content="website")
| {% if node.picture %}
meta(property="og:image", content="{{ node.picture.thumbnail('l', api=api) }}")
| {% endif %}
meta(property="og:description", content="Blender Cloud is a web based service developed by Blender Institute that allows people to access the training videos and all the data from the open projects.")
meta(name="twitter:title", content="{{ node.name }}")
meta(name="twitter:description", content="Blender Cloud is a web based service developed by Blender Institute that allows people to access the training videos and all the data from the open projects.")
| {% if node.picture %}
meta(property="og:image", content="{{ node.picture.thumbnail('l', api=api) }}")
| {% endif %}
| {% endblock %}
| {% block page_title %}{{node.name}} - Blog{% endblock%} | {% block page_title %}{{node.name}} - Blog{% endblock%}
| {% set title = 'blog' %} | {% set title = 'blog' %}