Blog listing: Show posts as cards

This commit is contained in:
2018-09-15 21:23:45 +02:00
parent 1196f178e8
commit 2eb969f7ee

View File

@@ -55,29 +55,26 @@ include ../../../../../../pillar/src/templates/mixins/components
//- ******************************************************* -// //- ******************************************************* -//
| {% macro render_blog_list_item(node) %} | {% macro render_blog_list_item(node) %}
.row.position-relative.py-2 a.card.asset.card-image-fade.pr-0.mx-0.mb-4(
.col-md-1 href="{{ node.url }}")
.embed-responsive.embed-responsive-16by9
| {% if node.picture %} | {% if node.picture %}
a.imgs-fluid(href="{{ node.url }}") .card-img-top.embed-responsive-item(style="background-image: url({{ node.picture.thumbnail('m', api=api) }})")
img(src="{{ node.picture.thumbnail('s', api=api) }}")
| {% else %} | {% else %}
.bg-primary.rounded.h-100 .card-img-top.card-icon.embed-responsive-item
a.d-flex.align-items-center.justify-content-center.h-100.text-white(href="{{ node.url }}") i.pi-document-text
i.pi-document-text
| {% endif %} | {% endif %}
.col-md-11 .card-body.py-2.d-flex.flex-column
h5 .card-title.mb-1.font-weight-bold
a.text-muted(href="{{ node.url }}") {{node.name}} | {{ node.name }}
.text-muted. ul.card-text.list-unstyled.d-flex.text-black-50.mt-auto
#[span(title="{{node._created}}") {{node._created | pretty_date }}] li.pr-2 {{ node.user.full_name }}
{% if node._created != node._updated %} li {{ node._created | pretty_date }}
#[span(title="{{node._updated}}") (updated {{node._updated | pretty_date }})] | {% if node.properties.status != 'published' %}
{% endif %} li.text-info.font-weight-bold {{ node.properties.status}}
{% if node.properties.category %} · {{node.properties.category}}{% endif %} | {% endif %}
· {{node.user.full_name}}
{% if node.properties.status != 'published' %} · {{ node.properties.status}} {% endif %}
| {% endmacro %} | {% endmacro %}
@@ -96,21 +93,18 @@ include ../../../../../../pillar/src/templates/mixins/components
| {{ render_blog_post(posts[0], project=project, pages=pages) }} | {{ render_blog_post(posts[0], project=project, pages=pages) }}
.container .container
.row h5.text-muted.text-center.py-3 Blasts from the past
.col-md-9.mx-auto +card-deck(class="px-2 justify-content-center")
| {% for node in posts[1:] %} | {% for node in posts[1:] %}
| {% if loop.first %} | {{ render_blog_list_item(node) }}
h5.text-muted.text-center Blasts from the past | {% endfor %}
| {% endif %}
| {{ render_blog_list_item(node) }}
| {% endfor %}
| {% if more_posts_available %} | {% if more_posts_available %}
.blog-archive-navigation .blog-archive-navigation
a(href="{{ project.blog_archive_url }}") a(href="{{ project.blog_archive_url }}")
| {{posts_meta.total - posts|length}} more blog posts over here | {{posts_meta.total - posts|length}} more blog posts over here
i.pi-angle-right i.pi-angle-right
| {% endif %} | {% endif %}
| {% else %} | {% else %}
@@ -156,9 +150,10 @@ include ../../../../../../pillar/src/templates/mixins/components
| {{ render_archive_pagination(project) }} | {{ render_archive_pagination(project) }}
| {% for node in posts %} +card-deck(class="px-2")
| {{ render_blog_list_item(node) }} | {% for node in posts %}
| {% endfor %} | {{ render_blog_list_item(node) }}
| {% endfor %}
| {{ render_archive_pagination(project) }} | {{ render_archive_pagination(project) }}