Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
wanjj_1210
ant-design
提交
5f135035
A
ant-design
项目概览
wanjj_1210
/
ant-design
与 Fork 源项目一致
从无法访问的项目Fork
通知
10
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
A
ant-design
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
5f135035
编写于
5月 11, 2015
作者:
A
afc163
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
aside with category
上级
77367b18
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
36 addition
and
7 deletion
+36
-7
components/button.md
components/button.md
+2
-0
components/select.md
components/select.md
+2
-0
package.json
package.json
+1
-0
static/style.css
static/style.css
+9
-1
theme/templates/aside.html
theme/templates/aside.html
+12
-4
theme/theme.js
theme/theme.js
+10
-2
未找到文件。
components/button.md
浏览文件 @
5f135035
# Button 按钮
-
category: Component
---
这是一个按钮。
...
...
components/select.md
浏览文件 @
5f135035
# Select 选择框
-
category: Component
---
这是一个下拉选择器。
...
...
package.json
浏览文件 @
5f135035
...
...
@@ -12,6 +12,7 @@
},
"dependencies"
:
{
"
gh-pages-cli
"
:
"
~0.2.0
"
,
"
lodash
"
:
"
~3.8.0
"
,
"
nico
"
:
"
*
"
},
"scripts"
:
{
...
...
static/style.css
浏览文件 @
5f135035
...
...
@@ -341,7 +341,15 @@ footer ul li > a {
height
:
100%
;
background
:
#F9F9F9
;
position
:
absolute
;
padding-top
:
30px
;
padding-top
:
15px
;
}
.aside-container
li
h4
{
font-size
:
16px
;
font-weight
:
bold
;
padding-left
:
50px
;
margin
:
10px
0
;
color
:
#5C6B77
;
}
.aside-container
li
a
{
...
...
theme/templates/aside.html
浏览文件 @
5f135035
{%- set categories = resource.pages|get_all_category %}
{%- set items = resource.pages|find_category(post.meta.category) %}
<aside
class=
"aside-container"
>
<ul>
{%- for item in items %}
<li
class=
"{%- if item.title === post.title %}current{%- endif %}"
>
<a
href=
"{{permalink_url(item)}}"
>
{{item.title}}
</a>
{%- for category in categories %}
<li>
<h4>
{{category}}
</h4>
<ul>
{%- for item in items %}
<li
class=
"{%- if item.title === post.title %}current{%- endif %}"
>
<a
href=
"{{permalink_url(item)}}"
>
{{item.title}}
</a>
</li>
{%- endfor %}
</ul>
</li>
{%- endfor %}
{%- endfor %}
</ul>
</aside>
theme/theme.js
浏览文件 @
5f135035
var
_
=
require
(
'
lodash
'
);
module
.
exports
=
function
(
nico
)
{
var
exports
=
{};
...
...
@@ -10,9 +12,7 @@ module.exports = function(nico) {
}
if
(
filename
===
'
readme.md
'
)
{
post
.
filename
=
post
.
meta
.
filename
=
'
index
'
;
post
.
meta
.
category
=
'
docs
'
;
}
post
.
meta
.
category
=
post
.
meta
.
category
||
post
.
meta
.
directory
;
return
post
;
};
...
...
@@ -37,6 +37,14 @@ module.exports = function(nico) {
return
parseInt
(
a
,
10
)
-
parseInt
(
b
,
10
);
});
return
ret
;
},
get_all_category
:
function
(
pages
)
{
return
_
.
uniq
(
Object
.
keys
(
pages
).
map
(
function
(
key
)
{
var
item
=
nico
.
sdk
.
post
.
read
(
key
);
return
item
.
meta
.
category
;
}).
filter
(
function
(
item
)
{
return
item
;
}));
}
};
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录