Make navigation menus reusable
This commit is contained in:
parent
3f7dcaa2ec
commit
102d83f78d
|
@ -0,0 +1,11 @@
|
||||||
|
{% assign items = include.items | split: ' ' %}
|
||||||
|
|
||||||
|
{% for item in items %}
|
||||||
|
{% assign item_url = item | prepend:'/docs/' | append:'/' %}
|
||||||
|
|
||||||
|
{% for p in site.pages %}
|
||||||
|
{% if p.url == item_url %}
|
||||||
|
<option value="{{ site.url }}{{ p.url }}">{{ p.title }}</option>
|
||||||
|
{% endif %}
|
||||||
|
{% endfor %}
|
||||||
|
{% endfor %}
|
|
@ -0,0 +1,20 @@
|
||||||
|
{% assign items = include.items | split: ' ' %}
|
||||||
|
|
||||||
|
<ul>
|
||||||
|
{% for item in items %}
|
||||||
|
{% assign item_url = item | prepend:'/docs/' | append:'/' %}
|
||||||
|
|
||||||
|
{% if item_url == page.url %}
|
||||||
|
{% assign c = 'current' %}
|
||||||
|
{% else %}
|
||||||
|
{% assign c = '' %}
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
{% for p in site.pages %}
|
||||||
|
{% if p.url == item_url %}
|
||||||
|
<li class="{{ c }}"><a href="{{ p.url }}">{{ p.title }}</a></li>
|
||||||
|
{% endif %}
|
||||||
|
{% endfor %}
|
||||||
|
|
||||||
|
{% endfor %}
|
||||||
|
</ul>
|
Loading…
Reference in New Issue