summaryrefslogtreecommitdiff
path: root/_includes
diff options
context:
space:
mode:
authorAdam Carpenter <53hornet@gmail.com>2019-05-04 11:28:24 -0400
committerAdam Carpenter <53hornet@gmail.com>2019-05-04 11:28:24 -0400
commit37a224065d3dc16e9ac73884f4d297f88d599f29 (patch)
treece21db592daca388bf668dc6055d341903131423 /_includes
parent689e85e78c106cefb6c83bcdbeae565d021d2e96 (diff)
downloadcobalt-site-37a224065d3dc16e9ac73884f4d297f88d599f29.tar.xz
cobalt-site-37a224065d3dc16e9ac73884f4d297f88d599f29.zip
Posts on journal page are chronological, with most recent at the top.
Diffstat (limited to '_includes')
-rw-r--r--_includes/all-posts.liquid5
-rw-r--r--_includes/post-list.liquid3
-rw-r--r--_includes/similar-posts.liquid31
3 files changed, 23 insertions, 16 deletions
diff --git a/_includes/all-posts.liquid b/_includes/all-posts.liquid
index f8377b1..ef05295 100644
--- a/_includes/all-posts.liquid
+++ b/_includes/all-posts.liquid
@@ -4,9 +4,10 @@
</p>
<ul class="menu-list">
- {% for post in collections.posts.pages %}
+ {% assign posts = collections.posts.pages | reverse %}
+ {% for post in posts %}
<li>
- <a href="{{ post.permalink }}">
+ <a href="/{{ post.permalink }}">
{% if post.published_date %}
<span class="tag">
{{ post.published_date | date: "%e %b %Y" }}
diff --git a/_includes/post-list.liquid b/_includes/post-list.liquid
index 7f6d55d..e62fd63 100644
--- a/_includes/post-list.liquid
+++ b/_includes/post-list.liquid
@@ -1,5 +1,6 @@
<div class="columns is-centered is-multiline">
- {% for post in collections.posts.pages %}
+ {% assign posts = collections.posts.pages | reverse %}
+ {% for post in posts %}
<div class="column is-full">
<div class="card">
<header class="card-header">
diff --git a/_includes/similar-posts.liquid b/_includes/similar-posts.liquid
index be5ef52..0dddca2 100644
--- a/_includes/similar-posts.liquid
+++ b/_includes/similar-posts.liquid
@@ -5,19 +5,24 @@
<ul class="menu-list">
{% for post in collections.posts.pages %}
- {% if post.categories contains page.categories.first %}
- <li>
- <a href="{{ post.permalink }}">
- {% if post.published_date %}
- <span class="tag is-rounded">
- {{ post.published_date | date: "%e %b %Y" }}
- </span>
- {% endif %}
+ {%
+ if post.categories
+ and page.categories
+ and page.title != post.title
+ and post.categories contains page.categories.first
+ %}
+ <li>
+ <a href="/{{ post.permalink }}">
+ {% if post.published_date %}
+ <span class="tag is-rounded">
+ {{ post.published_date | date: "%e %b %Y" }}
+ </span>
+ {% endif %}
- {{ post.title }}
- </a>
- </li>
- {% endif %}
- {% endfor %}
+ {{ post.title }}
+ </a>
+ </li>
+ {% endif %}
+ {% endfor %}
</ul>
</aside>