Skip to content

Commit ca9ada5

Browse files
author
Stuart Reilly
committed
Change category's post summary list to full width
1 parent 8628469 commit ca9ada5

File tree

3 files changed

+14
-2
lines changed

3 files changed

+14
-2
lines changed

_includes/post_index.html

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,11 @@
66
{%- else -%}
77
{%- assign categoryName = 'Latest Articles' -%}
88
{%- endif -%}
9+
{%- if categoryName == 'Latest Articles' -%}
10+
{%- assign fullWidth = false -%}
11+
{%- else -%}
12+
{%- assign fullWidth = true -%}
13+
{%- endif -%}
914
<div class="post-index grid-container">
1015
{% if categoryName == 'Latest Articles' %}
1116
<h1 class="super-title">Blog</h1>
@@ -31,7 +36,7 @@ <h1 class="sub-title">{{ categoryName }}</h1>
3136
{%- if paginator.page < 2 -%}
3237
{%- include_cached featured_posts.html categoryName=categoryName -%}
3338
{%- endif -%}
34-
{%- include post_summary_list.html -%}
39+
{%- include post_summary_list.html fullWidth=fullWidth -%}
3540
</div>
3641
<div
3742
class="side-lists cell large-3 large-offset-1 grid-padding-y grid-margin-y"

_includes/post_summary.html

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,13 @@
11
{%- assign post = include.post -%}
22
{%- assign hideCategory = include.hideCategory -%}
33
{%- assign author = site.data.authors.authors[post.author] -%}
4+
{%- if include.fullWidth -%}
5+
{%- assign largeClass = 'large-12' -%}
6+
{%- else -%}
7+
{%- assign largeClass = 'large-6' -%}
8+
{%- endif -%}
49
<div
5-
class="post-summary grid-padding-x grid-margin-y grid-padding-y {% include post_colour.html post=post %} cell large-6 small-12"
10+
class="post-summary grid-padding-x grid-margin-y grid-padding-y {% include post_colour.html post=post %} cell {{largeClass}} small-12"
611
>
712
<div class="post-summary cell grid-margin-y">
813
{%- unless hideCategory -%}

_includes/post_summary_list.html

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
{%- assign hideCategory = include.hideCategory -%}
2+
{%- assign fullWidth = include.fullWidth -%}
23
{%- if include.posts != null -%}
34
{%- assign posts = include.posts -%}
45
{%- assign paginated = false -%}
@@ -12,6 +13,7 @@
1213
{%-
1314
include post_summary.html post=post
1415
hideCategory=hideCategory
16+
fullWidth=fullWidth
1517
-%}
1618
{%- endfor -%}
1719
{%- if paginated -%}

0 commit comments

Comments
 (0)