|
1 |
| -{% from "macros/author_name.html" import render_author_name %} |
| 1 | +{% from "macros/authors_byline.html" import render_authors_byline %} |
| 2 | +{% from "macros/authors_gravatar.html" import render_author_gravatar %} |
| 3 | + |
| 4 | +{% macro render_post_summary(post, skip_gravatar=false) %} |
| 5 | + <div class="column is-one-third is-paddingless padding-horizontal-big padding-top-bigger"> |
| 6 | + <article class="card entry-post horizontal no-border blog-entry"> |
| 7 | + {{ render_author_gravatar(post, skip_gravatar) }} |
| 8 | + <div class="blog-content"> |
| 9 | + <h4 class="b-header"><a class="blog-title" href="{{ post|url }}">{{ post.title }}</a></h4> |
| 10 | + {{ render_authors_byline(post) }} |
| 11 | + <div class="excerpt"> |
| 12 | + {{ post.body | excerpt | string | striptags() | truncate(100) }} |
| 13 | + </div> |
| 14 | + </div> |
| 15 | + </article> |
| 16 | + </div> |
| 17 | +{% endmacro %} |
2 | 18 |
|
3 | 19 | {% macro render_posts(posts) %}
|
4 | 20 | <div class="columns is-multiline blog-entries">
|
5 | 21 | {% for post in posts %}
|
6 |
| - {% set author = post.parent.parent.children.get('authors').children.get(post.author) %} |
7 |
| - <div class="column is-one-third"> |
8 |
| - <article class="card entry-post horizontal no-border blog-entry"> |
9 |
| - {% if author.about %} |
10 |
| - <header> |
11 |
| - <figure class="image blog-image"> |
12 |
| - <img class="profile" src="https://secure.gravatar.com/avatar/{{ author.md5_hashed_email }}?size=200&d=mp" alt="gravatar" /> |
13 |
| - </figure> |
14 |
| - </header> |
15 |
| - {% endif %} |
16 |
| - <div class="blog-content"> |
17 |
| - <h4 class="b-header"><a class="blog-title" href="{{ post|url }}">{{ post.title }}</a></h4> |
18 |
| - <span class="blog-author">by <a href="{{ author|url }}">{{ render_author_name(author) }}</a> |
19 |
| - on {{ post.pub_date|dateformat("YYYY-MM-dd") }}</span> |
20 |
| - <div class="excerpt"> |
21 |
| - {{ post.body | excerpt | string | striptags() | truncate(100) }} |
22 |
| - </div> |
23 |
| - </div> |
24 |
| - </article> |
25 |
| - </div> |
| 22 | + {% set post_loop = loop %} |
| 23 | + {{ render_post_summary(post) }} |
26 | 24 | {% endfor %}
|
27 | 25 | </div>
|
28 | 26 | {% endmacro %}
|
0 commit comments