Skip to content

Commit 227e6f9

Browse files
committed
add footer & footer nav
1 parent 7c3e5a9 commit 227e6f9

6 files changed

Lines changed: 119 additions & 62 deletions

File tree

docs/changelog.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# 更新日志
2+
3+
`ant-design-san` 严格遵循 [Semantic Versioning 2.0.0](http://semver.org/lang/zh-CN/) 语义化版本规范。
4+
5+
### 发布周期
6+
7+
* 修订版本号:每周末会进行日常 bugfix 更新。(如果有紧急的 bugfix,则任何时候都可发布)
8+
* 次版本号:带有新特性的向下兼容的版本。
9+
* 主版本号:含有破坏性更新和新特性,不在发布周期内。
10+
11+
### 0.2.0
12+
13+
#### Features
14+
15+
* 对外第一个版本,提供常用 61 个[组件](https://github.com/ecomfe/santd/blob/master/src/index.js)

docs/introduce.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ import 'santd/dist/santd.css';
6565
plugins: [['import', {
6666
libraryName: 'santd',
6767
libraryDirectory: 'es',
68-
style: 'css'
68+
style: true
6969
}]]
7070
}
7171
}

site/src/index.js

Lines changed: 91 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import Content from './containers/Content';
1313
import Header from './containers/Header';
1414
import Navigator from './containers/Navigator';
1515

16-
import {Notification, Col, Row, Affix} from 'santd';
16+
import {Notification, Col, Row, Affix, Icon} from 'santd';
1717

1818
import routes from './lib/routes';
1919
import './style/index.less';
@@ -28,21 +28,58 @@ class Index extends Component {
2828
<s-row>
2929
<s-col xs="24" sm="24" md="24" lg="6" xl="5" xxl="4" class="main-menu">
3030
<s-affix>
31-
<section class="main-menu-inner">
32-
<doc-navigator
33-
class="aside-container menu-site"
34-
style="top: {{navigatorFixedTop}}px;"
35-
routes="{{routes}}"
36-
currentPath="{{currentPath}}"
37-
on-redirect="handleRedirect"
38-
/>
39-
</section>
40-
</s-affix>
31+
<section class="main-menu-inner">
32+
<doc-navigator
33+
class="aside-container menu-site"
34+
style="top: {{navigatorFixedTop}}px;"
35+
routes="{{routes}}"
36+
currentPath="{{currentPath}}"
37+
on-redirect="handleRedirect"
38+
/>
39+
</section>
40+
</s-affix>
4141
</s-col>
4242
<s-col xs="24" sm="24" md="24" lg="18" xl="19" xxl="20">
4343
<section class="main-container">
4444
<doc-content content="{{content}}" />
4545
</section>
46+
<section class="prev-next-nav">
47+
<a class="prev-page" href="#{{leftNav.key}}" s-if="leftNav"><s-icon type="left" /> {{leftNav.text || leftNav.name}}</a>
48+
<a class="next-page" href="#{{rightNav.key}}" s-if="rightNav">{{rightNav.text || rightNav.name}} <s-icon type="right" /></a>
49+
</section>
50+
<footer id="footer">
51+
<div class="footer-wrap">
52+
<s-row>
53+
<s-col xs="24" sm="24" md="6">
54+
<div class="footer-center">
55+
<h2>相关资源</h2>
56+
<div><a href="https://ant.design/docs/react/introduce-cn" target="_blank">Ant Design</a><span> - </span><span>React</span></div>
57+
<div><a href="https://antdv.com/docs/vue/introduce-cn" target="_blank">Ant Design</a><span> - </span><span>Vue</span></div>
58+
<div><a href="https://github.com/NG-ZORRO/ng-zorro-antd" target="_blank">Ant Design</a><span> - </span><span>Angular</span></div>
59+
<div><a href="https://github.com/websemantics/awesome-ant-design" target="_blank">Awesome Ant Design</a></div>
60+
<div><a href="https://baidu.github.io/san/">San</a></div>
61+
</div>
62+
</s-col>
63+
<s-col xs="24" sm="24" md="6">
64+
<div class="footer-center">
65+
<h2>帮助</h2>
66+
<div><a href="https://github.com/ecomfe/santd" target="_blank">GitHub</a></div>
67+
<div><a href="#/docs/changelog">更新日志</a></div>
68+
</div>
69+
</s-col>
70+
<s-col xs="24" sm="24" md="6">
71+
<div class="footer-center">
72+
<h2><img alt="" class="title-icon" src="https://gw.alipayobjects.com/zos/rmsportal/nBVXkrFdWHxbZlmMbsaH.svg"><span>更多产品</span></h2>
73+
<div><a href="https://yuque.com/" target="_blank "><i nz-icon="" nztheme="fill" nztype="yuque" style="margin-right: 4px; color: rgb(37, 184, 100);" class="anticon anticon-yuque"><svg viewBox="64 64 896 896" fill="currentColor" width="1em" height="1em" data-icon="yuque" aria-hidden="true"><path d="M854.6 370.6c-9.9-39.4 9.9-102.2 73.4-124.4l-67.9-3.6s-25.7-90-143.6-98c-117.9-8.1-195-3-195-3s87.4 55.6 52.4 154.7c-25.6 52.5-65.8 95.6-108.8 144.7-1.3 1.3-2.5 2.6-3.5 3.7C319.4 605 96 860 96 860c245.9 64.4 410.7-6.3 508.2-91.1 20.5-.2 35.9-.3 46.3-.3 135.8 0 250.6-117.6 245.9-248.4-3.2-89.9-31.9-110.2-41.8-149.6z"></path></svg></i> 语雀</a><span> - </span><span>知识创作与分享工具</span></div>
74+
<div><a href="https://yunfengdie.com/" target="_blank "><span>云凤蝶</span></a><span> - </span><span>移动建站平台</span></div>
75+
<div><a href="https://antv.alipay.com/" rel="noopener noreferrer" target="_blank">AntV</a><span> - </span><span>数据可视化</span></div>
76+
<div><a href="https://eggjs.org/" rel="noopener noreferrer" target="_blank">Egg</a><span> - </span><span>企业级 Node 开发框架</span></div>
77+
<div><a href="http://xtech.antfin.com/" target="_blank "><span>蚂蚁体验科技</span></a></div>
78+
</div>
79+
</s-col>
80+
</s-row>
81+
</div>
82+
</footer>
4683
</s-col>
4784
</s-row>
4885
</div>
@@ -55,9 +92,37 @@ class Index extends Component {
5592
'doc-navigator': Navigator,
5693
's-col': Col,
5794
's-row': Row,
58-
's-affix': Affix
95+
's-affix': Affix,
96+
's-icon': Icon
5997
};
6098

99+
static computed = {
100+
leftNav() {
101+
const currentPath = this.data.get('currentPath');
102+
const flattenRouter = this.data.get('flattenRouter') || [];
103+
let leftNav;
104+
flattenRouter.forEach((router, index) => {
105+
if (router.key === currentPath) {
106+
leftNav = flattenRouter[index - 1];
107+
}
108+
});
109+
110+
return leftNav;
111+
},
112+
rightNav() {
113+
const currentPath = this.data.get('currentPath');
114+
const flattenRouter = this.data.get('flattenRouter') || [];
115+
let rightNav;
116+
flattenRouter.forEach((router, index) => {
117+
if (router.key === currentPath) {
118+
rightNav = flattenRouter[index + 1];
119+
}
120+
});
121+
122+
return rightNav;
123+
}
124+
}
125+
61126
initData() {
62127
return {
63128
routerMap: {},
@@ -67,19 +132,25 @@ class Index extends Component {
67132

68133
inited() {
69134
let routerMap = {};
135+
let flattenRouter = [];
70136
const routes = this.data.get('routes');
71137
routes.forEach(item => {
72138
routerMap[item.key] = {};
73-
item.leaf && item.leaf.forEach(subItem => (
74-
routerMap[item.key][subItem.path] = true
75-
));
76-
item.list && item.list.forEach(listItem => (
77-
listItem.leaf && listItem.leaf.forEach(subItem => (
78-
routerMap[item.key][subItem.path] = true
79-
))
80-
));
139+
if (!item.list) {
140+
flattenRouter.push(item);
141+
}
142+
item.leaf && item.leaf.forEach(subItem => {
143+
routerMap[item.key][subItem.path] = true;
144+
});
145+
item.list && item.list.forEach(listItem => {
146+
listItem.leaf && listItem.leaf.forEach(subItem => {
147+
flattenRouter.push(subItem);
148+
routerMap[item.key][subItem.path] = true;
149+
});
150+
});
81151
});
82152
this.data.set('routerMap', routerMap);
153+
this.data.set('flattenRouter', flattenRouter);
83154
}
84155

85156
attached() {

site/src/lib/routes.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,11 @@ export default [
1818
path: 'theme',
1919
key: '/docs/theme'
2020
},
21+
{
22+
name: '更新日志',
23+
path: 'changelog',
24+
key: '/docs/changelog'
25+
},
2126
{
2227
name: '国际化',
2328
path: 'i18n',

site/theme/static/footer.less

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ footer {
99
position: relative;
1010
z-index: 9;
1111
color: rgba(255, 255, 255, 0.65);
12-
.ant-row {
12+
.santd-row {
1313
text-align: center;
1414
.footer-center {
1515
display: inline-block;
@@ -24,7 +24,7 @@ footer {
2424
width: 27px;
2525
margin-right: 16px;
2626
}
27-
> .anticon {
27+
> .santdicon {
2828
font-size: 16px;
2929
position: absolute;
3030
left: -22px;
@@ -39,7 +39,7 @@ footer {
3939
}
4040
.footer-wrap {
4141
position: relative;
42-
padding: 86px @padding-space 93px @padding-space;
42+
padding: 60px;
4343
border-bottom: 1px solid rgba(255, 255, 255, 0.25);
4444
}
4545
.bottom-bar {
@@ -67,4 +67,7 @@ footer {
6767
color: rgba(255, 255, 255, 1);
6868
}
6969
}
70+
svg {
71+
display: inline-block;
72+
}
7073
}

site/theme/static/page-nav.less

Lines changed: 1 addition & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
.prev-next-nav {
2-
position: absolute;
3-
bottom: 0;
4-
left: 0;
5-
width: ~"calc(100% - 194px - 64px)";
62
margin-left: 64px;
3+
margin-right: 64px;
74
font-size: 14px;
85
border-top: 1px solid @site-border-color-split;
96

@@ -16,43 +13,9 @@
1613
text-decoration: none;
1714
}
1815

19-
> a.prev-page {
20-
&:before {
21-
font-family: 'anticon';
22-
content: '\e61c';
23-
font-size: 12px;
24-
margin-right: 1em;
25-
color: @site-text-color-secondary;
26-
transition: all .3s;
27-
position: relative;
28-
left: 0;
29-
}
30-
31-
&:hover:before {
32-
color: @primary-color;
33-
left: -3px;
34-
}
35-
}
36-
3716
> .next-page {
3817
text-align: right;
3918
float: right;
40-
41-
&:after {
42-
font-family: 'anticon';
43-
content: '\e61b';
44-
font-size: 12px;
45-
margin-left: 1em;
46-
color: @site-text-color-secondary;
47-
transition: all .3s;
48-
position: relative;
49-
right: 0;
50-
}
51-
52-
&:hover:after {
53-
color: @primary-color;
54-
right: -3px;
55-
}
5619
}
5720

5821
.chinese {

0 commit comments

Comments
 (0)