Fix commas in author list (#770)
This commit is contained in:
parent
2186bddc0c
commit
58391d1dbe
@ -247,8 +247,10 @@ scholar:
|
||||
# Filter out certain bibtex entry keywords used internally from the bib output
|
||||
filtered_bibtex_keywords: [abbr, abstract, arxiv, bibtex_show, html, pdf, selected, supp, blog, code, poster, slides, website, preview]
|
||||
|
||||
# Maximum number of authors to be shown, other authors will be visible on hover, leave blank to show all authors
|
||||
max_author_limit: 3
|
||||
# Maximum number of authors to be shown for each publication (more authors are visible on click)
|
||||
max_author_limit: 3 # leave blank to always show all authors
|
||||
more_authors_animation_delay: 10 # more authors are revealed on click using animation; smaller delay means faster animation
|
||||
|
||||
|
||||
# -----------------------------------------------------------------------------
|
||||
# Responsive WebP Images
|
||||
|
@ -29,22 +29,22 @@
|
||||
<div class="author">
|
||||
{% assign author_array_size = entry.author_array | size %}
|
||||
|
||||
{% assign author_array_limit = author_array_size %}
|
||||
{%- if site.max_author_limit and author_array_size > site.max_author_limit %}
|
||||
{% assign author_array_limit = site.max_author_limit %}
|
||||
{% else %}
|
||||
{% assign author_array_limit = author_array_size %}
|
||||
{% endif %}
|
||||
|
||||
{%- for author in entry.author_array limit: author_array_limit -%}
|
||||
{%- assign author_is_self = false -%}
|
||||
{%- if author.last == site.scholar.last_name %}
|
||||
{%- assign author_last_name = author.last | remove: "¶" | remove: "&" | remove: "*" | remove: "†" | remove: "^" -%}
|
||||
{%- if author_last_name == site.scholar.last_name -%}
|
||||
{%- if site.scholar.first_name contains author.first -%}
|
||||
{%- assign author_is_self = true -%}
|
||||
{%- endif -%}
|
||||
{%- endif -%}
|
||||
{%- assign coauthor_url = nil -%}
|
||||
{%- if site.data.coauthors[author.last] -%}
|
||||
{%- for coauthor in site.data.coauthors[author.last] -%}
|
||||
{%- if site.data.coauthors[author_last_name] -%}
|
||||
{%- for coauthor in site.data.coauthors[author_last_name] -%}
|
||||
{%- if coauthor.firstname contains author.first -%}
|
||||
{%- assign coauthor_url = coauthor.url -%}
|
||||
{%- break -%}
|
||||
@ -52,53 +52,35 @@
|
||||
{%- endfor -%}
|
||||
{%- endif -%}
|
||||
|
||||
{%- if forloop.length == 1 -%}
|
||||
{%- if author_is_self %}
|
||||
<em>{{author.last}}, {{author.first}}</em>
|
||||
{%- else -%}
|
||||
{{author.last}}, {{author.first}}
|
||||
{%- endif -%}
|
||||
{%- else -%}
|
||||
{%- unless forloop.last -%}
|
||||
{% if author_is_self %}
|
||||
<em>{{author.last}}, {{author.first}}</em>,
|
||||
{%- else -%}
|
||||
{% if coauthor_url -%}
|
||||
<a href="{{coauthor_url}}">{{author.last}}, {{author.first}}</a>,
|
||||
{%- else -%}
|
||||
{{author.last}}, {{author.first}},
|
||||
{%- endif -%}
|
||||
{%- endif -%}
|
||||
{%- else -%}
|
||||
{%- if author_array_limit == author_array_size %} and {% endif %}
|
||||
{% if author_is_self -%}
|
||||
<em>{{author.last}}, {{author.first}}</em>
|
||||
{% else -%}
|
||||
{%- if coauthor_url -%}
|
||||
<a href="{{coauthor_url}}">{{author.last}}, {{author.first}}</a>
|
||||
{% else -%}
|
||||
{{author.last}}, {{author.first}}
|
||||
{%- endif -%}
|
||||
{%- endif -%}
|
||||
{%- endunless -%}
|
||||
{%- if forloop.length > 1 -%}
|
||||
{%- if forloop.first == false -%}, {%- endif -%}
|
||||
{%- if forloop.last and author_array_limit == author_array_size -%}and {%- endif -%}
|
||||
{%- endif -%}
|
||||
{%- endfor %}
|
||||
|
||||
{% assign more_authors = author_array_size | minus: author_array_limit %}
|
||||
|
||||
{%- if more_authors > 0 %}
|
||||
{% assign more_authors_hide = more_authors | append: " more author" %}
|
||||
{% if more_authors > 1 %}
|
||||
{% assign more_authors_hide = more_authors_hide | append: "s" %}
|
||||
{% endif %}
|
||||
{% assign more_authors_show = '' %}
|
||||
{%- if author_is_self -%}
|
||||
<em>{{author.first}} {{author.last}}</em>
|
||||
{%- else -%}
|
||||
{%- if coauthor_url -%}
|
||||
<a href="{{coauthor_url}}">{{author.first}} {{author.last}}</a>
|
||||
{%- else -%}
|
||||
{{author.first}} {{author.last}}
|
||||
{%- endif -%}
|
||||
{%- endif -%}
|
||||
{%- endfor -%}
|
||||
{%- assign more_authors = author_array_size | minus: author_array_limit -%}
|
||||
|
||||
{%- assign more_authors_hide = more_authors | append: " more author" -%}
|
||||
{%- if more_authors > 0 -%}
|
||||
{%- if more_authors > 1 -%}
|
||||
{%- assign more_authors_hide = more_authors_hide | append: "s" -%}
|
||||
{%- endif -%}
|
||||
{%- assign more_authors_show = '' -%}
|
||||
{%- for author in entry.author_array offset: author_array_limit -%}
|
||||
{% assign more_authors_show = more_authors_show | append: author.last | append: ", " | append: author.first %}
|
||||
{% unless forloop.last %}
|
||||
{% assign more_authors_show = more_authors_show | append: ", " %}
|
||||
{% endunless %}
|
||||
{%- assign more_authors_show = more_authors_show | append: author.first | append: " " | append: author.last -%}
|
||||
{%- unless forloop.last -%}
|
||||
{%- assign more_authors_show = more_authors_show | append: ", " -%}
|
||||
{%- endunless -%}
|
||||
{%- endfor -%}
|
||||
and
|
||||
, and
|
||||
<span
|
||||
class="more-authors"
|
||||
title="click to view {{more_authors_hide}}"
|
||||
@ -112,10 +94,10 @@
|
||||
if (++cursorPosition == more_authors_text.length){
|
||||
clearInterval(textAdder);
|
||||
}
|
||||
}, 15);
|
||||
}, '{{site.more_authors_animation_delay}}');
|
||||
"
|
||||
>{{more_authors_hide}}</span>
|
||||
{% endif %}
|
||||
{%- endif -%}
|
||||
|
||||
</div>
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user