From 45d36f06d89302e26ad42441aaf90e50133340d2 Mon Sep 17 00:00:00 2001 From: Dean Attali Date: Fri, 18 Mar 2016 03:04:22 -0700 Subject: [PATCH] Create navbarlink.html --- _includes/navbarlink.html | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 _includes/navbarlink.html diff --git a/_includes/navbarlink.html b/_includes/navbarlink.html new file mode 100644 index 0000000..5a94a2d --- /dev/null +++ b/_includes/navbarlink.html @@ -0,0 +1,16 @@ +{% 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 %} + +{{ include.link[0] }}