Use _opengraph macro in landing.pug
This commit is contained in:
@@ -1,5 +1,6 @@
|
|||||||
| {% extends 'layout.html' %}
|
| {% extends 'layout.html' %}
|
||||||
| {% from '_macros/_navigation.html' import navigation_project %}
|
| {% from '_macros/_navigation.html' import navigation_project %}
|
||||||
|
| {% from '_macros/_opengraph.html' import opengraph %}
|
||||||
|
|
||||||
include ../../../../pillar/src/templates/mixins/components
|
include ../../../../pillar/src/templates/mixins/components
|
||||||
|
|
||||||
@@ -9,69 +10,16 @@ include ../../../../pillar/src/templates/mixins/components
|
|||||||
|
|
||||||
| {% block page_title %}{{ project.name }}{% endblock%}
|
| {% block page_title %}{{ project.name }}{% endblock%}
|
||||||
|
|
||||||
|
| {% if og_picture %}
|
||||||
|
| {% set og_picture_url = og_picture.thumbnail('l', api=api) %}
|
||||||
|
| {% else %}
|
||||||
|
| {% set og_picture_url = None %}
|
||||||
|
| {% endif %}
|
||||||
|
|
||||||
| {% block og %}
|
| {% block og %}
|
||||||
meta(property="og:type", content="website")
|
| {{ opengraph(project.name, project.summary, og_picture_url, url_for('cloud.project_landing', project_url=project.url, _external=True)) }}
|
||||||
|
| {% endblock %}
|
||||||
|
|
||||||
| {% if project.extension_props.cloud.picture_16_9 %}
|
|
||||||
meta(property="og:image", content="{{ project.extension_props.cloud.picture_16_9.thumbnail('h', api=api) }}")
|
|
||||||
meta(name="twitter:image", content="{{ project.extension_props.cloud.picture_16_9.thumbnail('h', api=api) }}")
|
|
||||||
| {% elif og_picture %}
|
|
||||||
meta(property="og:image", content="{{ og_picture.thumbnail('l', api=api) }}")
|
|
||||||
meta(name="twitter:image", content="{{ og_picture.thumbnail('l', api=api) }}")
|
|
||||||
| {% elif node and node.picture %}
|
|
||||||
meta(property="og:image", content="{{ node.picture.thumbnail('l', api=api) }}")
|
|
||||||
meta(name="twitter:image", content="{{ node.picture.thumbnail('l', api=api) }}")
|
|
||||||
| {% elif project.picture_header %}
|
|
||||||
meta(property="og:image", content="{{ project.picture_header.thumbnail('l', api=api) }}")
|
|
||||||
meta(name="twitter:image", content="{{ project.picture_header.thumbnail('l', api=api) }}")
|
|
||||||
| {% endif %}
|
|
||||||
|
|
||||||
| {% if show_project %}
|
|
||||||
meta(property="og:title", content="{{ project.name }} - Blender Cloud")
|
|
||||||
meta(name="twitter:title", content="{{ project.name }} - Blender Cloud")
|
|
||||||
meta(property="og:description", content="{{ project.summary }}")
|
|
||||||
meta(name="twitter:description", content="{{ project.summary }}")
|
|
||||||
meta(property="og:url", content="{{ url_for('projects.view', project_url=project.url, _external=True) }}")
|
|
||||||
| {% else %}
|
|
||||||
|
|
||||||
| {% if node %}
|
|
||||||
meta(property="og:title", content="{{ node.name }} - Blender Cloud")
|
|
||||||
meta(name="twitter:title", content="{{ node.name }} on Blender Cloud")
|
|
||||||
|
|
||||||
| {% if node.node_type == 'post' %}
|
|
||||||
|
|
||||||
| {% if node.properties.content %}
|
|
||||||
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="Blender Cloud, your source for open content and training")
|
|
||||||
meta(name="twitter:description", content="Blender Cloud, your source for open content and training")
|
|
||||||
| {% endif %}
|
|
||||||
|
|
||||||
| {% else %}
|
|
||||||
|
|
||||||
| {% if node.description %}
|
|
||||||
meta(property="og:description", content="{{ node.description | truncate(180) }}")
|
|
||||||
meta(name="twitter:description", content="{{ node.description | truncate(180) }}")
|
|
||||||
| {% else %}
|
|
||||||
meta(property="og:description", content="Blender Cloud, your source for open content and training")
|
|
||||||
meta(name="twitter:description", content="Blender Cloud, your source for open content and training")
|
|
||||||
| {% endif %}
|
|
||||||
|
|
||||||
| {% endif %}
|
|
||||||
|
|
||||||
meta(property="og:url", content="{{url_for('projects.view_node', project_url=project.url, node_id=node._id, _external=True)}}")
|
|
||||||
| {% else %}
|
|
||||||
meta(property="og:title", content="{{ project.name }} Blog on Blender Cloud")
|
|
||||||
meta(name="twitter:title", content="{{ project.name }} Blog on Blender Cloud")
|
|
||||||
meta(property="og:description", content="{{ project.summary }}")
|
|
||||||
meta(name="twitter:description", content="{{ project.summary }}")
|
|
||||||
|
|
||||||
meta(property="og:url", content="{{url_for('projects.view', project_url=project.url, _external=True)}}")
|
|
||||||
| {% endif %}
|
|
||||||
|
|
||||||
| {% endif %}
|
|
||||||
| {% endblock og %}
|
|
||||||
|
|
||||||
| {% block page_overlay %}
|
| {% block page_overlay %}
|
||||||
#page-overlay.video
|
#page-overlay.video
|
||||||
|
Reference in New Issue
Block a user