Skip to content

Commit 86c09ba

Browse files
committed
Update blog post page
1 parent 3a724ac commit 86c09ba

File tree

4 files changed

+44
-13
lines changed

4 files changed

+44
-13
lines changed

models/blog.ini

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,4 @@ order_by = -pub_date, title
1919

2020
[pagination]
2121
enabled = yes
22-
per_page = 10
22+
per_page = 12

themes/vocabulary_theme/templates/blog.html

+8-5
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,14 @@
33
{% from "macros/pagination.html" import render_pagination %}
44
{% from "macros/posts.html" import render_posts %}
55

6+
67
{% block title %}{{ this.title }}{% endblock %}
78
{% block body %}
8-
{{ this.description }}
9-
{{ render_posts(this.pagination.items) }}
10-
{% if this.pagination.pages > 1 %}
11-
{{ render_pagination(this.pagination) }}
12-
{% endif %}
9+
<div class="container">
10+
{{ this.description }}
11+
{{ render_posts(this.pagination.items) }}
12+
{% if this.pagination.pages > 1 %}
13+
{{ render_pagination(this.pagination) }}
14+
{% endif %}
15+
</div>
1316
{% endblock %}
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,30 @@
11
{% from "macros/author_name.html" import render_author_name %}
22

33
{% macro render_posts(posts) %}
4-
<ul class="blog-index list-unstyled">
4+
<div class="columns is-multiline">
55
{% for post in posts %}
66
{% set author = post.parent.parent.children.get('authors').children.get(post.author) %}
7-
<li>
8-
<a href="{{ post|url }}">{{ post.title }}</a>
9-
<p class="text-muted small">by <a href="{{ author|url }}">{{ render_author_name(author) }}</a>
10-
on {{ post.pub_date|dateformat("YYYY-MM-dd") }}</p>
11-
</li>
7+
<article class="card entry-post horizontal no-border blog-entry column is-one-third">
8+
<header>
9+
<figure class="image blog-image">
10+
{% if author.about %}
11+
{% if author.md5_hashed_email %}
12+
<img class="profile" src="https://secure.gravatar.com/avatar/{{ author.md5_hashed_email }}?size=200"
13+
alt="gravatar" />
14+
{% endif %}
15+
{% endif %}
16+
</figure>
17+
</header>
18+
<div class="blog-content">
19+
<h4 class="b-header"><a class="blog-title" href="{{ post|url }}">{{ post.title }}</a></h4>
20+
<span class="blog-author">by <a class="author-name" href="{{ author|url }}">{{ render_author_name(author) }}</a>
21+
on {{ post.pub_date|dateformat("YYYY-MM-dd") }}</span>
22+
<!-- TODO : Discuss how to extract an excerpt -->
23+
<div class="excerpt">
24+
{{ post.body | excerpt | string | striptags() | truncate(100) }}
25+
</div>
26+
</div>
27+
</article>
1228
{% endfor %}
13-
</ul>
29+
</div>
1430
{% endmacro %}

webpack/sass/main.scss

+12
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,18 @@ $project-card-theme: $blue;
3333
}
3434
}
3535

36+
.blog-entry {
37+
@extend .padding-big;
38+
39+
.blog-title {
40+
@extend .has-color-dark-slate-gray;
41+
}
42+
43+
.author-name {
44+
@extend .has-color-forest-green;
45+
}
46+
}
47+
3648
h2 {
3749
font-weight: 600;
3850
padding-bottom: 0.5rem;

0 commit comments

Comments
 (0)