Last active
December 28, 2019 16:32
-
-
Save landlockedboat/68c3089f7c1e80f531d0e09a6cb7b816 to your computer and use it in GitHub Desktop.
Include Jekyll posts by tag following the desired tag order
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
layout: default | |
--- | |
<div class="home"> | |
{% include posts-by-tag.html tag_name="tag2" %} | |
{% include posts-by-tag.html tag_name="tag1" %} | |
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{% for tag in site.tags %} | |
{% capture tag_name %}{{tag | first}}{% endcapture %} | |
{% if tag_name == include.tag_name %} | |
<h2 class="post-list-heading" id="{{ tag[0] | slugify }}">{{ tag_name }}</h2> | |
<ul class="post-list"> | |
{% for post in tag[1] %} | |
<br> | |
<h3> | |
<a class="post-link" href="{{ post.url | relative_url }}"> | |
{{ post.title | escape }} | |
</a> | |
</h3> | |
<div class="post-meta">{{ post.date | date: "%b %-d, %Y" }}</div> | |
</li> | |
{% endfor %} | |
</ul> | |
{% endif %} | |
{% endfor %} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment