Skip to content

Commit 3a6619b

Browse files
eolesinskiSuraj-Bhor
authored andcommitted
fix author spacing (alshedivat#2197)
This PR fixes issue alshedivat#2185 and addresses discussion alshedivat#2153. - removes leading whitespace before commas in author list - fixes author spacing
1 parent 995534b commit 3a6619b

File tree

1 file changed

+20
-20
lines changed

1 file changed

+20
-20
lines changed

_layouts/bib.liquid

+20-20
Original file line numberDiff line numberDiff line change
@@ -50,60 +50,60 @@
5050
{% assign author_array_limit = site.max_author_limit %}
5151
{% endif %}
5252

53-
{% for author in entry.author_array limit: author_array_limit %}
53+
{%- for author in entry.author_array limit: author_array_limit -%}
5454
{% assign author_is_self = false %}
55-
{% assign author_last_name = author.last | remove: '¶' | remove: '&' | remove: '*' | remove: '†' | remove: '^' %}
55+
{%- assign author_last_name = author.last | remove: '¶' | remove: '&' | remove: '*' | remove: '†' | remove: '^' -%}
5656
{% if site.scholar.last_name contains author_last_name %}
5757
{% if site.scholar.first_name contains author.first %}
5858
{% assign author_is_self = true %}
5959
{% endif %}
60-
{% endif %}
60+
{%- endif -%}
6161
{% assign coauthor_url = null %}
62-
{% assign clean_last_name = author_last_name | downcase | remove_accents %}
62+
{%- assign clean_last_name = author_last_name | downcase | remove_accents -%}
6363
{% if site.data.coauthors[clean_last_name] %}
64-
{% for coauthor in site.data.coauthors[clean_last_name] %}
64+
{%- for coauthor in site.data.coauthors[clean_last_name] -%}
6565
{% if coauthor.firstname contains author.first %}
66-
{% assign coauthor_url = coauthor.url %}
66+
{%- assign coauthor_url = coauthor.url -%}
6767
{% break %}
6868
{% endif %}
6969
{% endfor %}
70-
{% endif %}
70+
{%- endif -%}
7171

72-
{% if forloop.length > 1 %}
72+
{%- if forloop.length > 1 -%}
7373
{% if forloop.first == false %}, {% endif %}
74-
{% if forloop.last and author_array_limit == author_array_size %}and {% endif %}
74+
{%- if forloop.last and author_array_limit == author_array_size %}and {% endif -%}
7575
{% endif %}
76-
{% if author_is_self %}
76+
{%- if author_is_self -%}
7777
<em>
7878
{{- author.first }}
7979
{{ author.last -}}
8080
</em>
81-
{% else %}
82-
{% if coauthor_url %}
81+
{%- else -%}
82+
{%- if coauthor_url -%}
8383
<a href="{{coauthor_url}}">
8484
{{- author.first }}
8585
{{ author.last -}}
8686
</a>
87-
{% else %}
87+
{%- else -%}
8888
{{ author.first }}
8989
{{ author.last }}
9090
{% endif %}
91-
{% endif %}
91+
{%- endif -%}
9292
{% endfor %}
93-
{% assign more_authors = author_array_size | minus: author_array_limit %}
93+
{%- assign more_authors = author_array_size | minus: author_array_limit -%}
9494

95-
{% assign more_authors_hide = more_authors | append: ' more author' %}
95+
{%- assign more_authors_hide = more_authors | append: ' more author' -%}
9696
{% if more_authors > 0 %}
97-
{% if more_authors > 1 %}
97+
{%- if more_authors > 1 -%}
9898
{% assign more_authors_hide = more_authors_hide | append: 's' %}
99-
{% endif %}
99+
{%- endif -%}
100100
{% assign more_authors_show = '' %}
101-
{% for author in entry.author_array offset: author_array_limit %}
101+
{%- for author in entry.author_array offset: author_array_limit -%}
102102
{% assign more_authors_show = more_authors_show | append: author.first | append: ' ' | append: author.last %}
103103
{% unless forloop.last %}
104104
{% assign more_authors_show = more_authors_show | append: ', ' %}
105105
{% endunless %}
106-
{% endfor %}
106+
{%- endfor -%}
107107
, and
108108
<span
109109
class="more-authors"

0 commit comments

Comments
 (0)