Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Configure entries layout list or grid #2616

Merged
merged 4 commits into from
Jul 24, 2020
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 10 additions & 3 deletions _layouts/home.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,15 @@ <h3 class="archive__subtitle">{{ site.data.ui-text[site.locale].recent_posts | d
{% assign posts = site.posts %}
{% endif %}

{% for post in posts %}
{% include archive-single.html %}
{% endfor %}
{% if page.entries_layout == "grid" %}
<p></p>
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably there's a better way to add some padding / space but I've not done front-end / css in years :P

Please if you like this PR but think there's a better way to add this space, don't ask me to fix this line 😳

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah definitely not a fan of the empty <p></p> element. Styling should be achieved with CSS, not forcing in HTML elements for presentation purposes, it's bad for semantics.

As @iBug suggested, there are enough class name hooks that I'm sure a simple line of CSS can add some margin to increase the white space.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the tip. I added 0.5em instead to minimize the differences with previous versions (i.e. with lists) while keeping a small visual space between the horizontal line and the posts.

Hey mom see, I'm doing frontend again! :D

{% endif %}

<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 %}