Skip to main content

filters/authors

Joins the list of authors’ names in to a single string.

{{ post.authors|authors }}

Arguments

Name Type Default Description
separator str ', ' The separator between each author.
last_separator str '' The separator between the last two authors. If this is an empty string then separator is used.
prefix str '' The prefix to all the authors.
suffix str '' The suffix to all the authors.

Description

The authors filter makes it easy to output a list of authors for a particular post. The default arguments produce a comma-separated list but the separators can be customised and the list can be prefixed and suffixed.

Examples

Default Arguments

Input

{{ post.authors|authors }}

Output

John Green, Maureen King, Lauren Myracle

Non-Default Arguments

Input

{{ post.authors|authors(last_separator=' and ', prefix='Written By: ', suffix='.') }}

Output

Written By: John Green, Maureen King and Lauren Myracle.