Commit 1f0e861f authored by Martin Bieder's avatar Martin Bieder

Breadcrumb in Posts

parent 709f897d
{% capture url_parts %}
{{ page.url | remove: "/index.html" | replace:'/'," " }}
{% endcapture %}
{% capture num_parts %}
{{ url_parts | number_of_words | minus: 1 }}
{% endcapture %}
{% assign previous="" %}
<ol class="breadcrumb">
{% if num_parts == "0" or num_parts == "-1" %}
<li>
<a href="{{ site.baseurl }}/">Home</a>
</li>
{% else %}
<li>
<a href="{{ site.baseurl }}/">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="{{ site.baseurl }}{{previous}}">{{ first_word | capitalize }}</a>
</li>
{% capture url_parts %}{{ url_parts | remove_first:first_word }}{% endcapture %}
{% endfor %}
{% endif %}
<li class="active">{{ page.title }}</li>
</ol>
......@@ -11,6 +11,7 @@
<div class="container">
<div class="row">
<div class="col-lg-10 col-lg-offset-1">
{% include post-breadcrumb.html %}
{{ content }}
</div>
</div>
......
......@@ -2,6 +2,11 @@ html {
overflow-y: scroll;
}
.breadcrumb {
margin-top: -30px;
margin-bottom: 30px;
}
.small-header {
margin-bottom: 50px;
padding: 110px 0 60px 0;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment