forked from jitka/jekyll-theme-pirati
-
Notifications
You must be signed in to change notification settings - Fork 17
/
profile-badge.html
70 lines (65 loc) · 2.97 KB
/
profile-badge.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
{% capture label %}
{% if include.label %}{{ include.label }}{% elsif include.item.name %}{{ include.item.name }}{% else %}{{ include.item.title }}{% endif %}
{% endcapture %}
{% if include.item.url %}
{% if include.item.url contains 'http' %}
{% assign url = include.item.url %}
{% else %}
{% assign url = include.item.url | relative_url %}
{% endif %}
{% endif %}
{% capture avatarClass %}
badge__avatar {% if include.avatarClass %}{{ include.avatarClass }}{% else %}avatar--sm{% endif %}
{% endcapture %}
<div class="badge {% if include.class %}{{ include.class }}{% endif %}">
{% unless include.hideAvatar %}
{%- if include.item.img -%}
{% if site.mediaStorage %}
{%- if include.imgSize != 'big' -%}
{% capture img %}https://a.pirati.cz/crop/100x100/{{ site.mediaStorage }}/img/{{ include.item.img }}{% endcapture %}
{%- else -%}
{% capture img %}https://a.pirati.cz/crop/165x165/{{ site.mediaStorage }}/img/{{ include.item.img }}{% endcapture %}
{%- endif -%}
{%- else -%}
{%- if include.imgSize != 'big' -%}
{% capture img %}{% asset '{{ include.item.img }}' magick:resize='100x100^' magick:gravity='center' magick:crop='100x100+0+0' @path %}{% endcapture %}
{%- else -%}
{% capture img %}{% asset '{{ include.item.img }}' magick:resize='165x165^' magick:gravity='center' magick:crop='165x165+0+0' @path %}{% endcapture %}
{%- endif -%}
{%- endif -%}
{% else %}
{% capture img %}https://a.pirati.cz/common/img/people/unknown-pirate.svg{% endcapture %}
{% endif %}
{% include avatar.html src=img alt=label class=avatarClass url=url %}
{% endunless %}
<div class="badge__body">
<h2 class="{% if include.headlineClass %}{{ include.headlineClass }}{% else %}head-heavy-2xs{% endif %} badge__title">
{% if url %}
<a href="{{ url }}" title="{{ label }}" class="content-block--nostyle">{{ label }}</a>
{% else %}
{{ label }}
{% endif %}
</h2>
{% unless include.showDescription == false %}
<p class="badge__occupation">
{% if include.description %}
{{ include.description }}
{% else %}
{{ include.item.description }}
{% endif %}
</p>
{% endunless %}
{% unless include.showContactInfo == false %}
{% if include.item.mob or include.item.mail %}
{% if include.item.mob %}
{% capture tel %}tel:{{ include.item.mob }}{% endcapture %}
{% include contact-line.html icon="ico--phone" href=tel caption=include.item.mob class="contact-line--responsive badge__link" %}
{% endif %}
{% if include.item.mail %}
{% capture mailto %}mailto:{{ include.item.mail }}{% endcapture %}
{% include contact-line.html icon="ico--envelope" href=mailto caption=include.item.mail class="contact-line--responsive badge__link" %}
{% endif %}
{% endif %}
{% endunless %}
</div>
</div>