{# Print Authors of a record # @param authors string, array of strings or array of objects with title/link attributes # @param options array of key/value strings. See 'Default Options' below (optional) #} {% macro authors(authors, options = {}) %} {# Default Options #} {% set options = options + { authors_overrides_author: false, authors_prefix: 'von ', } %} {% set authors = options.authors_overrides_author | default(authors) | default(theme.defaults.author) | default([]) %} {# Convert the author to an array of authors #} {% set authors = authors is iterable ? authors : [authors] %} {# Convert author objects to simple strings if necessary #} {% set output = [] %} {% for key,item in authors %} {# Convert the Author Object in to a Link #} {% set item = item.title|default ? ''~item.title~'' : item %} {# Overwrites the Author - prapare for output #} {% set output = output|merge([item]) %} {% endfor %} {# Output #} {{ options.authors_prefix }}{{ output|join(', ')|raw }} {% endmacro %}