-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathlist_publications.html
74 lines (73 loc) · 3.96 KB
/
list_publications.html
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
<!-- First, we'll loop over the types of publications, creating a header for each
and listing out all publications that are of that type. -->
{% for pub_type in site.data.publications.publication_types %}
<!-- Filter the list of publications down to just those that are of this type. -->
{% assign pubs = site.data.publications.publications | where: "type",pub_type.type_id | sort: "year" | reverse %}
{% assign num_pubs = pubs | size %}
{% if num_pubs == 0 %} {% continue %} {% endif %} <!-- If none exist, move along without making a header for this type. -->
<!-- If we're here, some number of publications of this type exist. Give a header. -->
<!-- The below nonsense lets me give an include argument to specify the heading level for
publication category headings. -->
<h{% if include.header_level %}{{include.header_level}}{% else %}2{% endif %}>
{{ pub_type.pretty }}
</h{% if include.header_level %}{{include.header_level}}{% else %}2{% endif %}>
{% if pub_type.overview %}{{ pub_type.overview | markdownify }} {% endif %}
<ul class="fa-ul"> <!-- We'll use font awesome's unordered list (where fa icons are easily used as bullets) to list publications. -->
{% for pub in pubs %}
<li>
{% if pub.venue %}
{% case pub.venue %}
{% when 'book' %}
{{ site.data.icons.venue_book_bullet }}
{% when 'conference' %}
{{ site.data.icons.venue_conference_bullet }}
{% when 'workshop' %}
{{ site.data.icons.venue_workshop_bullet }}
{% when 'journal' %}
{{ site.data.icons.venue_journal_bullet }}
{% when 'preprint' %}
{{ site.data.icons.venue_preprint_bullet }}
{% else %}
{{ site.data.icons.venue_unknown_bullet }}
{% endcase %}
{% else %}
{{ site.data.icons.venue_unknown_bullet }}
{% endif %}
<p>
<!-- | remove: '<p>' | remove: '</p>' | is a hacky solution to remove <p></p> tags that markdownify surrounds things with. -->
{{ pub.citation | markdownify | remove: '<p>' | remove: '</p>' | replace: "Alexander Lalejini", "<b>Alexander Lalejini</b>" }}
<br/>
{% for badge in pub.badges %}
<span class="badge badge-primary"> {{ badge }} </span>
{% endfor %}
{% if pub.pdf %} <a href="{{ pub.pdf | relative_url }}"> {{ site.data.icons.pdf_icon }}</a> {% endif %}
{% if pub.bibtex %}
<a href="#" data-toggle="modal" data-target="#{{ pub.bibtex_id }}">{{ site.data.icons.bibtex_icon }}</a>
{% endif %}
{% if pub.github_repository_link %}<a href="{{ pub.github_repository_link }}">{{ site.data.icons.github_repository_icon }}</a> {% endif %}
{% if pub.presentation_link %}<a href="{{ pub.presentation_link }}">{{ site.data.icons.presentation_icon }}</a> {% endif %}
</p>
</li>
{% if pub.bibtex %}
<div class="modal fade" id="{{ pub.bibtex_id }}" tabindex="-1" role="dialog" aria-labelledby="{{ pub.bibtex_id }}-label" aria-hidden="true">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="{{pub.bibtex_id}}-label">Cite</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<div class="modal-body">
{{ pub.bibtex | markdownify }}
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
</div>
</div>
</div>
</div>
{% endif %}
{% endfor %}
</ul>
{% endfor %}