site: improve detail

This commit is contained in:
Benjy Cui 2016-05-26 15:45:11 +08:00
parent 2d0d70efcb
commit 8566c25682
6 changed files with 44 additions and 13 deletions

View File

@ -1,9 +0,0 @@
<script>
var prefix = /^\/components/.test(location.pathname) ? location.pathname.replace(/^\//, '').split('/').join('-') : '';
var scrollToString = location.hash ? '?scrollTo=' + prefix + location.hash : '';
if (location.pathname === '/changelog') {
location.href = '/#/docs/react/changelog' + scrollToString;
} else {
location.href = '/#' + location.pathname.replace(/\/$/, '') + scrollToString;
}
</script>

View File

@ -75,7 +75,7 @@
"babel-eslint": "^6.0.2", "babel-eslint": "^6.0.2",
"babel-jest": "^12.0.2", "babel-jest": "^12.0.2",
"babel-plugin-antd": "^0.4.0", "babel-plugin-antd": "^0.4.0",
"bisheng": "^0.4.0", "bisheng": "^0.5.0",
"bisheng-plugin-description": "^0.1.1", "bisheng-plugin-description": "^0.1.1",
"bisheng-plugin-react": "^0.1.0", "bisheng-plugin-react": "^0.1.0",
"bisheng-plugin-toc": "0.2.0", "bisheng-plugin-toc": "0.2.0",

View File

@ -7,6 +7,7 @@ module.exports = {
'CHANGELOG.md', // TODO: fix it in bisheng 'CHANGELOG.md', // TODO: fix it in bisheng
], ],
theme: './site/theme', theme: './site/theme',
htmlTemplate: './site/theme/static/template.html',
plugins: [ plugins: [
'bisheng-plugin-description', 'bisheng-plugin-description',
'bisheng-plugin-toc?maxDepth=2', 'bisheng-plugin-toc?maxDepth=2',

View File

@ -6,7 +6,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Ant Design - 一个 UI 设计语言</title> <title>Ant Design - 一个 UI 设计语言</title>
<link rel="icon" href="https://t.alipayobjects.com/images/T1QUBfXo4fXXXXXXXX.png" type="image/x-icon"> <link rel="icon" href="https://t.alipayobjects.com/images/T1QUBfXo4fXXXXXXXX.png" type="image/x-icon">
<link rel="stylesheet" type="text/css" href="./index.css"/> <link rel="stylesheet" type="text/css" href="{{ root }}index.css"/>
<!--[if lt IE 10]> <!--[if lt IE 10]>
<script src="https://as.alipayobjects.com/g/component/??console-polyfill/0.2.2/index.js,es5-shim/4.1.14/es5-shim.min.js,es5-shim/4.1.14/es5-sham.min.js,html5shiv/3.7.2/html5shiv.min.js,media-match/2.0.2/media.match.min.js"></script> <script src="https://as.alipayobjects.com/g/component/??console-polyfill/0.2.2/index.js,es5-shim/4.1.14/es5-shim.min.js,es5-shim/4.1.14/es5-sham.min.js,html5shiv/3.7.2/html5shiv.min.js,media-match/2.0.2/media.match.min.js"></script>
<![endif]--> <![endif]-->
@ -30,6 +30,7 @@
return '<span class="' + className + '">' + letter + '</span>'; return '<span class="' + className + '">' + letter + '</span>';
}).join(''); }).join('');
</script> </script>
<script src="./index.js"></script> <script src="{{ root }}common.js"></script>
<script src="{{ root }}index.js"></script>
</body> </body>
</html> </html>

View File

@ -15,7 +15,7 @@ export default function Page3() {
<h2 key="h2">丰富的基础组件</h2> <h2 key="h2">丰富的基础组件</h2>
<p key="p" style={{ maxWidth: 280 }}>丰富灵活实用的基础组件为业务产品提供强有力的设计支持</p> <p key="p" style={{ maxWidth: 280 }}>丰富灵活实用的基础组件为业务产品提供强有力的设计支持</p>
<div key="button"> <div key="button">
<Link to="/docs/react"> <Link to="/docs/react/introduce">
<Button type="primary" size="large"> <Button type="primary" size="large">
了解更多 了解更多
<Icon type="right" /> <Icon type="right" />

View File

@ -12,6 +12,44 @@ window.react = React;
window['react-dom'] = ReactDOM; window['react-dom'] = ReactDOM;
window.antd = require('antd'); window.antd = require('antd');
// Enable Google Analytics
if (!location.port) {
/* eslint-disable */
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-72788897-1', 'auto');
ga('send', 'pageview');
appHistory.listen((loc) => {
ga('send', 'pageview', loc.pathname + loc.search);
});
/* eslint-enable */
}
// Polyfill
const areIntlLocalesSupported = require('intl-locales-supported');
const localesMyAppSupports = ['zh-CN', 'en-US'];
if (global.Intl) {
// Determine if the built-in `Intl` has the locale data we need.
if (!areIntlLocalesSupported(localesMyAppSupports)) {
// `Intl` exists, but it doesn't have the data we need, so load the
// polyfill and patch the constructors we need with the polyfill's.
/* eslint-disable global-require */
const IntlPolyfill = require('intl');
/* eslint-enable global-require */
Intl.NumberFormat = IntlPolyfill.NumberFormat;
Intl.DateTimeFormat = IntlPolyfill.DateTimeFormat;
}
} else {
// No `Intl`, so use and load the polyfill.
/* eslint-disable global-require */
global.Intl = require('intl');
/* eslint-enable global-require */
}
const isZhCN = (typeof localStorage !== 'undefined' && localStorage.getItem('locale') !== 'en-US'); const isZhCN = (typeof localStorage !== 'undefined' && localStorage.getItem('locale') !== 'en-US');
// (typeof localStorage !== 'undefined' && localStorage.getItem('locale') === 'zh-CN') || // (typeof localStorage !== 'undefined' && localStorage.getItem('locale') === 'zh-CN') ||
// (navigator.language === 'zh-CN'); // (navigator.language === 'zh-CN');