forked from yesmeck/antd-dash
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathant-design.patch
122 lines (120 loc) · 5.29 KB
/
ant-design.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
diff --git a/site/theme/template/Content/Article.jsx b/site/theme/template/Content/Article.jsx
index 02b7e65..95069a2 100644
--- a/site/theme/template/Content/Article.jsx
+++ b/site/theme/template/Content/Article.jsx
@@ -102,7 +102,7 @@ export default class Article extends React.Component {
}
{
(!content.toc || content.toc.length <= 1 || meta.toc === false) ? null :
- <Affix className="toc-affix" offsetTop={16}>
+ <Affix className="toc-affix" offsetTop={16} style={{ display: 'none' }}>
{
props.utils.toReactComponent(
['ul', { className: 'toc' }].concat(getChildren(content.toc))
diff --git a/site/theme/template/Content/ComponentDoc.jsx b/site/theme/template/Content/ComponentDoc.jsx
index 963cbec..f564890 100644
--- a/site/theme/template/Content/ComponentDoc.jsx
+++ b/site/theme/template/Content/ComponentDoc.jsx
@@ -78,7 +78,7 @@ export default class ComponentDoc extends React.Component {
return (
<DocumentTitle title={`${subtitle || ''} ${title[locale] || title} - Ant Design`}>
<article>
- <Affix className="toc-affix" offsetTop={16}>
+ <Affix className="toc-affix" offsetTop={16} style={{ display: 'none' }}>
<ul id="demo-toc" className="toc">
{jumper}
</ul>
diff --git a/site/theme/template/Content/Demo.jsx b/site/theme/template/Content/Demo.jsx
index 410dc5a..42e6c75 100644
--- a/site/theme/template/Content/Demo.jsx
+++ b/site/theme/template/Content/Demo.jsx
@@ -183,6 +183,7 @@ ${state.sourceCode.replace('mountNode', 'document.getElementById(\'container\')'
};
return (
<section className={codeBoxClass} id={meta.id}>
+ <a name={`//apple_ref/cpp/Section/${encodeURI(localizedTitle)}`} className="dashAnchor"></a>
<section className="code-box-demo">
{this.liveDemo}
{
diff --git a/site/theme/template/Content/MainContent.jsx b/site/theme/template/Content/MainContent.jsx
index be36f0c..7e2608f 100644
--- a/site/theme/template/Content/MainContent.jsx
+++ b/site/theme/template/Content/MainContent.jsx
@@ -17,7 +17,7 @@ function getActiveMenuItem(props) {
}
function getModuleData(props) {
- const { pathname } = props.location;
+ const pathname = props.location.pathname.replace(/index\.html$/, '').replace(/\.html$/, '');
const moduleName = /^\/?components/.test(pathname) ?
'components' : pathname.split('/').filter(item => item).slice(0, 2).join('/');
const moduleData = moduleName === 'components' || moduleName === 'docs/react' ||
@@ -250,12 +250,12 @@ export default class MainContent extends React.Component {
>
{menuChild}
</MobileMenu>) : (
- <Col xxl={4} xl={5} lg={6} md={24} sm={24} xs={24} className="main-menu">
+ <Col xxl={4} xl={5} lg={6} md={24} sm={24} xs={24} className="main-menu" style={{ display: 'none' }}>
{menuChild}
</Col>
)
}
- <Col xxl={20} xl={19} lg={18} md={24} sm={24} xs={24} className={mainContainerClass}>
+ <Col span={24} className={mainContainerClass}>
{
props.demos ?
<ComponentDoc {...props} doc={localizedPageData} demos={props.demos} /> :
@@ -263,30 +263,6 @@ export default class MainContent extends React.Component {
}
</Col>
</Row>
-
- <Row>
- <Col
- xxl={{ span: 20, offset: 4 }}
- xl={{ span: 19, offset: 5 }}
- lg={{ span: 18, offset: 6 }}
- md={24}
- sm={24}
- xs={24}
- >
- <section className="prev-next-nav">
- {
- prev ?
- React.cloneElement(prev.props.children || prev.children[0], { className: 'prev-page' }) :
- null
- }
- {
- next ?
- React.cloneElement(next.props.children || next.children[0], { className: 'next-page' }) :
- null
- }
- </section>
- </Col>
- </Row>
</div>
);
}
diff --git a/site/theme/template/Content/index.jsx b/site/theme/template/Content/index.jsx
index ed94563..64f173c 100644
--- a/site/theme/template/Content/index.jsx
+++ b/site/theme/template/Content/index.jsx
@@ -8,7 +8,7 @@ function isChangelog(pathname) {
export default collect(async (nextProps) => {
const { pathname } = nextProps.location;
- const pageDataPath = pathname.replace('-cn', '').split('/');
+ const pageDataPath = pathname.replace(/index\.html$/, '').replace(/\.html$/, '').replace('-cn', '').split('/');
const pageData = isChangelog(pathname) ?
nextProps.data.changelog.CHANGELOG :
nextProps.utils.get(nextProps.data, pageDataPath);
diff --git a/site/theme/template/Layout/index.jsx b/site/theme/template/Layout/index.jsx
index 1a52ecc..5407135 100644
--- a/site/theme/template/Layout/index.jsx
+++ b/site/theme/template/Layout/index.jsx
@@ -81,7 +81,6 @@ export default class Layout extends React.Component {
return (
<IntlProvider locale={appLocale.locale} messages={appLocale.messages}>
<div className="page-wrapper">
- <Header {...restProps} />
{children}
<Footer {...restProps} />
</div>