findcommonground.uk/_layouts/post_by_category.html

79 lines
3.1 KiB
HTML
Raw Permalink Normal View History

2016-01-04 20:49:37 +00:00
---
layout: default
---
2016-01-30 22:22:55 +00:00
<!-- Post Header -->
<header class="intro-header" style="background-image: url('{{ site.baseurl }}/{% if page.header-img %}{{ page.header-img }}{% else %}{{ site.header-img }}{% endif %}')">
2016-01-04 20:49:37 +00:00
2016-01-30 22:22:55 +00:00
<div class="container">
<div class="row">
<div class="col-lg-8 col-lg-offset-2 col-md-10 col-md-offset-1">
<div class="post-heading">
<h1>{{ page.title }}</h1>
2016-01-30 22:43:11 +00:00
<h2 class="subheading">All articles posted in '{{ page.title }}'</h2>
2016-01-30 22:22:55 +00:00
</div>
</div>
</div>
</div>
</header>
2016-01-04 20:49:37 +00:00
2016-01-30 22:22:55 +00:00
<article class="page">
<div class="container">
<div class="row">
<div class="col-lg-8 col-lg-offset-2 col-md-10 col-md-offset-1">
{% if site.categories[page.category] %}
{% for post in site.categories[page.category] %}
<!-- Uncomment for listing by year
2016-01-30 22:22:55 +00:00
{% capture post_year %}{{ post.date | date: '%Y' }}{% endcapture %}
{% if forloop.first %}
<h3>{{ post_year }}</h3>
2016-01-30 22:22:55 +00:00
{% endif %}
{% if forloop.first == false %}
{% assign previous_index = forloop.index0 | minus: 1 %}
{% capture previous_post_year %}{{ site.categories[page.category][previous_index].date | date: '%Y' }}{% endcapture %}
{% if post_year != previous_post_year %}
</div><h3>{{ post_year }}</h3>
2016-01-30 22:22:55 +00:00
{% endif %}
{% endif %}
-->
{% if post.author %}
{% assign author = site.data.authors[post.author] %}
{% if author %}
{% assign author_name = author.name %}
{% else %}
{% assign author_name = post.author %}
{% endif %}
{% else %}
{% assign author_name = site.title %}
{% endif %}
<div class="post-preview">
<a href="{{ post.url | prepend: site.baseurl }}">
<h2 class="post-title"> {{ post.title }}
</h2>
{% if post.subtitle %}
<h3 class="post-subtitle">
{{ post.subtitle }}
</h3>
{% endif %}
</a>
<p class="post-meta">Posted by {{ author_name }} on {{ post.date | date: "%B %-d, %Y" }}</p>
</div>
<hr>
2016-01-30 22:22:55 +00:00
{% endfor %}
{% else %}
<p>There are no posts in this category.</p>
2016-01-04 20:49:37 +00:00
{% endif %}
2016-01-30 22:22:55 +00:00
</div>
</div>
2016-01-04 20:49:37 +00:00
</div>
2016-01-30 22:22:55 +00:00
</article>
<hr>