beautifulSA-jekyll/_includes/navbarlink.html

17 lines
571 B
HTML
Raw Normal View History

2016-03-18 11:04:22 +01:00
{% capture before %}{{ include.link[1] | split: "://" | first }}{% endcapture %}
{% capture after %}{{ include.link[1] | split: "://" | last }}{% endcapture %}
{% assign internal = true %}
{% if before != after %}
{% if before == "http" or before == "https" %}
{% assign internal = false %}
{% endif %}
{% endif %}
{% if internal %}
{% capture linkurl %}{{ site.baseurl }}/{{ include.link[1] }}{% endcapture %}
{% else %}
{% capture linkurl %}{{ include.link[1] }}{% endcapture %}
{% endif %}
<a href="{{ linkurl }}">{{ include.link[0] }}</a>