Skip to content

Commit

Permalink
author contributions template
Browse files Browse the repository at this point in the history
but have not set roles in the metadata
  • Loading branch information
dhimmel committed Dec 21, 2023
1 parent 537eb29 commit 2a8cc8f
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions content/02.body.md
Original file line number Diff line number Diff line change
Expand Up @@ -440,3 +440,24 @@ This work was supported, in part, by Pfizer Worldwide Research, Development, and
The funders had no role in the study design, data analysis and interpretation, or writing of the manuscript.

### Authors' contributions

Author contributions are noted here according to [CRediT](https://credit.niso.org/) (Contributor Roles Taxonomy).
{%- set roles = {} -%}
{%- for author in manubot.authors -%}
{% for role in author.get('roles', []) -%}
{%- if role in roles -%}
{% set _ = roles[role].append(author.initials) %}
{%- else -%}
{% set _ = roles.update({role: [author.initials]}) %}
{%- endif -%}
{%- endfor -%}
{%- endfor %}
{% for role, author_initials in roles.items() -%}
{% if author_initials|length > 2 %}
{{- role }} by {{ ', '.join(author_initials[:-1]) }}, and {{ author_initials[-1] }}.
{% elif author_initials|length == 2 %}
{{- role }} by {{ ' and '.join(author_initials) }}.
{% else %}
{{- role }} by {{ author_initials[0] }}.
{%- endif -%}
{%- endfor %}

0 comments on commit 2a8cc8f

Please sign in to comment.