Use project picture as fallback if og_picture/node is undefined

This commit is contained in:
2017-02-07 18:03:35 +01:00
parent 7b9fef2fc8
commit 69b3e06b1c

View File

@@ -13,8 +13,8 @@ meta(name="twitter:image", content="{{ og_picture.thumbnail('l', api=api) }}")
meta(property="og:image", content="{{ node.picture.thumbnail('l', api=api) }}") meta(property="og:image", content="{{ node.picture.thumbnail('l', api=api) }}")
meta(name="twitter:image", content="{{ node.picture.thumbnail('l', api=api) }}") meta(name="twitter:image", content="{{ node.picture.thumbnail('l', api=api) }}")
| {% else %} | {% else %}
meta(property="og:image", content="{{ url_for('static', filename='assets/img/backgrounds/background_caminandes_3_02.jpg')}}") meta(property="og:image", content="{{ project.picture_header.thumbnail('l', api=api) }}")
meta(name="twitter:image", content="{{ url_for('static', filename='assets/img/backgrounds/background_caminandes_3_02.jpg')}}") meta(name="twitter:image", content="{{ project.picture_header.thumbnail('l', api=api) }}")
| {% endif %} | {% endif %}
| {% if show_project %} | {% if show_project %}
@@ -29,8 +29,14 @@ meta(property="og:url", content="{{ url_for('projects.view', project_url=project
| {% if node %} | {% if node %}
meta(property="og:title", content="{{ node.name }} - Blender Cloud") meta(property="og:title", content="{{ node.name }} - Blender Cloud")
meta(name="twitter:title", content="{{ node.name }} on Blender Cloud") meta(name="twitter:title", content="{{ node.name }} on Blender Cloud")
meta(property="og:description", content="{{ node.description }}")
meta(name="twitter:description", content="{{ node.description }}") | {% if node.node_type == 'post' %}
meta(property="og:description", content="{{ node.properties.content | truncate(180) }}")
meta(name="twitter:description", content="{{ node.properties.content | truncate(180) }}")
| {% else %}
meta(property="og:description", content="{{ node.description | truncate(180) }}")
meta(name="twitter:description", content="{{ node.description | truncate(180) }}")
| {% endif %}
meta(property="og:url", content="{{url_for('projects.view_node', project_url=project.url, node_id=node._id)}}") meta(property="og:url", content="{{url_for('projects.view_node', project_url=project.url, node_id=node._id)}}")
| {% else %} | {% else %}