ant-design/site/templates/aside.html

40 lines
1.5 KiB
HTML
Raw Normal View History

2015-07-05 15:43:07 +08:00
{%- set categories = resource.pages|get_categories(post) %}
2015-05-09 18:16:36 +08:00
<aside class="aside-container">
2015-05-09 17:36:15 +08:00
<ul>
2015-07-05 15:43:07 +08:00
{%- for category in categories %}
2015-08-24 15:57:00 +08:00
{%- if category.pages.length === 1 %}
2015-08-22 20:33:43 +08:00
{%- for item in category.pages|splitComponentsByType(category.name) %}
2015-08-22 19:13:06 +08:00
<li class="{%- if item.title === post.title %}current{%- endif %}">
2016-01-08 16:01:37 +08:00
<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 %}">
2015-08-22 19:13:06 +08:00
{{item.title}}
<span class="chinese">{{item.meta.chinese}}</span>
</a>
</li>
{%- endfor %}
{%- else %}
<li open="open">
<h4>{{category.name}}</h4>
2015-07-05 15:43:07 +08:00
<ul class="{%- if category === post.meta.category %}aside-list-show{%- endif %}">
2015-08-22 20:16:24 +08:00
{%- 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 %}">
2015-09-11 14:57:32 +08:00
<a href="{{permalink_url(item)}}"
class="{%- if item.meta.disabled %}nav-link-disabled{%- endif %}"
{%- if item.meta.noinstant %}data-no-instant{%- endif %}>
2015-08-22 20:16:24 +08:00
{{item.title}}
<span class="chinese">{{item.meta.chinese}}</span>
</a>
</li>
{%- endif %}
2015-07-05 15:43:07 +08:00
{%- endfor %}
</ul>
</li>
2015-08-22 19:13:06 +08:00
{%- endif %}
2015-07-05 15:43:07 +08:00
{%- endfor %}
2015-05-09 17:36:15 +08:00
</ul>
</aside>