Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes bug when generating publications from single authors. #27

Merged
merged 3 commits into from
Sep 30, 2018
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 29 additions & 22 deletions _layouts/bib.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,30 +15,37 @@
{% else %}
<span class="title">{{entry.title}}</span>
<span class="author">
{% for author in entry.author_array %}
{% unless forloop.last %}
{% if author.last == site.scholar.last_name %}
<em>{{author.last}}, {{author.first}}</em>,
{% else %}
{% if site.data.coauthors[author.last] %}
<a href="{{site.data.coauthors[author.last].url}}" target="_blank">{{author.last}}, {{author.first}}</a>,
{% for author in entry.author_array %}
{% if forloop.length == 1 %}
{% if author.last == site.scholar.last_name %}
<em>{{author.last}}, {{author.first}}</em>
{% else %}
{{author.last}}, {{author.first}}
{% endif %}
{% else %}
{{author.last}}, {{author.first}},
{% unless forloop.last %}
{% if author.last == site.scholar.last_name %}
<em>{{author.last}}, {{author.first}}</em>,
{% else %}
{% if site.data.coauthors[author.last] %}
<a href="{{site.data.coauthors[author.last].url}}" target="_blank">{{author.last}}, {{author.first}}</a>,
{% else %}
{{author.last}}, {{author.first}},
{% endif %}
{% endif %}
{% else %}
{% if author.last == site.scholar.last_name %}
and <em>{{author.last}}, {{author.first}}</em>
{% else %}
{% if site.data.coauthors[author.last] %}
and <a href="{{site.data.coauthors[author.last].url}}" target="_blank">{{author.last}}, {{author.first}}</a>
{% else %}
and {{author.last}}, {{author.first}}
{% endif %}
{% endif %}
{% endunless %}
{% endif %}
{% endif %}
{% else %}
and
{% if author.last == site.scholar.last_name %}
<em>{{author.last}}, {{author.first}}</em>
{% else %}
{% if site.data.coauthors[author.last] %}
<a href="{{site.data.coauthors[author.last].url}}" target="_blank">{{author.last}}, {{author.first}}</a>
{% else %}
{{author.last}}, {{author.first}}
{% endif %}
{% endif %}
{% endunless %}
{% endfor %}
{% endfor %}
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome, thanks! Just a minor nit: the original indentation was 2 spaces, but the new one is 4. Happy to merge once the indentation fixed. Thanks.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, the habit. Fixed now :)

</span>

<span class="periodical">
Expand Down