|
29 | 29 | <div class="author">
|
30 | 30 | {% assign author_array_size = entry.author_array | size %}
|
31 | 31 |
|
| 32 | + {% assign author_array_limit = author_array_size %} |
32 | 33 | {%- if site.max_author_limit and author_array_size > site.max_author_limit %}
|
33 | 34 | {% assign author_array_limit = site.max_author_limit %}
|
34 |
| - {% else %} |
35 |
| - {% assign author_array_limit = author_array_size %} |
36 | 35 | {% endif %}
|
37 | 36 |
|
38 | 37 | {%- for author in entry.author_array limit: author_array_limit -%}
|
39 | 38 | {%- assign author_is_self = false -%}
|
40 |
| - {%- if author.last == site.scholar.last_name %} |
| 39 | + {%- assign author_last_name = author.last | remove: "¶" | remove: "&" | remove: "*" | remove: "†" | remove: "^" -%} |
| 40 | + {%- if author_last_name == site.scholar.last_name -%} |
41 | 41 | {%- if site.scholar.first_name contains author.first -%}
|
42 | 42 | {%- assign author_is_self = true -%}
|
43 | 43 | {%- endif -%}
|
44 | 44 | {%- endif -%}
|
45 | 45 | {%- assign coauthor_url = nil -%}
|
46 |
| - {%- if site.data.coauthors[author.last] -%} |
47 |
| - {%- for coauthor in site.data.coauthors[author.last] -%} |
| 46 | + {%- if site.data.coauthors[author_last_name] -%} |
| 47 | + {%- for coauthor in site.data.coauthors[author_last_name] -%} |
48 | 48 | {%- if coauthor.firstname contains author.first -%}
|
49 | 49 | {%- assign coauthor_url = coauthor.url -%}
|
50 | 50 | {%- break -%}
|
51 | 51 | {%- endif -%}
|
52 | 52 | {%- endfor -%}
|
53 | 53 | {%- endif -%}
|
54 | 54 |
|
55 |
| - {%- if forloop.length == 1 -%} |
56 |
| - {%- if author_is_self %} |
57 |
| - <em>{{author.last}}, {{author.first}}</em> |
58 |
| - {%- else -%} |
59 |
| - {{author.last}}, {{author.first}} |
60 |
| - {%- endif -%} |
| 55 | + {%- if forloop.length > 1 -%} |
| 56 | + {%- if forloop.first == false -%}, {%- endif -%} |
| 57 | + {%- if forloop.last and author_array_limit == author_array_size -%}and {%- endif -%} |
| 58 | + {%- endif -%} |
| 59 | + {%- if author_is_self -%} |
| 60 | + <em>{{author.first}} {{author.last}}</em> |
61 | 61 | {%- else -%}
|
62 |
| - {%- unless forloop.last -%} |
63 |
| - {% if author_is_self %} |
64 |
| - <em>{{author.last}}, {{author.first}}</em>, |
65 |
| - {%- else -%} |
66 |
| - {% if coauthor_url -%} |
67 |
| - <a href="{{coauthor_url}}">{{author.last}}, {{author.first}}</a>, |
68 |
| - {%- else -%} |
69 |
| - {{author.last}}, {{author.first}}, |
70 |
| - {%- endif -%} |
71 |
| - {%- endif -%} |
| 62 | + {%- if coauthor_url -%} |
| 63 | + <a href="{{coauthor_url}}">{{author.first}} {{author.last}}</a> |
72 | 64 | {%- else -%}
|
73 |
| - {%- if author_array_limit == author_array_size %} and {% endif %} |
74 |
| - {% if author_is_self -%} |
75 |
| - <em>{{author.last}}, {{author.first}}</em> |
76 |
| - {% else -%} |
77 |
| - {%- if coauthor_url -%} |
78 |
| - <a href="{{coauthor_url}}">{{author.last}}, {{author.first}}</a> |
79 |
| - {% else -%} |
80 |
| - {{author.last}}, {{author.first}} |
81 |
| - {%- endif -%} |
82 |
| - {%- endif -%} |
83 |
| - {%- endunless -%} |
| 65 | + {{author.first}} {{author.last}} |
| 66 | + {%- endif -%} |
84 | 67 | {%- endif -%}
|
85 |
| - {%- endfor %} |
86 |
| - |
87 |
| - {% assign more_authors = author_array_size | minus: author_array_limit %} |
88 |
| - |
89 |
| - {%- if more_authors > 0 %} |
90 |
| - {% assign more_authors_hide = more_authors | append: " more author" %} |
91 |
| - {% if more_authors > 1 %} |
92 |
| - {% assign more_authors_hide = more_authors_hide | append: "s" %} |
93 |
| - {% endif %} |
94 |
| - {% assign more_authors_show = '' %} |
| 68 | + {%- endfor -%} |
| 69 | + {%- assign more_authors = author_array_size | minus: author_array_limit -%} |
| 70 | + |
| 71 | + {%- assign more_authors_hide = more_authors | append: " more author" -%} |
| 72 | + {%- if more_authors > 0 -%} |
| 73 | + {%- if more_authors > 1 -%} |
| 74 | + {%- assign more_authors_hide = more_authors_hide | append: "s" -%} |
| 75 | + {%- endif -%} |
| 76 | + {%- assign more_authors_show = '' -%} |
95 | 77 | {%- for author in entry.author_array offset: author_array_limit -%}
|
96 |
| - {% assign more_authors_show = more_authors_show | append: author.last | append: ", " | append: author.first %} |
97 |
| - {% unless forloop.last %} |
98 |
| - {% assign more_authors_show = more_authors_show | append: ", " %} |
99 |
| - {% endunless %} |
| 78 | + {%- assign more_authors_show = more_authors_show | append: author.first | append: " " | append: author.last -%} |
| 79 | + {%- unless forloop.last -%} |
| 80 | + {%- assign more_authors_show = more_authors_show | append: ", " -%} |
| 81 | + {%- endunless -%} |
100 | 82 | {%- endfor -%}
|
101 |
| - and |
| 83 | + , and |
102 | 84 | <span
|
103 | 85 | class="more-authors"
|
104 | 86 | title="click to view {{more_authors_hide}}"
|
|
112 | 94 | if (++cursorPosition == more_authors_text.length){
|
113 | 95 | clearInterval(textAdder);
|
114 | 96 | }
|
115 |
| - }, 15); |
| 97 | + }, '{{site.more_authors_animation_delay}}'); |
116 | 98 | "
|
117 | 99 | >{{more_authors_hide}}</span>
|
118 |
| - {% endif %} |
| 100 | + {%- endif -%} |
119 | 101 |
|
120 | 102 | </div>
|
121 | 103 |
|
|
0 commit comments