~xdavidwu/xdavidwu.link

1fd71b36f5e9cc23cdb53beef73addf96923a8cc — Juan Ara 3 years ago 22b1050
Configure entries layout `list` or `grid` (#2616)

* Configure entries layout `list` or `grid`

This allows to use grid layout on `page.entries_layout` on the home layout.

Included a break since when using grid the post images are too close to the horizontal line bellow `posts` text.

There's a entries div now surrounding the posts since the first row of the grid was having a slight padding on the left. The home now behaves like posts/categories/tags pages with grid but including the paginator.

For best results on desktop use `classes: wide` and `paginate: 4` on `_config.yml` (or multiples of 4 if you want more rows)

* Fix indent

* Archive subtitle leaves space on the bottom

* Now space is added through style
2 files changed, 6 insertions(+), 4 deletions(-)

M _layouts/home.html
M _sass/minimal-mistakes/_archive.scss
M _layouts/home.html => _layouts/home.html +5 -3
@@ 12,8 12,10 @@ layout: archive
  {% assign posts = site.posts %}
{% endif %}

{% for post in posts %}
  {% include archive-single.html %}
{% endfor %}
<div class="entries-{{ page.entries_layout | default: 'list' }}">
  {% for post in posts %}
    {% include archive-single.html type=page.entries_layout %}
  {% endfor %}
</div>

{% include paginator.html %}

M _sass/minimal-mistakes/_archive.scss => _sass/minimal-mistakes/_archive.scss +1 -1
@@ 32,7 32,7 @@
}

.archive__subtitle {
  margin: 1.414em 0 0;
  margin: 1.414em 0 0.5em;
  padding-bottom: 0.5em;
  font-size: $type-size-5;
  color: $muted-text-color;