Browse Source

aside

pull/4/head
afc163 10 years ago
parent
commit
c4023c813f
  1. 12
      components/button.md
  2. 5
      components/button/demo.md
  3. 7
      components/button/index.md
  4. 5
      components/select/select.md
  5. 3
      nico.js
  6. 2
      theme/templates/aside.html
  7. 5
      theme/templates/component.html
  8. 5
      theme/templates/layout.html
  9. 9
      theme/templates/page.html
  10. 6
      theme/theme.js

12
components/button.md

@ -1,12 +0,0 @@
# Button 按钮
- category: Component
- API: github.com/react-component/button
---
这是一个按钮。
```html
<button>按钮</button>
```

5
components/button/demo.md

@ -0,0 +1,5 @@
# 基本型
---
<button></button>

7
components/button/index.md

@ -0,0 +1,7 @@
# Button 按钮
- category: CSS
---
这是一个按钮。

5
components/select.md → components/select/select.md

@ -6,8 +6,3 @@
---
这是一个下拉选择器。
```html
<Select>选择器</Select>
```

3
nico.js

@ -1,6 +1,9 @@
var path = require('path');
// {{ settings for nico
exports.site = {
name: 'Ant Design'
};
exports.theme = 'theme';
exports.source = process.cwd();
exports.output = path.join(process.cwd(), '_site');

2
theme/templates/aside.html

@ -1,8 +1,8 @@
{%- set categories = resource.pages|get_all_category %}
{%- set items = resource.pages|find_category(post.meta.category) %}
<aside class="aside-container">
<ul>
{%- for category in categories %}
{%- set items = resource.pages|find_category(category) %}
<li>
<h4>{{category}}</h4>
<ul>

5
theme/templates/component.html

@ -1,4 +1 @@
{% extends "layout.html" %}
{% block title %}{{post.title}} - {{config.site.name}}{% endblock %}
{% block description %}{% if post.summay %}{{post.summary}}{% endif %}{% endblock %}
{% extends "page.html" %}

5
theme/templates/layout.html

@ -6,7 +6,7 @@
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<meta name="format-detection" content="telephone=no">
<title>Ant Design</title>
<title>{% block title %}Ant Design{% endblock %}</title>
<link rel="stylesheet" href="/static/normalize.css">
<link rel="stylesheet" href="/static/style.css">
<link rel="stylesheet" href="//at.alicdn.com/t/font_1429685559_8155303.css">
@ -34,7 +34,7 @@
</div>
<nav class="nav">
<ul>
<li class="{%- if post.filename === 'index' %}current{%- endif %}">
<li class="{%- if post.meta.filepath === 'README.md' %}current{%- endif %}">
<a href="/">首页</a>
</li>
<li class="{%- if post.filename === 'start' %}current{%- endif %}">
@ -89,6 +89,7 @@
{%- endif %}
</h1>
{{ post.html }}
<CodeBox code="code"></CodeBox>
<div id="code-boxes"></div>
<script type="text/jsx">
React.render(

9
theme/templates/page.html

@ -1,4 +1,11 @@
{% extends "layout.html" %}
{% block title %}{{post.title}} - {{config.site.name}}{% endblock %}
{% block title %}
{%- if post.title !== config.site.name %}
{{post.title}} - {{config.site.name}}
{%- else %}
{{config.site.name}}
{%- endif %}
{% endblock %}
{% block description %}{% if post.summay %}{{post.summary}}{% endif %}{% endblock %}

6
theme/theme.js

@ -4,13 +4,13 @@ module.exports = function(nico) {
var exports = {};
exports.reader = function(post) {
var filename = post.meta.filepath.toLowerCase();
if (filename.indexOf('components') >= 0) {
var filepath = post.meta.filepath.toLowerCase();
if (filepath.indexOf('components') === 0) {
post.template = post.meta.template = 'component';
} else {
post.template = post.meta.template = (post.meta.template || 'page');
}
if (filename === 'readme.md') {
if (filepath === 'readme.md') {
post.filename = post.meta.filename = 'index';
}
return post;

Loading…
Cancel
Save