forked from drieslab/drieslab2
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlink.html
36 lines (29 loc) · 1.15 KB
/
link.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
{%- assign type = include.type | default: "link" -%}
{%- assign type = site.data.links[type] -%}
{%- assign link = include.link -%}
{%- if type and link -%}
{%- assign icon = include.icon -%}
{%- if icon == "" -%}
{%- assign icon = type.icon -%}
{%- endif -%}
{%- assign text = include.text -%}
{%- if text == "" -%}
{%- assign text = type.text -%}
{%- endif -%}
{%- assign tooltip = include.tooltip -%}
{%- if tooltip == "" -%}
{%- assign tooltip = type.tooltip -%}
{%- endif -%}
{%- assign link = type.link | replace: "$LINK", link -%}
{%- assign flip = include.flip | default: false -%}
<a class="link" href="{{ link | relative_url }}" {% if tooltip %}data-tooltip="{{ tooltip }}"{% endif %} {% if icon %}data-icon="true"{% endif %} {% if text %}data-text="true"{% endif %} {% if flip %}data-flip="true"{% endif %} data-style="{{ include.style | default: '' }}">
{%- if icon contains "fa-" -%}
<i class="{{ icon }} fa-lg {% if text == nil %}fa-fw{% endif %}"></i>
{%- elsif icon -%}
{% include {{ icon }} %}
{%- endif -%}
{%- if text -%}
<span>{{ text }}</span>
{%- endif -%}
</a>
{%- endif -%}