mirror of
https://github.com/ant-design/ant-design.git
synced 2024-12-17 02:18:07 +08:00
41 lines
1.1 KiB
HTML
41 lines
1.1 KiB
HTML
{%- set items = resource.pages|find_demo_in_component(post.meta.directory) %}
|
|
{%- if items.length > 0 %}
|
|
<h2 class="component-demos">
|
|
代码演示
|
|
<i class="anticon anticon-appstore icon-all" title="展开全部代码"></i>
|
|
</h2>
|
|
<div class="code-boxes">
|
|
{%- 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">
|
|
{%- for item in items|odd %}
|
|
{%- set post = item.meta.filepath|parsePost %}
|
|
{%- include "code.html" %}
|
|
{%- endfor %}
|
|
</div>
|
|
<div class="code-boxes-col-2-1">
|
|
{%- for item in items|even %}
|
|
{%- set post = item.meta.filepath|parsePost %}
|
|
{%- include "code.html" %}
|
|
{%- endfor %}
|
|
</div>
|
|
{%- endif %}
|
|
</div>
|
|
<ul class="toc demos-anchor">
|
|
{%- 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>
|
|
{%- endif %}
|