Reputation: 2470
I want to display a specific post in the middle of the page among other regular posts(check screenshot)
I know I could use front matter with something like featured: true
but is there any other way to do this?
Upvotes: 1
Views: 102
Reputation: 12592
Better answer: create similar divs around each post, and target them with CSS like this:
div {width: 50℅;}
div:nth-child(1), div:nth-child(4) {width: 100%;}
Layout should be in CSS, if possible.
Upvotes: 1
Reputation: 12592
Simple. Just do this:
{% for post in site.posts %}
{% if forloop.index == 1 or forloop.index == 4 %}
output wide post
{% else %}
output normal post
{% endif %}
{% endfor %}
Upvotes: 2