diff --git a/sitemap1.md b/sitemap1.md
index 65e6ff0b6..3224a4bd3 100644
--- a/sitemap1.md
+++ b/sitemap1.md
@@ -31,9 +31,13 @@ title: Site map
{% for num in (1..levels_back) %}
{% endfor %}
- {% for dir in path offset:levels_match %}
-
{{ dir }}
- {% endfor %}
+ {% if levels_match > 0 %}
+ {% for dir in path offset:levels_match %}
+ {{ dir }}
+ {% endfor %}
+ {% else %}
+ {{ dir }}
+ {% endif %}
{{ page.dir }} back:{{ levels_back }}, match:{{ levels_match }}
{% assign prev_page_dir = page.dir %}
{% endunless %}