You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

37 lines
1.0 KiB

{%- set items = resource.pages|find_demo_in_component(post.meta.directory) %}
{%- if items.length > 0 %}
10 years ago
<h2 class="component-demos">
组件演示
9 years ago
<i class="anticon anticon-appstore icon-all" title="展开全部代码"></i>
10 years ago
{%- if post.meta.sketch %}
<a class="sketch-link" href="{{ post.meta.sketch }}" target="_blank">
9 years ago
<i class="anticon anticon-download"></i>
10 years ago
Sketch 下载
</a>
{%- endif %}
</h2>
<div class="code-boxes">
10 years ago
{%- 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">
10 years ago
{%- for item in items|odd %}
{%- set post = item.meta.filepath|parsePost %}
{%- include "code.html" %}
{%- endfor %}
</div>
10 years ago
<div class="code-boxes-col-2-1">
10 years ago
{%- for item in items|even %}
{%- set post = item.meta.filepath|parsePost %}
{%- include "code.html" %}
{%- endfor %}
</div>
10 years ago
{%- endif %}
10 years ago
</div>
{%- endif %}