ant-design/site/templates/demos.html

37 lines
1.0 KiB
HTML
Raw Normal View History

2015-08-22 16:36:07 +08:00
{%- set items = resource.pages|find_demo_in_component(post.meta.directory) %}
{%- if items.length > 0 %}
2015-05-29 22:13:39 +08:00
<h2 class="component-demos">
组件演示
<i class="iconfont-home icon-all" title="展开全部代码"></i>
{%- if post.meta.sketch %}
<a class="sketch-link" href="{{ post.meta.sketch }}" target="_blank">
<i class="iconfont-home icon-download"></i>
Sketch 下载
</a>
{%- endif %}
</h2>
2015-08-19 11:26:30 +08:00
<div class="code-boxes">
2015-06-25 16:15:12 +08:00
{%- if post.meta.cols == 1 %}
<div class="code-boxes-col-1-1">
{%- for item in items %}
{%- set post = item.meta.filepath|parsePost %}
{%- include "code.html" %}
{%- endfor %}
</div>
{%- else %}
<div class="code-boxes-col-2-1">
2015-05-29 22:13:39 +08:00
{%- for item in items|odd %}
{%- set post = item.meta.filepath|parsePost %}
{%- include "code.html" %}
{%- endfor %}
</div>
2015-06-25 16:15:12 +08:00
<div class="code-boxes-col-2-1">
2015-05-29 22:13:39 +08:00
{%- for item in items|even %}
{%- set post = item.meta.filepath|parsePost %}
{%- include "code.html" %}
{%- endfor %}
</div>
2015-06-25 16:15:12 +08:00
{%- endif %}
2015-05-29 22:13:39 +08:00
</div>
2015-08-22 16:36:07 +08:00
{%- endif %}