This include file generates a timeline of posts with an optional “View all” link at the end. It’s designed to be flexible and customizable through various parameters.
To use this include in your Jekyll theme, add the following line to your template:
{% include post-timeline.html %}
You can customize the behavior of this include by passing the following parameters:
Parameter | Default | Description |
---|---|---|
collection |
site.posts |
The collection of posts to display |
index |
None | The URL for the “View all” link |
limit |
site.pagination or -1 |
Number of posts to display |
Example with parameters:
{% include post-timeline.html collection=site.articles limit=5 index="/articles/" %}
If the limit is set to a number below 0, all posts will show.
To see post-timeline.html
in action within the paginate_timeline
layout, visit our demo page:
limit
if set) and includes a post-timeline-card.html
for each post.This include file depends on:
post-timeline-card.html
: Another include file that should define how each post card is displayed.To customize the appearance of the timeline:
post-timeline-card.html
include to change how individual posts are displayed.collection
parameter defaults to site.posts
if not specified.limit
parameter is optional. If not set, all posts in the collection will be displayed.index
parameter is required for the “View all” link to function properly.relative_url
filter is used for the “View all” link, which is a Jekyll filter for generating correct URLs in different site configurations.container-xl
, p-responsive-blog
, etc.) for optimal display on various screen sizes.