Skip to content

Commit 45d36f0

Browse files
committed
Create navbarlink.html
1 parent 1874114 commit 45d36f0

1 file changed

Lines changed: 16 additions & 0 deletions

File tree

‎_includes/navbarlink.html‎

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{% capture before %}{{ include.link[1] | split: "://" | first }}{% endcapture %}
2+
{% capture after %}{{ include.link[1] | split: "://" | last }}{% endcapture %}
3+
{% assign internal = true %}
4+
{% if before != after %}
5+
{% if before == "http" or before == "https" %}
6+
{% assign internal = false %}
7+
{% endif %}
8+
{% endif %}
9+
10+
{% if internal %}
11+
{% capture linkurl %}{{ site.baseurl }}/{{ include.link[1] }}{% endcapture %}
12+
{% else %}
13+
{% capture linkurl %}{{ include.link[1] }}{% endcapture %}
14+
{% endif %}
15+
16+
<a href="{{ linkurl }}">{{ include.link[0] }}</a>

0 commit comments

Comments
 (0)