mirror of
https://github.com/ant-design/ant-design.git
synced 2025-08-06 16:06:28 +08:00
chore: update website publish script
This commit is contained in:
parent
98ce55fcab
commit
0dbfa049a1
@ -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'",
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -1,6 +1,6 @@
|
||||
const contentTmpl = './template/Content/index';
|
||||
|
||||
export default {
|
||||
module.exports = {
|
||||
categoryOrder: {
|
||||
组件: 0,
|
||||
十大原则: 0,
|
||||
|
Loading…
Reference in New Issue
Block a user