-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy path.umirc.ts
77 lines (75 loc) · 2.22 KB
/
.umirc.ts
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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
const packages = require('./package.json');
export default {
publicPath: `/`,
exportStatic: {},
dynamicImport: {},
mode: 'site',
title: 'packjs',
logo: '/logo.svg',
favicon: '/favicon.svg',
locales: [['zh-CN', '中文']],
navs: [
{
title: '指南',
path: 'guides',
},
{
title: '配置',
path: 'configs',
},
// {
// title: '历史版本',
// children: [
// {
// title: 'v2.x',
// path: '/v2/',
// },
// {
// title: 'v1.x',
// path: '/v1/',
// },
// ],
// },
// { title: 'GitHub', path: 'https://github.com/tageecc/packjs' },
],
// menus: {
// '*': [],
// '/v2': [
// { title: 'start', path: 'v2/guides/start.md' },
// { title: 'faq', path: 'v2/guides/faq.md' },
// ],
// '/v2/guides/start': [
// { title: 'start', path: 'v2/guides/start.md' },
// { title: 'faq', path: 'v2/guides/faq.md' },
// ],
// },
links: [{ rel: 'stylesheet', href: '/style.css' }],
headScripts: [
'https://www.googletagmanager.com/gtag/js?id=G-ZNJQM7Q9TP',
`window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'G-ZNJQM7Q9TP');`,
`
const customInspect = function(){
const dom = document.createElement('span');
dom.id = 'logo-version';
dom.innerHTML = '${packages.version}';
const logo = document.querySelector('.__dumi-default-navbar-logo');
if(logo){
logo.parentNode.insertBefore(dom, logo.nextSibling);
if(/\\/v\\d\\//.test(location.href)){
logo.onclick=function(){location.href=location.href.replace(/(v\\d\\/)(.+)$/,"$1")}
}else{
logo.onclick=function(){location.href="/v2"}
}
}else{
setTimeout(()=>{
customInspect();
}, 100)
}
}
customInspect();
`,
],
};