Unify Twitter cards and Open Graph data

This commit is contained in:
2017-02-06 14:37:53 +01:00
parent 10df0af355
commit 528887b1a6
10 changed files with 65 additions and 99 deletions

View File

@@ -1,40 +1,5 @@
| {% block og %}
| {% set title = 'blog' %}
| {% if project %}
meta(property="og:title", content="{{ node.name }}{% if project._id == config.MAIN_PROJECT_ID %} — Blender Cloud Blog{% else%} - {{ project.name }} — Blender Cloud{% endif %}")
| {% endif %}
| {% if project and project.properties.picture_header %}
meta(property="og:image", content="{{ project.properties.picture_header.thumbnail('l', api=api) }}")
| {% elif node and node.picture %}
meta(property="og:image", content="{{ node.picture.thumbnail('l', api=api) }}")
| {% endif %}
meta(property="og:description", content="{{ node.properties.content }}")
meta(property="og:type", content="article")
meta(property="article:type", content="{{node.user.full_name}}")
meta(property="article:published_time", content="{{node._created | pretty_date }}")
meta(property="og:see_also", content="https://cloud.blender.org/blog")
meta(property="og:url", content="https://cloud.blender.org{{ url_for_node(node=node) }}")
| {% endblock %}
| {% block tw %}
meta(name="twitter:card", content="summary_large_image")
| {% if project._id == config.MAIN_PROJECT_ID %}
meta(property="twitter:title", content="{{ node.name }} — Blender Cloud Blog")
| {% else %}
meta(property="twitter:title", content="{{ node.name }} - {{ project.name }} Blog — Blender Cloud")
| {% endif %}
| {% if project and project.properties.picture_header %}
meta(name="twitter:image", content="{{ project.properties.picture_header.thumbnail('l', api=api) }}")
| {% elif node and node.picture %}
meta(name="twitter:image", content="{{ node.picture.thumbnail('l', api=api) }}")
| {% else %}
meta(name="twitter:image", content="{{ url_for('static', filename='assets/img/backgrounds/background_caminandes_3_02.jpg')}}")
| {% endif %}
meta(name="twitter:description", content="{{ node.properties.content }}")
| {% endblock %}
| {% block body %}
.container

View File

@@ -5,20 +5,13 @@
meta(property="og:type", content="website")
| {% if og_picture %}
meta(property="og:image", content="{{ og_picture.thumbnail('l', api=api) }}")
| {% endif %}
| {% if project %}
meta(property="og:title", content="{{project.name}} - Blender Cloud")
meta(property="og:url", content="{{url_for('projects.view', project_url=project.url, _external=True)}}")
meta(property="og:description", content="{{project.summary}}")
| {% endif %}
| {% endblock %}
| {% block tw %}
| {% if og_picture %}
meta(property="twitter:image", content="{{ og_picture.thumbnail('l', api=api) }}")
| {% endif %}
| {% if project %}
meta(property="og:title", content="{{project.name}} - Blender Cloud")
meta(name="twitter:title", content="{{project.name}} on Blender Cloud")
meta(property="og:url", content="{{url_for('projects.view', project_url=project.url, _external=True)}}")
meta(property="og:description", content="{{project.summary}}")
meta(name="twitter:description", content="{{project.summary}}")
| {% endif %}
| {% endblock %}