ant-design/site/templates/aside.html
2015-09-11 14:57:32 +08:00

38 lines
1.4 KiB
HTML

{%- set categories = resource.pages|get_categories(post) %}
<aside class="aside-container">
<ul>
{%- for category in categories %}
{%- if category.pages.length === 1 %}
{%- for item in category.pages|splitComponentsByType(category.name) %}
<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 %}"
{%- if item.meta.noinstant %}data-no-instant{%- endif %}>
{{item.title}}
<span class="chinese">{{item.meta.chinese}}</span>
</a>
</li>
{%- endif %}
{%- endfor %}
</ul>
</li>
{%- endif %}
{%- endfor %}
</ul>
</aside>