beautifulSA-jekyll/_includes/navbarlink.html
Abel Cheung 7b43e4061d Fix showing background img with non-empty baseurl (#497)
* Fix showing background img with non-empty baseurl

Also switch globally to relative_url for all baseurl prepends,
which is more robust than custom URL mangling

* More site.baseurl -> relative_url conversion
2019-06-08 01:34:33 -04:00

17 lines
553 B
HTML

{% 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 %}{{ include.link[1] | relative_url }}{% endcapture %}
{% else %}
{% capture linkurl %}{{ include.link[1] }}{% endcapture %}
{% endif %}
<a href="{{ linkurl }}">{{ include.link[0] }}</a>