The Post Timeline Card include file is responsible for rendering individual posts within a timeline layout. It provides a structured and customizable way to display posts with metadata such as title, author, date, tags, and optional media (images or videos).
To use this include in your Jekyll theme, add the following line within a template:
{% include post-timeline-card.html post=post %}
This include requires a post
object to be passed, which contains various metadata fields. Below is a list of supported fields:
Parameter | Required | Default | Description |
---|---|---|---|
post.url |
✅ Yes | N/A | The permalink to the post |
post.title |
✅ Yes | N/A | The title of the post |
post.author |
❌ No | None | The author of the post |
post.date |
✅ Yes | N/A | The date the post was published |
post.tags |
❌ No | None | An array of tags associated with the post |
post.excerpt |
❌ No | None | A short excerpt from the post |
post.content |
❌ No | None | The full content of the post (used for “Continue Reading”) |
post.type |
❌ No | comment |
The type of post, used for the Octicon badge |
post.video |
❌ No | None | A URL to an embedded video |
post.image |
❌ No | None | A URL to a featured image |
To see post-timeline-card.html
in action within the post-timeline
include, visit our demo page:
This include relies on:
.TimelineItem
and .IssueLabel
classes should be styled appropriately in your theme.site.posts
.To modify how posts are displayed:
.TimelineItem
, .title
, and .summary
styles.post-timeline-card.html
to match your theme.post.type
value to change the icon displayed.post
object is correctly passed when including this file.post.type
is not provided, it defaults to comment
for the Octicon.relative_url
filter is used for post links to ensure compatibility with different site configurations.