chore: update website publish script

This commit is contained in:
Benjy Cui 2016-06-03 13:21:27 +08:00
parent 98ce55fcab
commit 0dbfa049a1
4 changed files with 9 additions and 8 deletions

View File

@ -125,10 +125,10 @@
"compile": "antd-tools run compile",
"clean": "antd-tools run clean",
"start": "bisheng start -c ./site/bisheng.config.js",
"site": "antd-tools run site",
"site": "bisheng build -c ./site/bisheng.config.js",
"pre-deploy": "cp CNAME _site",
"deploy": "antd-tools run update-self && antd-tools run deploy",
"just-deploy": "antd-tools run just-deploy",
"deploy": "tnpm run clean && tnpm i && tnpm run just-deploy",
"just-deploy": "tnpm run pre-deploy && bisheng gh-pages -c ./site/bisheng.config.js",
"lint": "npm run srclint && npm run demolint && npm run lesshint",
"srclint": "RUN_ENV=SRC eslint components test site scripts ./*.js --ext '.js,.jsx'",
"demolint": "RUN_ENV=DEMO eslint components/*/demo/*.md --ext '.md'",

View File

@ -3,7 +3,7 @@ const processDoc = require('./process-doc');
const processDemo = require('./process-demo');
module.exports = (markdownData) => {
const isDemo = path.dirname(markdownData.meta.filename).endsWith('/demo');
const isDemo = /\/demo$/i.test(path.dirname(markdownData.meta.filename));
if (isDemo) {
return processDemo(markdownData);
}

View File

@ -64,14 +64,15 @@ module.exports = (markdownData) => {
]);
markdownData.preview = preview;
const styleNode = contentChildren.find((node) => {
const styleNode = contentChildren.filter((node) => {
return isStyleTag(node) ||
(JsonML.getTagName(node) === 'pre' && JsonML.getAttributes(node).lang === 'css');
});
})[0];
if (isStyleTag(styleNode)) {
markdownData.style = JsonML.getChildren(styleNode)[0];
} else if (styleNode) {
const styleTag = contentChildren.find(isStyleTag);
const styleTag = contentChildren.filter(isStyleTag)[0];
markdownData.style = getCode(styleNode) + (styleTag ? JsonML.getChildren(styleTag)[0] : '');
markdownData.highlightedStyle = JsonML.getAttributes(styleNode).highlighted;
}

View File

@ -1,6 +1,6 @@
const contentTmpl = './template/Content/index';
export default {
module.exports = {
categoryOrder: {
组件: 0,
十大原则: 0,