diff options
author | Adam Carpenter <gitlab@53hor.net> | 2019-06-15 21:51:00 -0400 |
---|---|---|
committer | Adam Carpenter <gitlab@53hor.net> | 2019-06-15 21:51:00 -0400 |
commit | b9f1e7a0a1142d3060e2a3a020282eb5dca8f86a (patch) | |
tree | ac8b465789b18d61765be70b48ddf37f37cbc569 | |
parent | 402decfde5390d1c84a0a5dd74635de3d7c634c2 (diff) | |
download | cobalt-site-b9f1e7a0a1142d3060e2a3a020282eb5dca8f86a.tar.xz cobalt-site-b9f1e7a0a1142d3060e2a3a020282eb5dca8f86a.zip |
Broke out post links, organized _includes.
-rw-r--r-- | _includes/all-posts.liquid | 21 | ||||
-rw-r--r-- | _includes/post-link.liquid | 11 | ||||
-rw-r--r-- | _includes/posts-all.liquid | 12 | ||||
-rw-r--r-- | _includes/posts-recent.liquid | 15 | ||||
-rw-r--r-- | _includes/posts-similar.liquid (renamed from _includes/similar-posts.liquid) | 14 | ||||
-rw-r--r-- | _includes/recent-posts.liquid | 10 | ||||
-rw-r--r-- | _layouts/journal.liquid | 4 | ||||
-rw-r--r-- | _layouts/post.liquid | 2 |
8 files changed, 43 insertions, 46 deletions
diff --git a/_includes/all-posts.liquid b/_includes/all-posts.liquid deleted file mode 100644 index a681bfb..0000000 --- a/_includes/all-posts.liquid +++ /dev/null @@ -1,21 +0,0 @@ -<aside class="menu"> - <p class="menu-label has-text-centered"> - All Posts - </p> - - <ul class="menu-list"> - {% assign posts = collections.posts.pages %} - {% for post in posts %} - <li> - <a href="/{{ post.permalink }}"> - {% if post.published_date %} - <span class="tag"> - {{ post.published_date | date: "%e %b %Y" }} - </span> - {% endif %} - {{ post.title }} - </a> - </li> - {% endfor %} - </ul> -</aside> diff --git a/_includes/post-link.liquid b/_includes/post-link.liquid new file mode 100644 index 0000000..92548cf --- /dev/null +++ b/_includes/post-link.liquid @@ -0,0 +1,11 @@ +<li> + <a href="/{{ post.permalink }}"> + {% if post.published_date %} + <span class="tag"> + {{ post.published_date | date: "%e %b %Y" }} + </span> + {% endif %} + + {{ post.title }} + </a> +</li> diff --git a/_includes/posts-all.liquid b/_includes/posts-all.liquid new file mode 100644 index 0000000..8088e82 --- /dev/null +++ b/_includes/posts-all.liquid @@ -0,0 +1,12 @@ +<aside class="menu"> + <p class="menu-label has-text-centered"> + All Posts + </p> + + <ul class="menu-list"> + {% assign posts = collections.posts.pages %} + {% for post in posts %} + {% include post-link.liquid %} + {% endfor %} + </ul> +</aside> diff --git a/_includes/posts-recent.liquid b/_includes/posts-recent.liquid new file mode 100644 index 0000000..8aae606 --- /dev/null +++ b/_includes/posts-recent.liquid @@ -0,0 +1,15 @@ +<div class="columns is-centered is-multiline"> + <p class="menu-label has-text-centered"> + Recent Posts + </p> + + <!-- Basically limit length of posts array to the max number of recent + posts to include. To start with all posts are shown since it isn't really a + performance concern. --> + {% assign posts = collections.posts.pages %} + {% for post in posts %} + <div class="column is-full"> + {% include post-card.liquid %} + </div> + {% endfor %} +</div> diff --git a/_includes/similar-posts.liquid b/_includes/posts-similar.liquid index 9a7e33a..6879d3b 100644 --- a/_includes/similar-posts.liquid +++ b/_includes/posts-similar.liquid @@ -1,5 +1,5 @@ <aside class="menu"> - <p class="menu-label"> + <p class="menu-label has-text-centered"> Similar Posts </p> @@ -12,17 +12,7 @@ and page.categories.first 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> + {% include post-link.liquid %} {% endif %} {% endfor %} </ul> diff --git a/_includes/recent-posts.liquid b/_includes/recent-posts.liquid deleted file mode 100644 index c93ce63..0000000 --- a/_includes/recent-posts.liquid +++ /dev/null @@ -1,10 +0,0 @@ -<div class="columns is-centered is-multiline"> - <p class="menu-label has-text-centered"> - Recent Posts - </p> - - {% assign posts = collections.posts.pages %} - {% for post in posts %} - {% include post-card.liquid %} - {% endfor %} -</div> diff --git a/_layouts/journal.liquid b/_layouts/journal.liquid index 81f6428..4478778 100644 --- a/_layouts/journal.liquid +++ b/_layouts/journal.liquid @@ -39,13 +39,13 @@ <!-- begin short post list --> <div class="column"> - {% include recent-posts.liquid %} + {% include posts-recent.liquid %} </div> <!-- end short post list --> <!-- begin long post list --> <div class="column is-narrow"> - {% include all-posts.liquid %} + {% include posts-all.liquid %} </div> <!-- end long post list --> diff --git a/_layouts/post.liquid b/_layouts/post.liquid index 80831a2..d945917 100644 --- a/_layouts/post.liquid +++ b/_layouts/post.liquid @@ -70,7 +70,7 @@ </div> <div class="column is-narrow"> - {% include similar-posts.liquid %} + {% include posts-similar.liquid %} </div> </div> </div> |