diff options
-rw-r--r-- | _layouts/page.html | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/_layouts/page.html b/_layouts/page.html index b753f54b7..23be68e6e 100644 --- a/_layouts/page.html +++ b/_layouts/page.html @@ -4,7 +4,7 @@ layout: default <div class="page-wrapper"> <div class="page"> {% capture url_parts %} {{ page.url | remove: "/index.html" | replace:'/'," " }}{% endcapture %} - {% capture num_parts %}{{ url_parts | number_of_words | minus: 1 }}{% endcapture %} + {% assign parts = url_parts | split: ' ' %} {% assign previous="" %} <ul class="breadcrumb"> {% if num_parts == "-1" %} @@ -12,12 +12,15 @@ layout: default <li><a href="/">Home</a></li> {% else %} <li><a href="/">Home</a></li> - {% for unused in page.content limit:num_parts %} - {% capture first_word %}{{ url_parts | truncatewords:1 | remove:"..."}}{% endcapture %} - {% capture previous %}{{ previous }}/{{ first_word }}{% endcapture %} - <li><a href="{{ previous }}/">{{ first_word | capitalize }}</a></li> - {% capture url_parts %}{{ url_parts | remove_first:first_word }}{% endcapture %} - {% endfor %} + {% if page.slug == null %} + {% for part in parts %} + {% capture previous %}{{ previous }}/{{ part }}{% endcapture %} + <li><a href="{{ previous }}/">{{ part | capitalize | replace:'_'," " }}</a></li> + {% capture url_parts %}{{ url_parts | remove_first:part }}{% endcapture %} + {% endfor %} + {% else %} + <li><a href="/blog">Blog</a></li> + {% endif %} {% endif %} </ul> |