ant-design/site/templates/aside.html
2015-08-22 20:16:24 +08:00

36 lines
1.3 KiB
HTML

{%- set categories = resource.pages|get_categories(post) %}
<aside class="aside-container">
<ul>
{%- for category in categories %}
{%- if category.name === 'top' %}
{%- for item in category.pages %}
<li class="{%- if item.title === post.title %}current{%- endif %}">
<a href="{{permalink_url(item)}}" class="{%- if item.meta.disabled %}nav-link-disabled{%- endif %}">
{{item.title}}
<span class="chinese">{{item.meta.chinese}}</span>
</a>
</li>
{%- endfor %}
{%- else %}
<li open="open">
<h4>{{category.name}}</h4>
<ul class="{%- if category === post.meta.category %}aside-list-show{%- endif %}">
{%- for item in category.pages|splitComponentsByType(category.name) %}
{%- if item.divider === true %}
<li class="type-divider">{{item.name}}</li>
{%- else %}
<li class="{%- if item.title === post.title %}current{%- endif %}">
<a href="{{permalink_url(item)}}" class="{%- if item.meta.disabled %}nav-link-disabled{%- endif %}">
{{item.title}}
<span class="chinese">{{item.meta.chinese}}</span>
</a>
</li>
{%- endif %}
{%- endfor %}
</ul>
</li>
{%- endif %}
{%- endfor %}
</ul>
</aside>