Partial Component
Author-Date
The Author-Date partial renders author information and publication dates for blog posts and articles. It handles both single authors and multiple co-authors, and formats dates using a blog-friendly format.
Manifest
{
"name": "author-date",
"type": "_partials",
"styles": ["author-date.css"],
"scripts": [],
"requires": []
}
Configuration
author: "Jane Doe"
date: "2024-03-15"
# or for multiple authors:
author:
- "Jane Doe"
- "John Smith"
Configuration Options
| Property | Type | Required | Description |
|---|---|---|---|
author | string or array | No | Single author name or array of names |
date | string | No | Publication date (processed by blogDate filter) |
Example
Blog Post
Understanding Quantum Computing
A deep dive into the future of computation
Usage in Templates
{% from "components/_partials/author-date/author-date.njk" import authorDate %}
{{ authorDate({ date: section.date, author: section.author }) }}
Features
- Multiple Authors: Supports single or multiple author names
- Date Formatting: Automatic blog-friendly date formatting
- Flexible Rendering: Displays author, date, or both
- Semantic HTML: Uses proper time elements with datetime attributes
- Accessibility: Screen reader friendly markup