{% macro genurl(string, force=False) %} {% if (force or ( string.startswith('/') and not string.startswith('//') )) %} {% set url = '/'.join([SITEURL.rstrip('/'),string.lstrip('/')]) %} {{- url -}} {% else %} {{- string -}} {% endif %} {% endmacro %}