-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcard_list.html
More file actions
97 lines (88 loc) · 3.29 KB
/
Copy pathcard_list.html
File metadata and controls
97 lines (88 loc) · 3.29 KB
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
<ul class="card-grid">
{% for item in include.collection %}
{% assign item_url = item.url | strip %}
{% assign has_url = false %}
{% if item_url != "" and item_url != "false" and item.url != false %}
{% assign has_url = true %}
{% endif %}
{% assign category = item.category | default: item.highlight %}
{% assign stars = item.stars | plus: 0 %}
{% if stars > 5 %}{% assign stars = 5 %}{% endif %}
{% if stars < 0 %}{% assign stars = 0 %}{% endif %}
{% case item.track %}
{% when "pro", "professional" %}
{% assign track_label = "Professional" %}
{% assign track_class = "tag-track-pro" %}
{% when "hobby", "amateur" %}
{% assign track_label = "Hobby" %}
{% assign track_class = "tag-track-hobby" %}
{% else %}
{% assign track_label = item.track %}
{% assign track_class = "tag-track" %}
{% endcase %}
{% case item.context %}
{% when "work", "applied" %}
{% assign context_label = "Work/Applied" %}
{% assign context_class = "tag-context-work" %}
{% when "academic", "research" %}
{% assign context_label = "Academic" %}
{% assign context_class = "tag-context-academic" %}
{% when "both" %}
{% assign context_label = "Work & Academic" %}
{% assign context_class = "tag-context-both" %}
{% else %}
{% assign context_label = item.context %}
{% assign context_class = "tag-context" %}
{% endcase %}
<li class="card{% unless has_url %} card-static{% endunless %}">
{% if has_url %}
<a class="card-link" href="{{ item_url }}">
{% else %}
<div class="card-link card-link-static">
{% endif %}
<div class="card-top">
<span class="header">{{ item.title }}</span>
{% if item.time %}
<time class="card-time" datetime="{{ item.time }}">{{ item.time }}</time>
{% endif %}
</div>
{% if stars > 0 or category or item.track or item.context or item.tags %}
<div class="card-meta">
{% if stars > 0 %}
<span class="card-stars" aria-label="Rating {{ stars }} / 5" title="Rating {{ stars }} / 5">
{% for i in (1..5) %}
<span class="star{% if i <= stars %} star-on{% endif %}" aria-hidden="true">★</span>
{% endfor %}
</span>
{% endif %}
<div class="card-tags">
{% if category %}
<span class="chip chip-category">{{ category }}</span>
{% endif %}
{% if item.track and track_label %}
<span class="chip {{ track_class }}">{{ track_label }}</span>
{% endif %}
{% if item.context and context_label %}
<span class="chip {{ context_class }}">{{ context_label }}</span>
{% endif %}
{% if item.tags %}
{% for tag in item.tags %}
<span class="chip chip-extra">{{ tag }}</span>
{% endfor %}
{% endif %}
</div>
</div>
{% endif %}
{% if item.desc and item.desc != false %}
<p class="body">
{{ item.desc }}
</p>
{% endif %}
{% if has_url %}
</a>
{% else %}
</div>
{% endif %}
</li>
{% endfor %}
</ul>