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

PropertyTypeRequiredDescription
authorstring or arrayNoSingle author name or array of names
datestringNoPublication date (processed by blogDate filter)

Example

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