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 posts=site.posts %}
You can customize the behavior of this include by passing the following parameters:
| Parameter | Default | Description |
|---|---|---|
posts |
Required | The posts to display |
index |
page.first_page_path |
The URL for the “More” link |
limit |
page.posts_limit, site.paginate, or -1 |
Number of posts to display |
Example with parameters:
{% include post-timeline.html posts=site.articles limit=5 index="/articles/" %}
If the limit is set to a number below 0, all posts will be shown.
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.posts parameter must be passed explicitly.index parameter is optional. If omitted, the include falls back to page.first_page_path.relative_url filter is used for the link, which helps generate correct URLs in different site configurations.container-xl, p-responsive-blog, etc.) for optimal display on various screen sizes.