generated from alshedivat/al-folio
-
Notifications
You must be signed in to change notification settings - Fork 0
/
bib.liquid
307 lines (296 loc) · 12.4 KB
/
bib.liquid
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
---
---
<div class="row">
{% if site.enable_publication_thumbnails %}
<div class="col-sm-2 {% if entry.preview %}preview{% else %}abbr{% endif %}">
{% if entry.preview %}
{% if entry.preview contains '://' %}
<img class="preview z-depth-1 rounded" src="{{ entry.preview }}">
{% else %}
{% assign entry_path = entry.preview | prepend: '/assets/img/publication_preview/' %}
{%
include figure.liquid
loading="eager"
path=entry_path
sizes = "200px"
class="preview z-depth-1 rounded"
zoomable=false
alt=entry.preview
%}
{% endif %}
{% elsif entry.abbr %}
{% if site.data.venues[entry.abbr] %}
{% assign venue_style = null %}
{% if site.data.venues[entry.abbr].color != blank %}
{% assign venue_style = site.data.venues[entry.abbr].color | prepend: 'style="background-color:' | append: '"' %}
{% endif %}
<abbr
class="badge"
{% if venue_style %}
{{ venue_style }}
{% endif %}
><a href="{{site.data.venues[entry.abbr].url}}">{{ entry.abbr }}</a></abbr
>
{% else %}
<abbr class="badge">{{ entry.abbr }}</abbr>
{% endif %}
{% endif %}
</div>
{% endif %}
<!-- Entry bib key -->
<div id="{{entry.key}}" class="{% if site.enable_publication_thumbnails %}col-sm-8{% else %}col-sm-10{% endif %}">
<!-- Title -->
<div class="title">{{ entry.title }}</div>
<!-- Author -->
<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 %}
{% endif %}
{%- for author in entry.author_array limit: author_array_limit -%}
{% assign author_is_self = false %}
{%- assign author_last_name = author.last | remove: '¶' | remove: '&' | remove: '*' | remove: '†' | remove: '^' -%}
{% if site.scholar.last_name contains author_last_name %}
{% if site.scholar.first_name contains author.first %}
{% assign author_is_self = true %}
{% endif %}
{%- endif -%}
{% assign coauthor_url = null %}
{%- assign clean_last_name = author_last_name | downcase | remove_accents -%}
{% if site.data.coauthors[clean_last_name] %}
{%- for coauthor in site.data.coauthors[clean_last_name] -%}
{% if coauthor.firstname contains author.first %}
{%- assign coauthor_url = coauthor.url -%}
{% break %}
{% endif %}
{% endfor %}
{%- endif -%}
{%- if forloop.length > 1 -%}
{% if forloop.first == false %}, {% endif %}
{%- if forloop.last and author_array_limit == author_array_size %}and {% endif -%}
{% endif %}
{%- 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.first | append: ' ' | append: author.last %}
{% unless forloop.last %}
{% assign more_authors_show = more_authors_show | append: ', ' %}
{% endunless %}
{%- endfor -%}
, and
<span
class="more-authors"
title="click to view {{more_authors_hide}}"
onclick="
var element = $(this);
element.attr('title', '');
var more_authors_text = element.text() == '{{more_authors_hide}}' ? '{{more_authors_show}}' : '{{more_authors_hide}}';
var cursorPosition = 0;
var textAdder = setInterval(function(){
element.text(more_authors_text.substring(0, cursorPosition + 1));
if (++cursorPosition == more_authors_text.length){
clearInterval(textAdder);
}
}, '{{site.more_authors_animation_delay}}');
"
>
{{- more_authors_hide -}}
</span>
{% endif %}
</div>
<!-- Journal/Book title and date -->
{% assign proceedings = 'inproceedings,incollection' | split: ',' %}
{% assign thesis = 'thesis,mastersthesis,phdthesis' | split: ',' %}
{% if entry.type == 'article' %}
{% capture entrytype %}<em>{{entry.journal}}</em>{% endcapture %}
{% elsif proceedings contains entry.type %}
{% capture entrytype %}<em>In {{entry.booktitle}}</em> {% endcapture %}
{% elsif thesis contains entry.type %}
{% capture entrytype %}<em>{{entry.school}}</em> {% endcapture %}
{% else %}
{% capture entrytype %}{% endcapture %}
{% endif %}
{% if entry.month %}
{% capture entrymonth %}{{ " " }}{{ entry.month | capitalize }}{% endcapture %}
{% endif %}
{% if entry.year %}
{% capture entryyear %}{{ " " }}{{entry.year}}{% endcapture %}
{% endif %}
{% assign entrytype_text = entrytype | strip_html | strip %}
{% capture periodical %}{{ entrytype }}{% if entrytype_text != "" and entryyear != "" %}, {% endif %}{{ entrymonth }}{{ entryyear }}{% endcapture %}
<div class="periodical">
{{ periodical | strip }}
</div>
<div class="periodical">
{{ entry.note | strip }}
</div>
<!-- Links/Buttons -->
<div class="links">
{% if entry.award %}
<a class="award btn btn-sm z-depth-0" role="button">{{ entry.award_name ? entry.award_name : "Awarded" }}</a>
{% endif %}
{% if entry.abstract %}
<a class="abstract btn btn-sm z-depth-0" role="button">Abs</a>
{% endif %}
{% if entry.arxiv %}
<a href="http://arxiv.org/abs/{{ entry.arxiv }}" class="btn btn-sm z-depth-0" role="button">arXiv</a>
{% endif %}
{% if entry.bibtex_show %}
<a class="bibtex btn btn-sm z-depth-0" role="button">Bib</a>
{% endif %}
{% if entry.html %}
{% if entry.html contains '://' %}
<a href="{{ entry.html }}" class="btn btn-sm z-depth-0" role="button">HTML</a>
{% else %}
<a href="{{ entry.html | prepend: '/assets/html/' | relative_url }}" class="btn btn-sm z-depth-0" role="button">HTML</a>
{% endif %}
{% endif %}
{% if entry.pdf %}
{% if entry.pdf contains '://' %}
<a href="{{ entry.pdf }}" class="btn btn-sm z-depth-0" role="button">PDF</a>
{% else %}
<a href="{{ entry.pdf | prepend: '/assets/pdf/' | relative_url }}" class="btn btn-sm z-depth-0" role="button">PDF</a>
{% endif %}
{% endif %}
{% if entry.supp %}
{% if entry.supp contains '://' %}
<a href="{{ entry.supp }}" class="btn btn-sm z-depth-0" role="button">Supp</a>
{% else %}
<a href="{{ entry.supp | prepend: '/assets/pdf/' | relative_url }}" class="btn btn-sm z-depth-0" role="button">Supp</a>
{% endif %}
{% endif %}
{% if entry.video %}
<a class="abstract btn btn-sm z-depth-0" role="button">Video</a>
{% endif %}
{% if entry.blog %}
<a href="{{ entry.blog }}" class="btn btn-sm z-depth-0" role="button">Blog</a>
{% endif %}
{% if entry.code %}
<a href="{{ entry.code }}" class="btn btn-sm z-depth-0" role="button">Code</a>
{% endif %}
{% if entry.poster %}
{% if entry.poster contains '://' %}
<a href="{{ entry.poster }}" class="btn btn-sm z-depth-0" role="button">Poster</a>
{% else %}
<a href="{{ entry.poster | prepend: '/assets/pdf/' | relative_url }}" class="btn btn-sm z-depth-0" role="button">Poster</a>
{% endif %}
{% endif %}
{% if entry.slides %}
{% if entry.slides contains '://' %}
<a href="{{ entry.slides }}" class="btn btn-sm z-depth-0" role="button">Slides</a>
{% else %}
<a href="{{ entry.slides | prepend: '/assets/pdf/' | relative_url }}" class="btn btn-sm z-depth-0" role="button">Slides</a>
{% endif %}
{% endif %}
{% if entry.website %}
<a href="{{ entry.website }}" class="btn btn-sm z-depth-0" role="button">Website</a>
{% endif %}
</div>
{% if site.enable_publication_badges %}
{% assign entry_has_altmetric_badge = entry.altmetric or entry.doi or entry.eprint or entry.pmid or entry.isbn %}
{% assign entry_has_dimensions_badge = entry.dimensions or entry.doi or entry.pmid %}
{% assign entry_has_google_scholar_badge = entry.google_scholar_id %}
{% if entry_has_altmetric_badge or entry_has_dimensions_badge or entry_has_google_scholar_badge %}
<div class="badges">
{% if site.enable_publication_badges.altmetric and entry_has_altmetric_badge %}
<span
class="altmetric-embed"
data-hide-no-mentions="true"
data-hide-less-than="15"
data-badge-type="2"
data-badge-popover="right"
{% if entry.eprint %}
data-arxiv-id="{{ entry.eprint }}"
{% elsif entry.doi %}
data-doi="{{ entry.doi }}"
{% elsif entry.altmetric %}
data-altmetric-id="{{ entry.altmetric }}"
{% elsif entry.pmid %}
data-pmid="{{ entry.pmid }}"
{% elsif entry.isbn %}
data-isbn="{{ entry.isbn }}"
{% endif %}
></span>
{% endif %}
{% if site.enable_publication_badges.dimensions and entry_has_dimensions_badge %}
<span
class="__dimensions_badge_embed__"
{% if entry.doi %}
data-doi="{{ entry.doi }}"
{% else %}
data-pmid="{{ entry.pmid }}"
{% else %}
data-id="{{ entry.dimensions }}"
{% endif %}
data-hide-zero-citations="true"
data-style="small_rectangle"
data-legend="hover-right"
style="margin-bottom: 3px;"
></span>
{% endif %}
{% if site.enable_publication_badges.google_scholar and entry_has_google_scholar_badge %}
<a
href="https://scholar.google.com/citations?view_op=view_citation&hl=en&user={{ site.scholar_userid }}&citation_for_view={{ site.scholar_userid }}:{{ entry.google_scholar_id }}"
aria-label="Google Scholar link"
role="button"
>
<img
src="https://img.shields.io/badge/scholar-{% google_scholar_citations site.scholar_userid entry.google_scholar_id %}-4285F4?logo=googlescholar&labelColor=beige"
alt="{% google_scholar_citations site.scholar_userid entry.google_scholar_id %} Google Scholar citations"
>
</a>
{% endif %}
</div>
{% endif %}
{% endif %}
{% if entry.award %}
<!-- Hidden Award block -->
<div class="award hidden d-print-inline">
<p>{{ entry.award | markdownify }}</p>
</div>
{% endif %}
{% if entry.abstract %}
<!-- Hidden abstract block -->
<div class="abstract hidden">
<p>{{ entry.abstract }}</p>
</div>
{% endif %}
{% if entry.bibtex_show %}
<!-- Hidden bibtex block -->
<div class="bibtex hidden">
{% highlight bibtex %}
{{- entry.bibtex | hideCustomBibtex -}}
{% endhighlight %}
</div>
{% endif %}
{% if entry.video %}
<!-- Hidden video block -->
<div class="abstract hidden">
<div style="text-align: center;">{% include video.liquid path=entry.video class="img-fluid rounded z-depth-1" controls=true %}</div>
</div>
{% endif %}
</div>
</div>