mirror of
https://github.com/ant-design/ant-design.git
synced 2025-01-18 14:13:37 +08:00
add react
This commit is contained in:
parent
35e9a4b836
commit
892432d11e
6
static/code.jsx
Normal file
6
static/code.jsx
Normal file
@ -0,0 +1,6 @@
|
||||
/*jshint ignore:start */
|
||||
var CodeBox = React.createClass({
|
||||
render: function() {
|
||||
return <pre><code>{this.props.code}</code></pre>;
|
||||
}
|
||||
});
|
@ -2,10 +2,3 @@
|
||||
|
||||
{% block title %}{{post.title}} - {{config.site.name}}{% endblock %}
|
||||
{% block description %}{% if post.summay %}{{post.summary}}{% endif %}{% endblock %}
|
||||
{% block main -%}
|
||||
{%- include "aside.html" %}
|
||||
<article class="markdown">
|
||||
<h1>{{ post.title }}</h1>
|
||||
{{ post.html }}
|
||||
</article>
|
||||
{%- endblock %}
|
||||
|
@ -13,6 +13,13 @@
|
||||
<link rel="stylesheet" href="/static/tomorrow.css">
|
||||
<script src="https://a.alipayobjects.com/jquery/jquery/1.11.1/jquery.js"></script>
|
||||
<script src="/static/script.js"></script>
|
||||
<!-- react -->
|
||||
<script src="https://t.alipayobjects.com/images/T12TdfXlpbXXXXXXXX.js"></script>
|
||||
<!-- JSXTransformer -->
|
||||
<script src="https://t.alipayobjects.com/images/T1jCFfXdNiXXXXXXXX.js"></script>
|
||||
{%- if post.meta.template === 'component' %}
|
||||
<script type="text/jsx" src="/static/code.jsx"></script>
|
||||
{%- endif %}
|
||||
</head>
|
||||
<body class="{%- if post.filepath === 'README.md' %}index-page{%- endif %}">
|
||||
<header id="header">
|
||||
@ -82,6 +89,13 @@
|
||||
{%- endif %}
|
||||
</h1>
|
||||
{{ post.html }}
|
||||
<div id="code-boxes"></div>
|
||||
<script type="text/jsx">
|
||||
React.render(
|
||||
<CodeBox code="123"></CodeBox>,
|
||||
document.getElementById('code-boxes')
|
||||
);
|
||||
</script>
|
||||
</article>
|
||||
</section>
|
||||
{%- endif %}
|
||||
|
Loading…
Reference in New Issue
Block a user