Created
January 20, 2016 11:51
-
-
Save xupyprmv/6540ee0ad741d21b9573 to your computer and use it in GitHub Desktop.
Revisions
-
kasperisager revised this gist
Mar 9, 2014 . 1 changed file with 2 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,3 +1,4 @@ {% capture html %} <ul> {% if include.context == "/" %} <li class="{% if page.url == "/" %}active{% endif %}"> @@ -20,3 +21,4 @@ {% endfor %} </ul> {% endcapture %}{{ html | strip_newlines | replace:' ','' | replace:' ','' | replace:' ',' ' }} -
kasperisager revised this gist
Mar 9, 2014 . 1 changed file with 1 addition and 3 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -14,9 +14,7 @@ {% if current == include.context %} <li class="{% if page.url contains entry.url %}active{% endif %}"> <a href="{{ site.baseurl }}{{ entry.url }}">{{ entry.title }}</a> {% include navigation.html context=entry.url %} </li> {% endif %} -
kasperisager revised this gist
Mar 9, 2014 . 1 changed file with 6 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,4 +1,10 @@ <ul> {% if include.context == "/" %} <li class="{% if page.url == "/" %}active{% endif %}"> <a href="{{ site.baseurl }}/">{{ site.title }}</a> </li> {% endif %} {% assign entries = site.pages | sort: "path" %} {% for entry in entries %} @@ -16,4 +22,3 @@ {% endfor %} </ul> -
kasperisager revised this gist
Mar 8, 2014 . 1 changed file with 0 additions and 21 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,21 +0,0 @@ -
kasperisager revised this gist
Mar 8, 2014 . 1 changed file with 2 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,5 +1,6 @@ <ul> {% assign entries = site.pages | sort: "path" %} {% for entry in entries %} {% capture slug %}{{ entry.url | split: "/" | last }}{% endcapture %} {% capture current %}{{ entry.url | remove: slug | remove: "//" | append: "/" }}{% endcapture %} -
kasperisager revised this gist
Mar 8, 2014 . 1 changed file with 17 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,5 +1,21 @@ A simple nested page navigation list for Jekyll that highlights the currently active tree. #### Usage ``` {% include navigation.html context="[top-level-path]" %} ``` If you wanted to list all pages starting with the root, you'd do: ``` {% include navigation.html context="/" %} ``` If you instead wanted to list everything beneath `/foo/bar`, you'd do: ``` {% include navigation.html context="/foo/bar/" %} ``` To stop looking for children, and therefore avoid creating an empty `<ul>` if none exists, add `children: false` to your page's Front Matter. -
kasperisager revised this gist
Mar 8, 2014 . 1 changed file with 6 additions and 3 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -5,11 +5,14 @@ {% capture current %}{{ entry.url | remove: slug | remove: "//" | append: "/" }}{% endcapture %} {% if current == include.context %} <li class="{% if page.url contains entry.url %}active{% endif %}"> <a href="{{ site.baseurl }}{{ entry.url }}">{{ entry.title }}</a> {% if entry.children != false %} {% include navigation.html context=entry.url %} {% endif %} </li> {% endif %} {% endfor %} </ul> -
kasperisager revised this gist
Mar 7, 2014 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -7,7 +7,7 @@ {% if current == include.context %} <li> <a href="{{ entry.url }}" class="{% if page.url == entry.url %}active{% endif %}">{{ entry.title }}</a> {% include navigation.html context=entry.url %} </li> {% endif %} -
kasperisager revised this gist
Mar 7, 2014 . 1 changed file with 0 additions and 4 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -3,7 +3,3 @@ ``` {% include navigation.html context="[top-level-path]" %} ``` -
kasperisager revised this gist
Mar 7, 2014 . 1 changed file with 11 additions and 11 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,15 +1,15 @@ <ul> {% for entry in site.pages %} {% capture slug %}{{ entry.url | split: "/" | last }}{% endcapture %} {% capture current %}{{ entry.url | remove: slug | remove: "//" | append: "/" }}{% endcapture %} {% if current == include.context %} <li> <a href="{{ entry.url }}" class="{% if page.url == entry.url %}active{% endif %}">{{ entry.title }}</a> {% include categories.html context=entry.url %} </li> {% endif %} {% endfor %} </ul> -
kasperisager revised this gist
Mar 7, 2014 . 1 changed file with 9 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1 +1,9 @@ ### Usage ``` {% include navigation.html context="[top-level-path]" %} ``` ### Todo - Fix list nesting -
kasperisager revised this gist
Mar 7, 2014 . 1 changed file with 1 addition and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1 @@ Usage: `{% include navigation.html context="[top-level-path]" %}` -
kasperisager created this gist
Mar 7, 2014 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,15 @@ {% for entry in site.pages %} {% capture slug %}{{ entry.url | split: "/" | last }}{% endcapture %} {% capture current %}{{ entry.url | remove: slug | remove: "//" | append: "/" }}{% endcapture %} {% if current == include.context %} <ul> <li> <a href="{{ entry.url }}" class="{% if page.url == entry.url %}active{% endif %}">{{ entry.title }}</a> {% include categories.html context=entry.url %} </li> </ul> {% endif %} {% endfor %}