Card
Displays posts in a responsive multi-column card grid with optional images, summaries, and dates.
Location : layouts/_partials/widgets/posts/card.html
Parameters :
| Parameter | Type | Description | Default |
|---|---|---|---|
pageList | Pages | Collection of pages to display | required |
columns | number | Number of columns (1-4) | 3 |
showImage | boolean | Show featured images | from config |
showSummary | boolean | Show post summaries | from config |
showDate | boolean | Show post dates | from config |
dateFormat | string | Date format | ":date_medium" |
class | string | Additional CSS classes | - |
key | string | Config key for visibility | "PostCard" |
Configuration :
yaml
params:
showPostCard: false # Use card layout (default: list)
showPostCardImage: true # Show featured images
showPostCardSummary: true # Show summaries
showPostCardDate: true # Show dates
postCardColumns: 3 # Number of columns (1-4)
postCardDateFormat: ":date_medium" # Date format
postCardSortBy: "date" # Sort by "date", "weight", or "title"
postCardSortOrder: "desc" # Sort order "asc" or "desc"
postCardPaginate: true # Enable pagination
postCardPageSize: 20 # Number of items per pageExamples :
go
// Basic usage (3 columns)
{{ partial "widgets/posts/card.html" (dict "pageList" .Pages) }}
// 2-column grid
{{ partial "widgets/posts/card.html" (dict
"pageList" .Pages
"columns" 2
) }}
// Without images
{{ partial "widgets/posts/card.html" (dict
"pageList" .Pages
"showImage" false
) }}
// Minimal cards (title only)
{{ partial "widgets/posts/card.html" (dict
"pageList" .Pages
"showImage" false
"showSummary" false
"showDate" false
) }}
// Custom date format
{{ partial "widgets/posts/card.html" (dict
"pageList" .Pages
"dateFormat" "Jan 2, 2006"
) }}