Skip to content

Commit

Permalink
Fix entries_layout: grid
Browse files Browse the repository at this point in the history
  • Loading branch information
mmistakes committed Aug 4, 2020
1 parent 9140a1b commit ca888f2
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 13 deletions.
2 changes: 1 addition & 1 deletion _includes/archive-single.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
{% assign title = post.title %}
{% endif %}

<div class="{{ include.type | default: "list" }}__item">
<div class="{{ include.type | default: 'list' }}__item">
<article class="archive__item" itemscope itemtype="https://schema.org/CreativeWork">
{% if include.type == "grid" and teaser %}
<div class="archive__item-teaser">
Expand Down
5 changes: 3 additions & 2 deletions _layouts/categories.html
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,15 @@
{% endfor %}
</ul>

{% assign entries_layout = page.entries_layout | default: 'list' %}
{% for i in (1..categories_max) reversed %}
{% for category in site.categories %}
{% if category[1].size == i %}
<section id="{{ category[0] | slugify | downcase }}" class="taxonomy__section">
<h2 class="archive__subtitle">{{ category[0] }}</h2>
<div class="entries-{{ page.entries_layout | default: 'list' }}">
<div class="entries-{{ entries_layout }}">
{% for post in category.last %}
{% include archive-single.html type=page.entries_layout %}
{% include archive-single.html type=entries_layout %}
{% endfor %}
</div>
<a href="#page-title" class="back-to-top">{{ site.data.ui-text[site.locale].back_to_top | default: 'Back to Top' }} &uarr;</a>
Expand Down
5 changes: 3 additions & 2 deletions _layouts/category.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

{{ content }}

<div class="entries-{{ page.entries_layout }}">
{% include posts-category.html taxonomy=page.taxonomy type=page.entries_layout %}
{% assign entries_layout = page.entries_layout | default: 'list' %}
<div class="entries-{{ entries_layout }}">
{% include posts-category.html taxonomy=page.taxonomy type=entries_layout %}
</div>
5 changes: 3 additions & 2 deletions _layouts/collection.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

{{ content }}

<div class="entries-{{ page.entries_layout }}">
{% include documents-collection.html collection=page.collection sort_by=page.sort_by sort_order=page.sort_order type=page.entries_layout %}
{% assign entries_layout = page.entries_layout | default: 'list' %}
<div class="entries-{{ entries_layout }}">
{% include documents-collection.html collection=page.collection sort_by=page.sort_by sort_order=page.sort_order type=entries_layout %}
</div>
5 changes: 3 additions & 2 deletions _layouts/posts.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,14 @@
{% endfor %}
</ul>

{% assign entries_layout = page.entries_layout | default: 'list' %}
{% assign postsByYear = site.posts | where_exp: "item", "item.hidden != true" | group_by_exp: 'post', 'post.date | date: "%Y"' %}
{% for year in postsByYear %}
<section id="{{ year.name }}" class="taxonomy__section">
<h2 class="archive__subtitle">{{ year.name }}</h2>
<div class="entries-{{ page.entries_layout | default: 'list' }}">
<div class="entries-{{ entries_layout }}">
{% for post in year.items %}
{% include archive-single.html type=page.entries_layout %}
{% include archive-single.html type=entries_layout %}
{% endfor %}
</div>
<a href="#page-title" class="back-to-top">{{ site.data.ui-text[site.locale].back_to_top | default: 'Back to Top' }} &uarr;</a>
Expand Down
5 changes: 3 additions & 2 deletions _layouts/tag.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

{{ content }}

<div class="entries-{{ page.entries_layout | default: 'list' }}">
{% include posts-tag.html taxonomy=page.taxonomy type=page.entries_layout %}
{% assign entries_layout = page.entries_layout | default: 'list' %}
<div class="entries-{{ entries_layout }}">
{% include posts-tag.html taxonomy=page.taxonomy type=entries_layout %}
</div>
5 changes: 3 additions & 2 deletions _layouts/tags.html
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,15 @@
{% endfor %}
</ul>

{% assign entries_layout = page.entries_layout | default: 'list' %}
{% for i in (1..tags_max) reversed %}
{% for tag in site.tags %}
{% if tag[1].size == i %}
<section id="{{ tag[0] | slugify | downcase }}" class="taxonomy__section">
<h2 class="archive__subtitle">{{ tag[0] }}</h2>
<div class="entries-{{ page.entries_layout | default: 'list' }}">
<div class="entries-{{ entries_layout }}">
{% for post in tag.last %}
{% include archive-single.html type=page.entries_layout %}
{% include archive-single.html type=entries_layout %}
{% endfor %}
</div>
<a href="#page-title" class="back-to-top">{{ site.data.ui-text[site.locale].back_to_top | default: 'Back to Top' }} &uarr;</a>
Expand Down

0 comments on commit ca888f2

Please sign in to comment.