Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 6 additions & 14 deletions themes/vocabulary_theme/templates/blocks/recent-posts.html
Original file line number Diff line number Diff line change
@@ -1,22 +1,14 @@
{% from "macros/posts.html" import render_post_summary %}

<section class="recent-posts">
<div class="container">
<div class="level">
<h2 class="is-paddingless level-left">
{{ this.title }}
</h2>
<span class="level-right">
<a class="posts-link" href="/blog/entries">See all posts <i class="icon angle-right"></i></a>
</span>
</div>
<div class="columns">
<article class="posts">
<h2> {{ this.title }} </h2>
<ul>
{% for post in site.query('/blog/entries') %}
{% set post_loop = loop %}
{% if post_loop.index <= 3 %}
{{ render_post_summary(post) }}
{% endif %}
{% endfor %}
</div>
</div>
</section>
</ul>

<a class="more" href="/blog/entries">See all posts</a>
2 changes: 1 addition & 1 deletion themes/vocabulary_theme/templates/layout.html
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
<script type="text/javascript" src="{{ '/static/gen/script.js'|url }}"></script>
<title>{% block title %}Welcome{% endblock %} — Creative Commons Open Source</title>

<body>
<body class="blog-index">

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

Expand Down
34 changes: 25 additions & 9 deletions themes/vocabulary_theme/templates/macros/posts.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,38 @@
{% from "macros/authors_gravatar.html" import render_author_gravatar %}

{% macro render_post_summary(post, skip_gravatar=false) %}
<div class="column is-one-third is-paddingless padding-horizontal-big padding-top-bigger">
<article class="card entry-post horizontal no-border blog-entry">
{{ render_author_gravatar(post, skip_gravatar) }}
<div class="blog-content">
<h4 class="b-header"><a class="blog-title" href="{{ post|url }}">{{ post.title }}</a></h4>
{{ render_authors_byline(post) }}
<li>
<article class="post">
<header>
<h3 class="title"><a href="{{ post|url }}">{{ post.title }}</a></h3>
<span class="byline"> {{ render_authors_byline(post) }} </span>
<span class="categories">
{% if post.categories %}
{% for category in post.categories %}
<a href="/blog/categories/{{ category|replace(' ', '-') }}">{{ category|capitalize }}</a>
{% if not loop.last %}, {% endif %}
{% endfor %}
{% else %}
<span>No categories</span>
{% endif %}
</span>
<!-- TODO: add excerpt back in -->
<!--
<div class="excerpt">
{% if post.excerpt %}
{{ post.excerpt }}
{% else %}
{{ post.body | excerpt | string | striptags() | truncate(100) }}
{% endif %}
</div>
</div>
</article>
</div>
-->
</header>

<figure>
{{ render_author_gravatar(post, skip_gravatar) }}
</figure>
</article>
</li>
{% endmacro %}

{% macro render_posts(posts) %}
Expand Down
Loading