-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathdoczrc.js
More file actions
58 lines (48 loc) · 1.26 KB
/
doczrc.js
File metadata and controls
58 lines (48 loc) · 1.26 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
// doczrc.js
const fs = require('fs');
const path = require('path');
function fix(dest, src) {
if(fs.existsSync(dest)) {
const themeContent = fs.readFileSync(dest, {encoding: 'utf-8'});
if(!themeContent.startsWith('// need to fix')) {
const fixContent = fs.readFileSync(src, {encoding: 'utf-8'});
fs.writeFileSync(dest, fixContent);
}
}
}
function loadMenu() {
try {
return require('./src/docs/menurc.js');
} catch(ex) {
return require('../src/docs/menurc.js');
}
}
const themePath = path.join(__dirname, 'node_modules/gatsby-theme-docz/gatsby-config.js');
const fixThemeFile = path.join(__dirname, 'gatsby-config.fix.js');
fix(themePath, fixThemeFile);
const doczCorePath = path.join(__dirname, 'node_modules/docz-core/dist/index.js');
const fixDoczCoreFile = path.join(__dirname, 'docz-core.fix.js');
fix(doczCorePath, fixDoczCoreFile);
export default {
title: '稀土教程',
themeConfig: {
// initialColorMode: 'dark',
styles: {
h1: {
marginBottom: '2rem',
},
p: {
fontSize: 16,
},
li: {
fontSize: 16,
}
}
},
// base: '/courses/',
files: 'src/**/*.{md,markdown,mdx}',
src: 'src',
editBranch: 'main',
/* 设置菜单顺序 */
menu: loadMenu(),
}