This include file generates a card for displaying a link with optional thumbnail and description. It’s designed to be flexible and can display as either a clickable link or a text-only card.
To use this include in your Jekyll theme, add the following line to your template:
{% include link-card.html link=page.link_object %}
You can customize the behavior of this include by passing a link
object with the following properties:
Property | Required | Description |
---|---|---|
name |
Yes | The name or title of the link |
url |
No | The URL for the link. If not provided, the card will be displayed as text-only |
thumbnail |
No | The path to an image to be used as a thumbnail |
description |
No | A brief description of the link |
octicon |
No | An Octicon name to display instead of a thumbnail |
Example with parameters:
{% assign link = page.featured_link %}
{% include link-card.html link=link %}
This include file may depend on:
octicon
property is specified.relative_url
, to ensure correct URL generation.octicon
functionality assumes you have the Octicons library or a similar icon system set up in your theme.