Blog: Unify the looks of blog posts

Now that the render_blog_post macro is shared with the homepage
This commit is contained in:
Pablo Vazquez 2017-11-23 16:20:29 +01:00
parent cb7a23bc69
commit eeba87d333
4 changed files with 28 additions and 27 deletions

View File

@ -59,6 +59,7 @@ def posts_view(project_id=None, project_url=None, url=None, *, archive=False, pa
for post in posts._items:
post.picture = get_file(post.picture, api=api)
post.url = url_for_node(node=post)
# Use the *_main_project.html template for the main blog
is_main_project = project_id == current_app.config['MAIN_PROJECT_ID']

View File

@ -239,22 +239,18 @@
font:
family: $font-body
size: 1.8em
padding-bottom: 10px
padding-top: 20px
.item-info
color: $color-text-dark-secondary
font-size: 1em
padding: 10px 25px 10px
a
color: $color-text-dark-secondary
&:hover
color: $color-primary
ul.meta
+list-meta
font-size: .9em
padding: 15px 25px 5px
.item-content
+node-details-description
padding: 35px 25px
font-size: 1.3em
padding: 15px 25px 25px
+media-xs
padding:

View File

@ -1,24 +1,28 @@
//- ******************************************************* -//
| {% macro render_blog_post(node) %}
| {% if node.picture %}
a.blog_index-header(href="{{ url_for_node(node=node) }}")
a.blog_index-header(href="{{ node.url }}")
img(src="{{ node.picture.thumbnail('l', api=api) }}")
| {% endif %}
.blog_index-item
a.item-title(
href="{{ url_for_node(node=node) }}")
| {{node.name}}
ul.meta
| {% if node.project.name %}
li {{ node.project.name }}
| {% endif %}
.item-info.
#[span(title="{{node._created}}") {{node._created | pretty_date }}]
{% if node._created != node._updated %}
#[span(title="{{node._updated}}") (updated {{node._updated | pretty_date }})]
{% endif %}
{% if node.properties.category %}| {{node.properties.category}}{% endif %}
· {{node.user.full_name}}
· #[a(href="{{ url_for_node(node=node) }}#comments") comment]
{% if node.properties.status != 'published' %} | {{ node.properties.status}} {% endif %}
li.when
a(href="{{ node.url }}",
title="Updated {{ node._updated | pretty_date }}")
| {{ node._created | pretty_date }}
li
a(href="{{ node.url }}#comments")
| comment
a.item-title(
href="{{ node.url }}")
| {{ node.name }}
.item-content
| {{ node.properties.content }}
@ -30,15 +34,15 @@ a.blog_index-header(href="{{ url_for_node(node=node) }}")
.blog_index-item.list
| {% if node.picture %}
a.item-header(href="{{ url_for_node(node=node) }}")
a.item-header(href="{{ node.url }}")
img.image(src="{{ node.picture.thumbnail('s', api=api) }}")
| {% else %}
a.item-header.nothumb(href="{{ url_for_node(node=node) }}")
a.item-header.nothumb(href="{{ node.url }}")
i.pi-document-text
| {% endif %}
a.item-title(
href="{{ url_for_node(node=node) }}")
href="{{ node.url }}")
| {{node.name}}
.item-info.

View File

@ -29,7 +29,7 @@ link(href="{{ url_for('static_pillar', filename='assets/css/blog.css', v=1732017
| {% for post in posts %}
li.jstree-node
a.jstree-anchor.tree-item.post(
href="{{ url_for_node(node=post) }}")
href="{{ node.url }}")
.tree-item-thumbnail
| {% if post.picture %}
img(src="{{ post.picture.thumbnail('s', api=api) }}")