-
Notifications
You must be signed in to change notification settings - Fork 18
/
Copy pathnews-item.html
54 lines (48 loc) · 1.47 KB
/
news-item.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
{% assign item = include.item %}
{% if item.icon %}
{% assign icon = item.icon %}
{% assign class = "shortnews" %}
{% else %}
{% assign icon = "newspaper-o" %}
{% endif %}
{% capture news %}
<div>
{% if post.shortnews %}
{{ post.content | markdownify | remove: '<p>' | remove: '</p>' }}
{% else %}
<h5> <a href="{{ site.baseurl }}{{ post.url }}"> {{ post.title }} </a> </h5>
{{ post.excerpt | markdownify | remove: '<p>' | remove: '</p>' }}
<br>
<a href="{{ site.baseurl }}{{ post.url }}"> Read more »</a>
{% endif %}
</div>
{% endcapture %}
{% capture header %}
<span class="fa fa-fw fa-{{ icon }}"></span>
<span class="date">{{ post.date | date: '%B %d, %Y' }}</span>
{% endcapture %}
<li class="{{ class }}">
{% if post.image %}
{% capture img %}
<img class="img-fluid d-block mx-auto"
style="{{ post.image_style }}"
src="{{ post.image }}">
{% endcapture %}
<div class="row">
<div class="col-sm-10">
{{ header }}
{{ news }}
</div>
<div class="col-sm-2">
{% if post.image_link %}
<a href="{{ post.image_link }}">{{ img }}</a>
{% else %}
{{ img }}
{% endif %}
</div>
</div>
{% else %}
{{ header }}
{{ news }}
{% endif %}
</li>