147 lines
4.7 KiB
Plaintext
147 lines
4.7 KiB
Plaintext
| {% 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
|
|
#blog_container(class="{% if project._id == config.MAIN_PROJECT_ID %}cloud-blog{% endif %}")
|
|
|
|
#blog_post-container
|
|
| {% if project._id == config.MAIN_PROJECT_ID %}
|
|
a.btn.btn-default.button-back(href="{{ url_for('projects.view', project_url=project.url) }}blog")
|
|
| Back to Blog
|
|
|
|
| {% if node.has_method('PUT') %}
|
|
a.btn.btn-default.button-edit(href="{{url_for('nodes.posts_edit', post_id=node._id)}}")
|
|
i.pi-edit
|
|
| Edit Post
|
|
| {% endif %}
|
|
|
|
.clearfix
|
|
| {% endif %}
|
|
|
|
| {% if node.picture %}
|
|
.blog_index-header
|
|
img(src="{{ node.picture.thumbnail('l', api=api) }}")
|
|
| {% endif %}
|
|
.blog_index-item
|
|
|
|
.item-title
|
|
| {{node.name}}
|
|
|
|
.item-info.
|
|
<span title="{{node._created}}">{{node._created | pretty_date }}</span>
|
|
{% if node._created != node._updated %}
|
|
<span title="{{node._updated}}">(updated {{node._updated | pretty_date }})</span>
|
|
{% endif %}
|
|
{% if node.properties.category %}| {{node.properties.category}}{% endif %}
|
|
| by {{node.user.full_name}}
|
|
|
|
.item-content
|
|
| {{ node.properties.content }}
|
|
|
|
|
|
#comments-embed
|
|
#comments-list-items-loading
|
|
i.pi-spin
|
|
|
|
| {% if project._id != config.MAIN_PROJECT_ID %}
|
|
#blog_index-sidebar
|
|
.blog_project-card
|
|
a.item-header(
|
|
href="{{ url_for('projects.view', project_url=project.url) }}")
|
|
|
|
.overlay
|
|
| {% if project.picture_header %}
|
|
img.background(src="{{ project.picture_header.thumbnail('m', api=api) }}")
|
|
| {% endif %}
|
|
|
|
a.card-thumbnail(
|
|
href="{{ url_for('projects.view', project_url=project.url) }}")
|
|
| {% if project.picture_square %}
|
|
img.thumb(src="{{ project.picture_square.thumbnail('m', api=api) }}")
|
|
| {% endif %}
|
|
|
|
.item-info
|
|
|
|
a.item-title(
|
|
href="{{ url_for('projects.view', project_url=project.url) }}")
|
|
| {{ project.name }}
|
|
|
|
| {% if project.summary %}
|
|
p.item-description
|
|
| {{project.summary|safe}}
|
|
| {% endif %}
|
|
.blog_project-sidebar
|
|
| {% if node.has_method('PUT') %}
|
|
a.btn.btn-default.button-create(href="{{url_for('nodes.posts_edit', post_id=node._id)}}")
|
|
| Edit Post
|
|
| {% endif %}
|
|
|
|
a.btn.btn-default.button-back(href="{{ url_for('projects.view', project_url=project.url) }}blog")
|
|
| Back to Blog
|
|
| {% endif %}
|
|
|
|
|
|
| {% endblock %}
|
|
|
|
|
|
| {% block footer_scripts %}
|
|
|
|
include ../_scripts
|
|
script.
|
|
hopToTop(); // Display jump to top button
|
|
|
|
/* Expand images when their link points to a jpg/png/gif */
|
|
/* TODO: De-duplicate code from view post */
|
|
var page_overlay = document.getElementById('page-overlay');
|
|
$('.blog_index-item .item-content a img').on('click', function(e){
|
|
e.preventDefault();
|
|
|
|
var href = $(this).parent().attr('href');
|
|
var src = $(this).attr('src');
|
|
|
|
if (href.match("jpg$") || href.match("png$") || href.match("gif$")) {
|
|
$(page_overlay)
|
|
.addClass('active')
|
|
.html('<img src="' + src + '"/>');
|
|
} else {
|
|
window.location.href = href;
|
|
}
|
|
});
|
|
| {% endblock %}
|