Homepage: Re-use render_blog_post macro to display posts

No need to have custom code when we have a nice little macro for it
This commit is contained in:
2017-11-23 16:17:38 +01:00
parent f4e277f1d1
commit 8fc9529752
2 changed files with 16 additions and 35 deletions

View File

@@ -404,7 +404,7 @@
list-style: none
border-top: thin solid $color-background
> li
.blog_index-item
+container-box
display: flex
flex-direction: column
@@ -425,7 +425,7 @@
&:before
display: none
a.title
a.item-title
font-size: 1.6em
padding: 5px 15px
display: block
@@ -434,15 +434,6 @@
&:hover
color: $color-primary
a.blog-stream__thumbnail
display: block
position: relative
img
border-top-left-radius: 3px
border-top-right-radius: 3px
width: 100%
ul.meta
+list-meta
font-size: .9em
@@ -453,8 +444,7 @@
border-radius: 0
margin: 0
.description
.item-content
+node-details-description
padding: 10px 15px
@@ -478,6 +468,15 @@
&:before
left: -5px
.blog_index-header
display: block
position: relative
img
border-top-left-radius: 3px
border-top-right-radius: 3px
width: 100%
.more
text-align: center

View File

@@ -1,5 +1,6 @@
| {% extends 'layout.html' %}
| {% from '_macros/_navigation.html' import navigation_tabs %}
| {% from 'nodes/custom/blog/_macros.html' import render_blog_post %}
| {% set title = 'homepage' %}
@@ -24,27 +25,8 @@ meta(name="twitter:image", content="{% if main_project.picture_header %}{{ main_
section.blog-stream
ul.blog-stream__list
| {% if latest_posts %}
| {% for n in latest_posts %}
li
| {% if n.picture %}
a.blog-stream__thumbnail(
href="{{ n.url }}")
img(src="{{ n.picture.thumbnail('l', api=api) }}")
| {% endif %}
ul.meta
li.where-project
a.project(href="{{ url_for('projects.view', project_url=n.project.url) }}") {{ n.project.name }}
li.when
a(href="{{ n.url }}",
title="Updated {{ n._updated | pretty_date }}")
| {{ n._created | pretty_date }}
a.title(href="{{ n.url }}")
| {{ n.name }}
.description
| {{ n.properties.content | markdown }}
| {% for node in latest_posts %}
| {{ render_blog_post(node) }}
| {% endfor %}
| {% else %}
li
@@ -59,7 +41,7 @@ meta(name="twitter:image", content="{% if main_project.picture_header %}{{ main_
a.feed(
href="{{ url_for('main.feeds_blogs') }}",
title="Blender Cloud & Projects Blog Feed",
title="Blogs Feed",
data-toggle="tooltip",
data-placement="left")
i.pi-rss