{% assign string = link | replace_first: "http", "" %} {% if link == string %} {% assign link = string | absolute_url %} {% endif %}