ant-design/site/theme/index.js
二货机器人 afedb4127f
docs: Site with single paging ()
* patch route

* use data for promise

* rename Article file

* Article in TS

* clean up

* use collect

* adjust css

* card it

* listing

* res

* hiring

* add footer

* english it

* rm others

* fix lint

* fix navigation

* add dropdown button

* Header with TS

* split input & logo

* navigation out

* use flex

* flex everything

* stretch

* hide search when narrow

* init category

* global rules

* more cat

* pages

* level 2 width

* level 3

* level 4

* skip before ready

* clean up

* unqiue shadow variable

* update eslintignore

* update ignore

* fix ssr

* fix location param

* replace images

* shake more

* fix top of navigation

* remove home

* reorder nav & adjust padding style

* narrow res style

* Update research-form-page.zh-CN.md ()

Co-authored-by: Golevka <huangsamfisher@163.com>

* rm skip

* narrow merge in

* reset p style

* update svg

* fix lint

* update ignore

* update lint ignore

* Update research-result-page.zh-CN.md ()

Co-authored-by: mihaideyu <zxy1010414746@163.com>

* Update research-result-page.zh-CN.md

* Update research-workbench.zh-CN.md ()

Co-authored-by: yingxirz <inseeing@gmail.com>

* Update research-workbench.zh-CN.md

* Update research-list-page.zh-CN.md ()

Co-authored-by: yingxirz <inseeing@gmail.com>

* Update research-list-page.zh-CN.md

* padding use 40px

* add responsive of ref

* fix p margin

* Update research-workbench.zh-CN.md

* Update buttons.md ()

Co-authored-by: yingxirz <inseeing@gmail.com>

* Update resources.en-US.md ()

* Update research-navigation.zh-CN.md ()

* Update research-navigation.zh-CN.md

* Update research-navigation.zh-CN.md

* Update research-navigation.zh-CN.md

* Update research-empty.zh-CN.md ()

* Update research-empty.zh-CN.md

* Update research-empty.zh-CN.md

* Update research-empty.zh-CN.md

* Update research-empty.zh-CN.md

Co-authored-by: 二货机器人 <smith3816@gmail.com>

* Update research-exception-page.zh-CN.md ()

* Update research-exception-page.zh-CN.md

* Update research-exception-page.zh-CN.md

* Update research-message-and-feedback.zh-CN.md ()

* Update research-message-and-feedback.zh-CN.md ()

* Update research-message-and-feedback.zh-CN.md

* Update research-message-and-feedback.zh-CN.md

* Update research-message-and-feedback.zh-CN.md

* Update research-message-and-feedback.zh-CN.md

* replace background

* fix lines margin

* home padding

* patch minTilda doc

* Update resources.zh-CN.md ()

* clean up

* Update research-workbench.zh-CN.md ()

Co-authored-by: yingxirz <inseeing@gmail.com>

* Update research-overview.zh-CN.md ()

Co-authored-by: yingxirz <inseeing@gmail.com>

* Update research-result-page.zh-CN.md ()

Co-authored-by: mihaideyu <zxy1010414746@163.com>

* Update research-list-page.zh-CN.md ()

Co-authored-by: yingxirz <inseeing@gmail.com>

* fix doc

* Update research-message-and-feedback.zh-CN.md ()

* adjust home nav width

* Update research-message-and-feedback.zh-CN.md ()

* Update research-form-page.zh-CN.md ()

Co-authored-by: Golevka <huangsamfisher@163.com>

* patch file

* clean up

* update shadow.zh-CN

update shadow.zh-CN

* add shadow table

* Update visual.zh-CN.md ()

Co-authored-by: shuwenliu0116 <33922479+shuwenliu0116@users.noreply.github.com>

* Update docs/spec/shadow.zh-CN.md

Co-Authored-By: 偏右 <afc163@gmail.com>

* Update docs/spec/shadow.zh-CN.md

Co-Authored-By: 偏右 <afc163@gmail.com>

* Update docs/spec/shadow.zh-CN.md

Co-Authored-By: 偏右 <afc163@gmail.com>

* Update docs/spec/shadow.zh-CN.md

Co-Authored-By: 偏右 <afc163@gmail.com>

* Update docs/spec/shadow.zh-CN.md

Co-Authored-By: 偏右 <afc163@gmail.com>

* patch docs

* fix doc

* rm page suffix

* fix style

* mobile it

* Update resources.en-US.md ()

* chart res

* add qr code

* adjust qr

* Update visual.zh-CN.md ()

Co-authored-by: shuwenliu0116 <33922479+shuwenliu0116@users.noreply.github.com>

* fix site qr

* mobile height of it

* book update

* 3.x site link

* isMobile is new cnotext

* Update research-form.zh-CN.md ()

Co-authored-by: Golevka <huangsamfisher@163.com>

* adjust form doc

* mobile use link

* adjust order

* flush

* fix ts

* Update research-navigation.zh-CN.md ()

* Update research-navigation.zh-CN.md ()

* rm useless lines

* add mobile icon

* Update research-exception.zh-CN.md ()

* Update research-empty.zh-CN.md ()

* Update research-workbench.zh-CN.md

* Update visual.zh-CN.md

* adjust mobile icon

* Update research-message-and-feedback.zh-CN.md ()

* Update research-list.zh-CN.md ()

Co-authored-by: yingxirz <inseeing@gmail.com>

* Update research-workbench.zh-CN.md ()

Co-authored-by: yingxirz <inseeing@gmail.com>

* Update visual.zh-CN.md ()

Co-authored-by: shuwenliu0116 <33922479+shuwenliu0116@users.noreply.github.com>

* Update research-result.zh-CN.md ()

Co-authored-by: mihaideyu <zxy1010414746@163.com>

* Update research-form.zh-CN.md ()

* Update research-message-and-feedback.zh-CN.md ()

* Update research-list.zh-CN.md ()

Co-authored-by: yingxirz <inseeing@gmail.com>

* Update research-result.zh-CN.md ()

Co-authored-by: mihaideyu <zxy1010414746@163.com>

* update ref color

* update zip file

* fix mobile icon

* rm skip dark

* fix cat

* update zip link

* update zip link

Co-authored-by: Golevka <huangsamfisher@163.com>
Co-authored-by: mihaideyu <zxy1010414746@163.com>
Co-authored-by: yingxirz <inseeing@gmail.com>
Co-authored-by: 偏右 <afc163@gmail.com>
Co-authored-by: myeunhyuk <39618466+myeunhyuk@users.noreply.github.com>
Co-authored-by: minTilda <31951290+minTilda@users.noreply.github.com>
Co-authored-by: ziyuan-174774 <61226089+ziyuan-174774@users.noreply.github.com>
Co-authored-by: 竹尔 <54707870+AntDesigners@users.noreply.github.com>
Co-authored-by: shuwenliu0116 <33922479+shuwenliu0116@users.noreply.github.com>
2020-02-27 10:53:30 +08:00

107 lines
2.4 KiB
JavaScript

const path = require('path');
const homeTmpl = './template/Home/index';
const contentTmpl = './template/Content/index';
const resourcesTmpl = './template/Resources/index';
const appShellTmpl = './template/AppShell';
function pickerGenerator(module) {
const tester = new RegExp(`^docs/${module}`);
return markdownData => {
const { filename } = markdownData.meta;
if (tester.test(filename) && !/\/demo$/.test(path.dirname(filename))) {
return {
meta: markdownData.meta,
};
}
return null;
};
}
module.exports = {
lazyLoad(nodePath, nodeValue) {
if (typeof nodeValue === 'string') {
return true;
}
return nodePath.endsWith('/demo');
},
pick: {
components(markdownData) {
const { filename } = markdownData.meta;
if (!/^components/.test(filename) || /[/\\]demo$/.test(path.dirname(filename))) {
return null;
}
return {
meta: markdownData.meta,
};
},
changelog(markdownData) {
if (/CHANGELOG/.test(markdownData.meta.filename)) {
return {
meta: markdownData.meta,
};
}
return null;
},
'docs/react': pickerGenerator('react'),
'docs/spec': pickerGenerator('spec'),
},
plugins: [
'bisheng-plugin-description',
'bisheng-plugin-toc?maxDepth=2&keepElem',
'@ant-design/bisheng-plugin?injectProvider',
'bisheng-plugin-react?lang=__react',
],
routes: {
path: '/',
component: './template/Layout/index',
indexRoute: { component: homeTmpl },
childRoutes: [
{
path: 'app-shell',
component: appShellTmpl,
},
{
path: 'index-cn',
component: homeTmpl,
},
{
path: 'docs/react/:children',
component: contentTmpl,
},
{
path: 'changelog',
component: contentTmpl,
},
{
path: 'changelog-cn',
component: contentTmpl,
},
{
path: 'components/form/v3',
component: contentTmpl,
},
{
path: 'components/form/v3-cn',
component: contentTmpl,
},
{
path: 'components/:children/',
component: contentTmpl,
},
{
path: 'docs/spec/:children',
component: contentTmpl,
},
{
path: 'docs/resources',
component: resourcesTmpl,
},
{
path: 'docs/resources-cn',
component: resourcesTmpl,
},
],
},
};