ant-design/site/templates/component.html

49 lines
1.2 KiB
HTML
Raw Normal View History

2015-05-12 17:50:03 +08:00
{% extends "page.html" %}
2015-06-04 17:05:28 +08:00
2015-06-05 17:27:05 +08:00
{% block scripts %}
2015-07-04 16:20:50 +08:00
<script src="/dist/{{ config.package.name }}-{{ config.package.version }}.js"></script>
2015-07-06 20:18:19 +08:00
<script src="/dist/demo.js"></script>
2015-07-01 21:43:56 +08:00
<script>
window.require = function(path) {
var result = window;
var namespaces = path.split('/');
namespaces.forEach(function(key, i) {
2015-07-06 20:18:19 +08:00
if (i !== 0 && i === namespaces.length - 1) {
2015-07-01 21:43:56 +08:00
key = capitalizeFirstLetter(key);
}
2015-07-06 20:04:26 +08:00
if (key !== 'lib') {
2015-07-01 21:43:56 +08:00
if (result[key]) {
result = result[key];
} else {
throw 'There should not have modules here 2.';
}
}
});
function capitalizeFirstLetter(string) {
return string.charAt(0).toUpperCase() + string.slice(1);
}
return result;
};
</script>
2015-06-05 17:27:05 +08:00
{% endblock %}
2015-06-04 17:05:28 +08:00
{% block content %}
<section class="main-container">
<article class="markdown">
<h1>
{{ post.title }} {{ post.meta.chinese }}
{%- if post.meta.API %}
<a class="api-link" href="http://{{ post.meta.API }}" target="_blank">
<i class="iconfont-home icon-externallink"></i>
API 使用说明
</a>
{%- endif %}
</h1>
{{ post.html }}
</article>
2015-06-09 22:07:15 +08:00
{%- if post.meta.template === 'component' && !post.meta.nodemos %}
{%- include "demos.html" %}
{%- endif %}
2015-06-04 17:05:28 +08:00
</section>
{% endblock %}