forked from yousinix/portfolYOU
-
Notifications
You must be signed in to change notification settings - Fork 0
/
post-card.html
49 lines (46 loc) · 1.65 KB
/
post-card.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
{%- comment -%} Default Styles {%- endcomment -%}
{%- assign card_style = '' -%}
{%- assign text_style = 'text-dark' -%}
{%- assign badge_style = 'badge-dark' -%}
{%- comment -%} Update Styles {%- endcomment -%}
{%- if post.style == 'fill' -%}
{%- assign card_style = post.color | prepend: 'bg-' -%}
{%- if post.color != 'light' -%}
{%- assign text_style = 'text-white' -%}
{%- assign badge_style = 'badge-light text-' -%}
{%- assign badge_style = badge_style | append: post.color -%}
{%- endif -%}
{%- else -%}
{%- assign card_style = post.color | prepend: 'border border-' -%}
{%- if post.color -%}
{%- assign badge_style = post.color | prepend: 'badge-' -%}
{%- endif -%}
{%- endif -%}
{%- comment -%} Determine Post URL {%- endcomment -%}
{%- if post.external_url -%}
{%- assign post_url = post.external_url -%}
{%- else -%}
{%- assign post_url = post.url | relative_url -%}
{%- endif -%}
<div class="col-lg-6 my-3 wow animated fadeIn" data-wow-delay=".15s">
<a href="{{ post_url }}" class="post card {{ card_style }}">
<div class="card-body {{ text_style }}">
<h3 class="card-title">{{ post.title }}</h3>
<p class="card-text">
{% for tag in post.tags %}
<span class="badge {{ badge_style }}">{{ tag }}</span>
{% endfor %}
</p>
<p class="card-text">
{%- if post.description -%}
{{ post.description }}
{%- else -%}
{{ post.content | truncatewords: 25, "<small><i> read more...</i></small>" }}
{%- endif -%}
</p>
</div>
<div class="card-footer {{ text_style }}">
{{ post.date | date_to_long_string }}
</div>
</a>
</div>