navbarlink.html 557 B

12345678910111213141516
  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. {% if internal %}
  10. {% capture linkurl %}{{ site.baseurl }}/{{ include.link[1] }}{% endcapture %}
  11. {% else %}
  12. {% capture linkurl %}{{ include.link[1] }}{% endcapture %}
  13. {% endif %}
  14. <a href="{{ linkurl }}">{{ include.link[0] }}</a>