ant-design/site/templates/demos.html

47 lines
1.3 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">
2015-11-09 18:05:23 +08:00
代码演示
2015-08-23 14:46:11 +08:00
<i class="anticon anticon-appstore icon-all" title="展开全部代码"></i>
2015-05-29 22:13:39 +08:00
{%- if post.meta.sketch %}
<a class="sketch-link" href="{{ post.meta.sketch }}" target="_blank">
2015-08-23 14:46:11 +08:00
<i class="anticon anticon-download"></i>
2015-05-29 22:13:39 +08:00
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>
2016-01-06 15:27:56 +08:00
<ul class="toc demos-anchor anchor">
2016-01-03 01:35:40 +08:00
{%- for item in items %}
{%- set post = item.meta.filepath|parsePost %}
<li>
<a title="{{ post.title }}" href="#{{post.meta.id|removeCodeBoxIdPrefix}}">
<span>{{ post.title }}</span>
</a>
</li>
{%- endfor %}
</ul>
2015-08-22 16:36:07 +08:00
{%- endif %}