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
|
|
|
</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-09 17:31:03 +08:00
|
|
|
<ul class="toc demos-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 %}
|