List
Displays a simple list of posts with optional date display.
Location : layouts/_partials/widgets/posts/list.html
Parameters :
| Parameter | Type | Description | Default |
|---|---|---|---|
pageList | Pages | Collection of pages to display | required |
showDate | boolean | Show post dates | from config |
dateFormat | string | Date format | ":date_medium" |
listStyle | string | CSS list-style value | "disc" |
class | string | Additional CSS classes | - |
key | string | Config key for visibility | "PostList" |
Configuration :
yaml
params:
showPostList: true # Show/hide post list
showPostListDate: true # Show dates in list
postListStyle: "disc" # List bullet style ("disc", "circle", "square", "none")
postListDateFormat: ":date_medium" # Default date format
postListSortBy: "date" # Sort by "date", "weight", or "title"
postListSortOrder: "desc" # Sort order "asc" or "desc"
postListPaginate: true # Enable pagination
postListPageSize: 15 # Number of items per pageExamples :
go
// Basic usage
{{ partial "widgets/posts/list.html" (dict "pageList" .Pages) }}
// With dates
{{ partial "widgets/posts/list.html" (dict
"pageList" .Pages
"showDate" true
) }}
// Custom date format
{{ partial "widgets/posts/list.html" (dict
"pageList" .Pages
"showDate" true
"dateFormat" "Jan 2, 2006"
) }}
// Custom list style
{{ partial "widgets/posts/list.html" (dict
"pageList" .Pages
"listStyle" "square"
) }}
// No bullets
{{ partial "widgets/posts/list.html" (dict
"pageList" .Pages
"listStyle" "none"
) }}