{% macro doi_url(d) %}https://doi.org/{{ d }}{% endmacro %} {% macro name(p) %}{% if p.literal %}{{ p.literal }}{% else %}{{ p.given }} {{ p.family }}{% endif %}{% endmacro %} {% macro rname(p) %}{% if p.literal %}{{ p.literal }}{% else %}{{ p.family }}, {{ p.given }}{% endif %}{% endmacro %} {% macro names(pp) %}{{ name(pp[0]) }}{% for p in pp[1:] %}, {{ name(p) }}{% endfor %}{% endmacro %} {% macro rnames(pp) %}{{ rname(pp[0]) }}{% for p in pp[1:] %}; {{ rname(p) }}{% endfor %}{% endmacro %} {# See also Item path(...) #} {% macro path(s) %}{{ s[0].directory() }}{% for x in s[1:] %}/{{ x.directory() }}{% endfor %}/{{ s[-1].file() }}{% endmacro %} {% macro plural(x, s, p) %}{% if x|count == 1 %}{{ s }}{% else %}{{ p }}{% endif %}{% endmacro %} {% macro isodate(d) %}{{ '{:0>4s}-{:0>2s}-{:0>2s}'.format(d[0], d[1], d[2]) }}{% endmacro %} {% macro logo_href(i, dirprefix='') %}{% if dirprefix %}{{ dirprefix }}/{% endif %}{{ i.logo.removeprefix('file::').rpartition('/')[2] }}{% endmacro %} {# -------- Journal-related -------- #} {% macro journal_issns(j) %} {% if j.metadata.issn_l %}

Linking ISSN: {{ j.metadata.issn_l }}

{% endif %} {% if j.metadata.issn %}

Print ISSN: {{ j.metadata.issn }}

{% endif %} {% if j.metadata.eissn %}

Electronic ISSN: {{ j.metadata.eissn }}

{% endif %} {% endmacro %} {# -------- Article-related -------- #} {% macro article_authors(art) %} {% if art.metadata.author %}
{{ plural(art.metadata.author, 'Author', 'Authors') }}
{% endif %} {% endmacro %} {% macro article_file_href(art, fk) %}{{ fk.removeprefix('file::') }}/{{ art.metadata.custom[fk].rpartition('/')[2] }}{% endmacro %} {% macro article_file_link(art, fk, lt, ic) %}{{ lt }}{% endmacro %} {% macro article_file_article_pdf(art) %}{{ article_file_link(art, 'file::article_pdf', 'PDF', 'fa-file-pdf') }}{% endmacro %} {% macro article_file_metadata_jats(art) %}{{ article_file_link(art, 'file::metadata_jats', 'JATS XML', 'fa-file-code') }}{% endmacro %} {% macro meta(t, v) %} {% if v %}{% endif %} {% endmacro %}