提交 892432d1 编写于 作者: A afc163

add react

上级 35e9a4b8
/*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 %}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册