use in-page titles to generate sidebar nav
This commit is contained in:
+26
-6
@@ -1,6 +1,26 @@
|
||||
{% for item in tree %}{% if item.section %}
|
||||
<div class="item" data-title="{{ item.title }}">
|
||||
<div class="container">{% assign tree = item.section %}{% include tree.html %}
|
||||
</div>
|
||||
</div>{% else %}{% assign prefix = item.path | slice: 0, 4 %}{% if prefix == "http" %}{% assign target=" target='_blank'" %}{% else %}{% assign target="" %}{% endif %}
|
||||
<a class="item" data-title="{{ item.title }}" href="{{ item.path }}"{{ target }}></a>{% endif %}{% endfor %}
|
||||
{% for item in include.tree %}
|
||||
{% if item.section %}
|
||||
<div class="item" data-title="{{ item.title }}">
|
||||
<div class="container">
|
||||
{% include_cached tree.html tree=item.section %}
|
||||
</div>
|
||||
</div>
|
||||
{% else %}
|
||||
|
||||
{% capture whitespace %}
|
||||
{% if item.path %}
|
||||
{% assign path = item.path %}
|
||||
{% assign title = item.title %}
|
||||
{% assign target = " target='_blank'" %}
|
||||
{% else %}
|
||||
{% assign page = site.pages | where: "path", item | first %}
|
||||
{% assign title = page.title %}
|
||||
{% assign path = page.url %}
|
||||
{% endif %}
|
||||
{% endcapture %}
|
||||
|
||||
{% if path %}
|
||||
<a class="item" data-title="{{ title }}" href="{{ path }}"{{ target }}></a>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
|
||||
Reference in New Issue
Block a user