Skip to content

Instantly share code, notes, and snippets.

@bmann
Created July 24, 2019 00:12
Show Gist options
  • Save bmann/600909701c45a3523465421bdb197594 to your computer and use it in GitHub Desktop.
Save bmann/600909701c45a3523465421bdb197594 to your computer and use it in GitHub Desktop.
Home page loop for BMC Blog
---
layout: archive
author_profile: true
---
<h3 class="archive__subtitle">Recent Blog Posts</h3>
{% assign postCounter = 0 %}
{% assign maxPosts = 3 %}
{% for post in site.posts %}
{% unless post.categories contains "social" or post.categories contains "links" %}
{% assign postCounter = postCounter | plus: 1 %}
{% include archive-single.html %}
{% if postCounter >= maxPosts %}{% break %}{% endif %}
{% endunless %}
{% endfor %}
<h3 class="archive__subtitle">Recent Bookmarks</h3>
{% for post in site.categories["links"] limit:3 %}
{% include archive-single.html %}
{% endfor %}
<h3 class="archive__subtitle">Recent Social Posts</h3>
{% for post in site.categories["social"] limit:8 %}
{% include archive-single.html %}
{% endfor %}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment