site: migrate changelog.md

This commit is contained in:
Benjy Cui 2016-05-24 16:01:23 +08:00
parent 38f9864732
commit 95222a51fa
4 changed files with 19 additions and 14 deletions

View File

@ -1,6 +1,6 @@
---
- order: 3
- title: 小数
order: 3
title: 小数
---
和原生的数字输入框一样value 的精度由 step 的小数位数决定。

View File

@ -1,7 +1,11 @@
const path = require('path');
module.exports = {
source: ['./components', './docs', './CHANGELOG.md'],
source: [
'./components',
'./docs',
'CHANGELOG.md', // TODO: fix it in bisheng
],
theme: './site/theme',
plugins: [
'bisheng-plugin-description',

View File

@ -25,6 +25,7 @@ export default {
'/docs/practice/:children': contentTmpl,
'/docs/pattern/:children': contentTmpl,
'/docs/react/:children': contentTmpl,
'/CHANGELOG': contentTmpl,
'/components/:children': contentTmpl,
'/docs/spec/:children': contentTmpl,
'/docs/resource/:children': contentTmpl,

View File

@ -81,18 +81,26 @@ export default class MainContent extends React.Component {
return [...topLevel, ...itemGroups];
}
getMenuItems() {
getModuleData() {
const props = this.props;
let moduleData;
if (/(docs\/react\/)|(components\/)/i.test(props.location.pathname)) {
if (/(docs\/react\/)|(components\/)|(CHANGELOG)/i.test(props.location.pathname)) {
moduleData = {
...props.data.docs.react,
...props.data.components,
CHANGELOG: props.data.CHANGELOG,
};
} else {
moduleData = props.utils.get(props.data, props.location.pathname.split('/').slice(0, 2));
}
return moduleData;
}
getMenuItems() {
const moduleData = this.getModuleData();
const menuItems = utils.getMenuItems(moduleData, this.context.intl.locale);
const topLevel = this.generateSubMenuItems(menuItems.topLevel);
const subMenu = Object.keys(menuItems).filter(this.isNotTopLevel)
@ -144,15 +152,7 @@ export default class MainContent extends React.Component {
const { prev, next } = this.getFooterNav(menuItems, activeMenuItem);
const locale = this.context.intl.locale;
let moduleData;
if (/(docs\/react\/)|(components\/)/i.test(props.location.pathname)) {
moduleData = {
...props.data.docs.react,
...props.data.components,
};
} else {
moduleData = props.utils.get(props.data, props.location.pathname.split('/').slice(0, 2));
}
const moduleData = this.getModuleData();
const pageData = props.pageData.index || props.pageData;
const localizedPageData = pageData[locale] || pageData;
return (