{% assign dir_parts = page.dir | remove_first: "/" | split: "/" %} {% if dir_parts.size > 0 and dir_parts[0] != "" %} {% endif %} {{ content }}