docs: site build script update (#32984)
* chore: rm color-less * refactor: MV theme to variable * docs: fix header * chore: clean up * chore: enable esbuildpull/32992/head
parent
37442ae0d5
commit
b926c535ea
@ -1,50 +0,0 @@
|
||||
#!/usr/bin/env node
|
||||
const path = require('path');
|
||||
const { generateTheme } = require('antd-theme-generator');
|
||||
const genCss = require('antd-pro-merge-less');
|
||||
const defaultVar = require('./default-vars');
|
||||
const dark = require('./dark-vars');
|
||||
const compact = require('./compact-vars');
|
||||
|
||||
genCss(
|
||||
path.join(__dirname, '..'),
|
||||
[
|
||||
{
|
||||
theme: 'dark',
|
||||
fileName: './_site/dark.css',
|
||||
modifyVars: {
|
||||
...defaultVar,
|
||||
...dark,
|
||||
'@site-text-color': '@heading-color',
|
||||
'@site-markdown-code-bg': '@input-bg',
|
||||
},
|
||||
},
|
||||
{
|
||||
theme: 'compact',
|
||||
fileName: './_site/compact.css',
|
||||
modifyVars: {
|
||||
...defaultVar,
|
||||
...compact,
|
||||
},
|
||||
},
|
||||
],
|
||||
{
|
||||
ignoreAntd: true,
|
||||
isModule: false,
|
||||
cache: false,
|
||||
loadAny: true,
|
||||
ignoreProLayout: true,
|
||||
},
|
||||
);
|
||||
|
||||
const options = {
|
||||
antDir: path.join(__dirname, '../node_modules/antd'),
|
||||
stylesDir: path.join(__dirname, '../site/theme/static'),
|
||||
antdStylesDir: path.join(__dirname, '../node_modules/antd/lib/'),
|
||||
varFile: path.join(__dirname, '../site/theme/static/theme.less'),
|
||||
mainLessFile: path.join(__dirname, '../site/theme/static/index.less'),
|
||||
themeVariables: ['@primary-color'],
|
||||
outputFilePath: path.join(__dirname, '../_site/color.less'),
|
||||
};
|
||||
|
||||
generateTheme(options);
|
@ -0,0 +1,19 @@
|
||||
/**
|
||||
* ZombieJ: This file is used for generate site theme css only. Which only provides dark.css and
|
||||
* compact.css for theme switcher.
|
||||
*/
|
||||
const config = require('./index');
|
||||
|
||||
const homeTmpl = './template/Home/index';
|
||||
|
||||
const cloneConfig = {
|
||||
...config,
|
||||
};
|
||||
|
||||
cloneConfig.routes = {
|
||||
path: '/',
|
||||
component: './template/Layout/index',
|
||||
indexRoute: { component: homeTmpl },
|
||||
};
|
||||
|
||||
module.exports = cloneConfig;
|
@ -1,26 +1,27 @@
|
||||
@import '../../../components/style/themes/index.less';
|
||||
|
||||
@import './reset.less';
|
||||
@import '../../../components/style/themes/variable.less';
|
||||
@import './common';
|
||||
@import './header';
|
||||
@import './footer';
|
||||
@import './home';
|
||||
@import './page-nav';
|
||||
@import './markdown';
|
||||
@import './design-doc';
|
||||
@import './preview-img';
|
||||
@import './toc';
|
||||
@import './not-found';
|
||||
@import './highlight';
|
||||
@import './demo';
|
||||
@import './colors';
|
||||
@import './icons';
|
||||
@import './icon-pic-searcher';
|
||||
@import './mock-browser';
|
||||
@import './motion';
|
||||
@import './responsive';
|
||||
@import './theme';
|
||||
@import './docsearch';
|
||||
@import './nprogress';
|
||||
@import './contributors';
|
||||
@import './common.less';
|
||||
@import './header.less';
|
||||
@import './footer.less';
|
||||
@import './home.less';
|
||||
@import './page-nav.less';
|
||||
@import './markdown.less';
|
||||
@import './design-doc.less';
|
||||
@import './preview-img.less';
|
||||
@import './toc.less';
|
||||
@import './not-found.less';
|
||||
@import './highlight.less';
|
||||
@import './demo.less';
|
||||
@import './colors.less';
|
||||
@import './icons.less';
|
||||
@import './icon-pic-searcher.less';
|
||||
@import './mock-browser.less';
|
||||
@import './motion.less';
|
||||
@import './responsive.less';
|
||||
@import './theme.less';
|
||||
@import './docsearch.less';
|
||||
@import './nprogress.less';
|
||||
@import './contributors.less';
|
||||
@import './dark.less';
|
||||
@import './rtl.less';
|
||||
|
Loading…
Reference in New Issue