The paginate_timeline layout is designed to display blog posts (or other collections) in a paginated timeline format. It uses Jekyll’s built-in pagination and a supporting post-timeline.html
include to list items. This layout is particularly useful for blogs with many posts, where readers can navigate page by page.
To use the Paginate Timeline layout in your Jekyll site, create a new file with the following front matter:
---
layout: paginate_timeline
title: My Paginated Blog
---
Jekyll’s pagination feature must be enabled in your _config.yml
. For example:
paginate: 5
paginate_path: "/blog/page:num"
This config will split your post list into chunks of five items per page.
The Paginate Layout must be specified in the index of the start of this path. For the example above, it should be in /blog/index.html
.
[!NOTE] The path should be absolute and start with a
/
, otherwise the index links will not work correctly.
The Paginate Timeline layout supports the following:
Parameter | Default | Description |
---|---|---|
layout |
Required | Must be set to paginate_timeline |
title |
None | The heading to display on the timeline page |
content |
None | You can write page content below the front matter. It will appear above the timeline. |
pagination.permalink |
site.pagination.permalink or site.paginate_path |
Path structure for pagination pages (e.g., page:num ) |
posts_limit |
site.paginate |
Number of posts to display per page, if desired. Can also be overridden in _config.yml . |
{{ content }}
before displaying the timeline.post-timeline.html
partial, which loops through the specified collection (typically paginator.posts
) and renders each post.paginator.first_page_path
or a fallback URL for linking back to the main blog index._config.yml
settings (paginate
, paginate_path
, etc.) to define pagination behavior.Below is a minimal usage example:
---
layout: paginate_timeline
title: My Paginated Blog
---
Welcome to my blog! Below is a list of the latest posts. Use the pagination buttons to navigate.
_config.yml
paginate: 5
paginate_path: "blog/page:num"
With this configuration:
/blog/page1
, /blog/page2
, etc.site.posts
, but you can specify a different collection if desired.post-timeline.html
(included): Used to render the collection of posts.post-timeline-card.html
(included): Used to render each post.Ensure these dependencies are properly set up in your Jekyll theme for the Paginate Timeline layout to function correctly.