diff --git a/templates/blog/card.html b/templates/blog/card.html new file mode 100644 index 0000000000000000000000000000000000000000..1ea0a09b4e43dfc386efd77128cfda733c8adf97 --- /dev/null +++ b/templates/blog/card.html @@ -0,0 +1,20 @@ + <div class="card"> + <div class="card-image"> + <figure class="image is-4by3"> + <a href="{{ post.permalink }}"><img src="{{ get_url(path="@/" ~ post.relative_path, trailing_slash=true) }}{{ post.extra.depiction.image | safe }}" alt="{{ post.extra.depiction.alt }}" /></a> + </figure> + </div> + <div class="card-content"> + <a href="{{ post.permalink }}"><h3 class="title is-3">{{ post.title }}</h3></a> + <p class="subtitle"> + {{ post.date }} · + {% for author in post.authors %} + {{ author }} + {% endfor %} + </p> + <div class="content"> + {{ post.summary | safe }} + </div> + </div> + </div> + diff --git a/templates/frontpage/blocks/blog.html b/templates/frontpage/blocks/blog.html index 37abf0e105d1d72ecbcc6b06da1420148bc19620..7468261c859178de32955c1dcb70bf99f489e093 100644 --- a/templates/frontpage/blocks/blog.html +++ b/templates/frontpage/blocks/blog.html @@ -5,25 +5,7 @@ <div class="columns is-multiline is-same-height"> {% for post in blog_section.pages | slice(end=4) %} <div class="column is-one-quarter"> - <div class="card"> - <div class="card-image"> - <figure class="image is-4by3"> - <a href="{{ post.permalink }}"><img src="{{ get_url(path="@/" ~ post.relative_path, trailing_slash=true) }}{{ post.extra.depiction.image | safe }}" alt="{{ post.extra.depiction.alt }}" /></a> - </figure> - </div> - <div class="card-content"> - <a href="{{ post.permalink }}"><h3 class="title is-3">{{ post.title }}</h3></a> - <p class="subtitle"> - {{ post.date }} · - {% for author in post.authors %} - {{ author }} - {% endfor %} - </p> - <div class="content"> - {{ post.summary | safe }} - </div> - </div> - </div> + {% include "blog/card.html" %} </div> {% endfor %} </div>