Skip to content
This repository has been archived by the owner on Apr 27, 2024. It is now read-only.

Latest commit

 

History

History
38 lines (25 loc) · 919 Bytes

2019-12-22-post-lists.md

File metadata and controls

38 lines (25 loc) · 919 Bytes

Post Lists

The [post_list.html]({{ site.github.repository_url }}/blob/master/_includes/post_list.html) include renders lists of blog posts, with support for filtering by category or tag.

Listing all published posts

To render a list of all the site's posts:

{% raw %}{% include post_list.html %}{% endraw %}

Listing draft posts

To render a list of draft posts only, pass drafts=true:

{% raw %}{% include post_list.html drafts=true %}{% endraw %}

Listing posts in a category

To render only posts from a given category pass category="some-category" to post_list.html:

{% raw %}{% include post_list.html category="some-category" %}{% endraw %}

Listing posts with a tag

To render the list of posts with a given tag pass tag="some-tag" to post_list.html:

{% raw %}{% include post_list.html tag="some-tag" %}{% endraw %}