-
Notifications
You must be signed in to change notification settings - Fork 75
Expand file tree
/
Copy pathblog-post-card.html
More file actions
55 lines (47 loc) · 1.88 KB
/
Copy pathblog-post-card.html
File metadata and controls
55 lines (47 loc) · 1.88 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
{% assign card_classes = "" %}
{% if post.tags contains 'announcement' %}
{% assign card_classes = card_classes | append: " is-announcement" %}
{% endif %}
{% if post.tags contains 'highlight' %}
{% assign card_classes = card_classes | append: " is-highlight" %}
{% endif %}
<div class="well filter-item {{ card_classes }}" data-tags="{{ post.tags | join: ',' }}">
<div class="post-content">
<h3><a href="{{ post.url | prepend: site.baseurl }}">{{ post.title }}</a></h3>
<p>
{% if post.author %}
{% for author_name in post.author %}
{% assign author = site.data.contributors | where: "name", author_name | first %}
<span class="author-link">
<img src="{% if author.photo %}{{ site.baseurl }}/images/team/{{ author.photo }}{% else %}{{ site.baseurl }}/images/team/defaultDP.png{% endif %}" class="author-image" />
{{ author_name }}
</span>
{% endfor %}
{% endif %}
<span class="text-muted">• {{ post.date | date: "%b %d, %Y" }}</span>
</p>
<p>{{ post.excerpt | strip_html | truncatewords: 40 }}</p>
<div class="post-tags" markdown="0">
{% for tag in post.tags %}
<span class="tag-badge" onclick="applyTagFilter('{{ tag }}')">#{{ tag }}</span>
{% endfor %}
</div>
</div>
{% assign thumbnail_src = nil %}
{% if post.thumbnail_image %}
{% assign thumbnail_src = post.thumbnail_image %}
{% elsif post.banner_image %}
{% if post.banner_image contains 'gsoc-banner.png' %}
{% assign thumbnail_src = "/images/gsoc-logo.svg" %}
{% else %}
{% assign thumbnail_src = post.banner_image %}
{% endif %}
{% endif %}
{% if thumbnail_src %}
<div class="thumbnail-container">
<a href="{{ post.url | prepend: site.baseurl }}">
<img src="{{ thumbnail_src }}" alt="Thumbnail" class="thumbnail-image" />
</a>
</div>
{% endif %}
</div>