ant-design/site/templates/aside.html
2016-03-08 17:45:19 +08:00

40 lines
1.5 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="{%- if item.meta.link %}{{item.meta.link}}{%- else %}{{permalink_url(item)}}{%- endif %}"
{%- if item.meta.link %}target="_blank"{%- endif %}
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>