Skip to content

Commit a152f41

Browse files
authored
Merge pull request #851 from Queen-codes/recent-posts
refactored recent post to align with vocabulary markup
2 parents cacf915 + 19876d6 commit a152f41

File tree

3 files changed

+32
-24
lines changed

3 files changed

+32
-24
lines changed
Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,14 @@
11
{% from "macros/posts.html" import render_post_summary %}
22

3-
<section class="recent-posts">
4-
<div class="container">
5-
<div class="level">
6-
<h2 class="is-paddingless level-left">
7-
{{ this.title }}
8-
</h2>
9-
<span class="level-right">
10-
<a class="posts-link" href="/blog/entries">See all posts <i class="icon angle-right"></i></a>
11-
</span>
12-
</div>
13-
<div class="columns">
3+
<article class="posts">
4+
<h2> {{ this.title }} </h2>
5+
<ul>
146
{% for post in site.query('/blog/entries') %}
157
{% set post_loop = loop %}
168
{% if post_loop.index <= 3 %}
179
{{ render_post_summary(post) }}
1810
{% endif %}
1911
{% endfor %}
20-
</div>
21-
</div>
22-
</section>
12+
</ul>
13+
14+
<a class="more" href="/blog/entries">See all posts</a>

themes/vocabulary_theme/templates/layout.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
<script type="text/javascript" src="{{ '/static/gen/script.js'|url }}"></script>
3939
<title>{% block title %}Welcome{% endblock %} — Creative Commons Open Source</title>
4040

41-
<body>
41+
<body class="blog-index">
4242

4343
<a class="skip-to-content" href="#main-content-marker">Skip to content</a>
4444

themes/vocabulary_theme/templates/macros/posts.html

Lines changed: 25 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,22 +2,38 @@
22
{% from "macros/authors_gravatar.html" import render_author_gravatar %}
33

44
{% 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) }}
5+
<li>
6+
<article class="post">
7+
<header>
8+
<h3 class="title"><a href="{{ post|url }}">{{ post.title }}</a></h3>
9+
<span class="byline"> {{ render_authors_byline(post) }} </span>
10+
<span class="categories">
11+
{% if post.categories %}
12+
{% for category in post.categories %}
13+
<a href="/blog/categories/{{ category|replace(' ', '-') }}">{{ category|capitalize }}</a>
14+
{% if not loop.last %}, {% endif %}
15+
{% endfor %}
16+
{% else %}
17+
<span>No categories</span>
18+
{% endif %}
19+
</span>
20+
<!-- TODO: add excerpt back in -->
21+
<!--
1122
<div class="excerpt">
1223
{% if post.excerpt %}
1324
{{ post.excerpt }}
1425
{% else %}
1526
{{ post.body | excerpt | string | striptags() | truncate(100) }}
1627
{% endif %}
1728
</div>
18-
</div>
19-
</article>
20-
</div>
29+
-->
30+
</header>
31+
32+
<figure>
33+
{{ render_author_gravatar(post, skip_gravatar) }}
34+
</figure>
35+
</article>
36+
</li>
2137
{% endmacro %}
2238

2339
{% macro render_posts(posts) %}

0 commit comments

Comments
 (0)