Unify Twitter cards and Open Graph data
This commit is contained in:
@@ -4,15 +4,13 @@
|
||||
| {% set title = 'home' %}
|
||||
|
||||
| {% block og %}
|
||||
meta(property="og:title", content="Blender Cloud - Home")
|
||||
meta(property="og:url", content="https://cloud.blender.org{{ request.path }}")
|
||||
meta(property="og:type", content="website")
|
||||
| {% endblock %}
|
||||
meta(property="og:url", content="https://cloud.blender.org{{ request.path }}")
|
||||
|
||||
| {% block tw %}
|
||||
meta(name="twitter:card", content="summary_large_image")
|
||||
meta(name="twitter:site", content="@Blender_Cloud")
|
||||
meta(property="og:title", content="Blender Cloud - Home")
|
||||
meta(name="twitter:title", content="Blender Cloud")
|
||||
|
||||
meta(property="og:image", content="{{ url_for('static', filename='assets/img/backgrounds/cloud_services_oti.jpg')}}")
|
||||
meta(name="twitter:image", content="{{ url_for('static', filename='assets/img/backgrounds/cloud_services_oti.jpg')}}")
|
||||
| {% endblock %}
|
||||
|
||||
|
@@ -1,17 +1,16 @@
|
||||
| {% extends 'layout.html' %}
|
||||
|
||||
| {% block og %}
|
||||
meta(property="og:title", content="{% if title == 'open-projects' %}Open Projects{% elif title == 'training' %}Training{% endif %}")
|
||||
// XXX - Replace with actual url
|
||||
meta(property="og:url", content="https://cloud.blender.org")
|
||||
meta(property="og:type", content="website")
|
||||
| {% endblock %}
|
||||
meta(property="og:url", content="https://cloud.blender.org")
|
||||
|
||||
| {% block tw %}
|
||||
meta(name="twitter:card", content="summary_large_image")
|
||||
meta(name="twitter:site", content="@Blender_Cloud")
|
||||
meta(property="og:title", content="{% if title == 'open-projects' %}Open Projects{% elif title == 'training' %}Training{% endif %}")
|
||||
meta(name="twitter:title", content="{% if title == 'open-projects' %}Open Projects{% elif title == 'training' %}Training{% endif %} on Blender Cloud")
|
||||
|
||||
meta(property="og:description", content="{% if title == 'open-projects' %}Full production data and tutorials from all open movies, for you to use freely{% elif title == 'training' %}Production quality training by 3D professionals{% endif %}")
|
||||
meta(name="twitter:description", content="{% if title == 'open-projects' %}Full production data and tutorials from all open movies, for you to use freely{% elif title == 'training' %}Production quality training by 3D professionals{% endif %}")
|
||||
|
||||
meta(property="og:image", content="{% if title == 'training' %}{{ url_for('static', filename='assets/img/backgrounds/background_caminandes_3_03.jpg')}}{% else %}{{ url_for('static', filename='assets/img/backgrounds/background_agent327_01.jpg')}}{% endif %}")
|
||||
meta(name="twitter:image", content="{% if title == 'training' %}{{ url_for('static', filename='assets/img/backgrounds/background_caminandes_3_03.jpg')}}{% else %}{{ url_for('static', filename='assets/img/backgrounds/background_agent327_01.jpg')}}{% endif %}")
|
||||
| {% endblock %}
|
||||
|
||||
|
@@ -5,14 +5,12 @@
|
||||
|
||||
| {% block og %}
|
||||
meta(property="og:title", content="Dashboard")
|
||||
meta(name="twitter:title", content="Blender Cloud")
|
||||
|
||||
meta(property="og:url", content="https://cloud.blender.org/{{ request.path }}")
|
||||
meta(property="og:type", content="website")
|
||||
| {% endblock %}
|
||||
|
||||
| {% block tw %}
|
||||
meta(name="twitter:card", content="summary_large_image")
|
||||
meta(name="twitter:site", content="@Blender_Cloud")
|
||||
meta(name="twitter:title", content="Blender Cloud")
|
||||
meta(property="og:image", content="{{ url_for('static', filename='assets/img/backgrounds/cloud_services_oti.jpg')}}")
|
||||
meta(name="twitter:image", content="{{ url_for('static', filename='assets/img/backgrounds/cloud_services_oti.jpg')}}")
|
||||
| {% endblock %}
|
||||
|
||||
|
@@ -1,38 +1,47 @@
|
||||
| {% extends 'layout.html' %}
|
||||
| {% from '_macros/_add_new_menu.html' import add_new_menu %}
|
||||
|
||||
| {% block page_title %}{{project.name}}{% endblock%}
|
||||
| {% block page_title %}{{ project.name }}{% endblock%}
|
||||
|
||||
| {% block og %}
|
||||
meta(property="og:type", content="website")
|
||||
|
||||
| {% if og_picture %}
|
||||
meta(property="og:image", content="{{ og_picture.thumbnail('l', api=api) }}")
|
||||
| {% endif %}
|
||||
| {% if show_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}}")
|
||||
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) }}")
|
||||
| {% else %}
|
||||
| {% if node %}
|
||||
meta(property="og:title", content="{{node.name}} - Blender Cloud")
|
||||
meta(property="og:url", content="{{url_for('projects.view_node', project_url=project.url, node_id=node._id)}}")
|
||||
meta(property="og:description", content="{{node.description}}")
|
||||
meta(property="og:image", content="{{ url_for('static', filename='assets/img/backgrounds/background_caminandes_3_02.jpg')}}")
|
||||
meta(name="twitter:image", content="{{ url_for('static', filename='assets/img/backgrounds/background_caminandes_3_02.jpg')}}")
|
||||
| {% endif %}
|
||||
| {% endif %}
|
||||
| {% endblock %}
|
||||
|
||||
| {% block tw %}
|
||||
| {% if og_picture %}
|
||||
meta(property="twitter:image", content="{{ og_picture.thumbnail('l', api=api) }}")
|
||||
| {% endif %}
|
||||
| {% if show_project %}
|
||||
meta(name="twitter:title", content="{{project.name}} on Blender Cloud")
|
||||
meta(name="twitter:description", content="{{project.summary}}")
|
||||
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(name="twitter:title", content="{{node.name}} on Blender Cloud")
|
||||
meta(name="twitter:description", content="{{node.description}}")
|
||||
meta(property="og:title", content="{{ node.name }} - 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 }}")
|
||||
|
||||
meta(property="og:url", content="{{url_for('projects.view_node', project_url=project.url, node_id=node._id)}}")
|
||||
| {% 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 %}
|
||||
|
||||
|
@@ -4,24 +4,19 @@
|
||||
|
||||
| {% block og %}
|
||||
meta(property="og:title", content="{{ node.name }}")
|
||||
meta(name="twitter:title", content="{{node.name}}")
|
||||
meta(property="og:url", content="{{ url_for('projects.view_node', project_url=project.url, node_id=node._id, t=1, _external=True) }}")
|
||||
meta(property="og:type", content="website")
|
||||
meta(property="og:description", content="Created on {{ node._created.strftime('%d %b %Y') }}")
|
||||
meta(name="twitter:description", content="Created on {{ node._created.strftime('%d %b %Y') }}")
|
||||
| {% if og_picture %}
|
||||
meta(property="og:image", content="{{ og_picture.thumbnail('l', api=api) }}")
|
||||
meta(property="og:image:secure_url", content="{{ og_picture.thumbnail('l', api=api) }}")
|
||||
meta(property="og:image:type", content="{{ og_picture.content_type }}")
|
||||
meta(property="og:image:witdh", content="{{ og_picture.width }}")
|
||||
meta(property="og:image:height", content="{{ og_picture.height }}")
|
||||
| {% endif %}
|
||||
| {% endblock %}
|
||||
|
||||
| {% block tw %}
|
||||
| {% if og_picture %}
|
||||
meta(property="twitter:image", content="{{ og_picture.thumbnail('l', api=api) }}")
|
||||
| {% endif %}
|
||||
meta(name="twitter:title", content="{{node.name}}")
|
||||
meta(name="twitter:description", content="Created on {{ node._created.strftime('%d %b %Y') }}")
|
||||
| {% endblock %}
|
||||
|
||||
| {% block header_backdrop %}{% endblock %}
|
||||
|
Reference in New Issue
Block a user