Deduplicated blog templates by using macros.

This commit is contained in:
2017-09-29 16:19:31 +02:00
parent bd93625119
commit 2603c4f44f
6 changed files with 90 additions and 177 deletions

View File

@@ -1,3 +1,4 @@
| {% import 'nodes/custom/blog/_macros.html' as blogmacros %}
#blog_container(class="{% if project and project._id == config.MAIN_PROJECT_ID %}cloud-blog{% endif %}")
@@ -15,26 +16,7 @@
.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 }}
| {{ blogmacros.render_blog_post(node) }}
#comments-embed
.comments-list-loading

View File

@@ -21,10 +21,8 @@ meta(property="og:image", content="{{ node.picture.thumbnail('l', api=api) }}")
| {% set title = 'blog' %}
| {% block body %}
.container
| {% include 'nodes/custom/post/view_embed.html' %}
| {% endblock %}