-
Notifications
You must be signed in to change notification settings - Fork 19
Expand file tree
/
Copy pathblog.html
More file actions
42 lines (38 loc) · 1.18 KB
/
blog.html
File metadata and controls
42 lines (38 loc) · 1.18 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
{% macro render_blog_post(post, from_index=false) %}
<div class="blog-post">
{{ post.body }}
</div>
{% endmacro %}
{% macro render_blog_post_summary(post, from_index=false) -%}
<div class="blog-post">
{% if from_index %}
<h4><a href="{{ post|url }}">{{ post.title }}</a></h4>
{% else %}
<h4>{{ post.title }}</h4>
{% endif %}
{% if post.attachments.images.get('cover.png') %}
{% set i = post.attachments.images.get('cover.png') %}
{% elif post.attachments.images.get('cover.jpg') %}
{% set i = post.attachments.images.get('cover.jpg') %}
{% elif post.attachments.images.get('cover.gif') %}
{% set i = post.attachments.images.get('cover.gif') %}
{% elif post.cover_image %}
{% set i = post.cover_image %}
{% endif %}
{% if i %}
<div class="image-wrapper">
<a href="{{ post|url }}">
{% if not i == post.cover_image %}
<img src="{{ i|url }}">
{% else %}
<img src="{{ i }}">
{% endif %}
</a>
</div>
{% endif %}
{{ post.summary }}
<p style="text-align:right">
<a href="{{ post|url }}">ler mais</a>
</p>
</div>
{% endmacro %}