-
Notifications
You must be signed in to change notification settings - Fork 44
/
Copy path.umirc.ts
90 lines (89 loc) · 2.45 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
78
79
80
81
82
83
84
85
86
87
88
89
90
import { defineConfig } from 'umi';
export default defineConfig({
plugins: [
'@umijs/plugins/dist/analytics',
'@umijs/plugins/dist/styled-components',
'@umijs/plugins/dist/react-query',
'umi-plugin-docaid',
],
links: [
{
rel: 'alternate',
type: 'application/rss+xml',
title: 'MDH Weekly 前端周刊',
href: 'https://mdhweekly.com/rss.xml',
},
],
analytics: {
ga_v2: 'G-JJ5DHZ4KZ9',
},
styledComponents: {},
reactQuery: {},
docaid: {
title: 'MDH Weekly 前端周刊',
headTitle: 'MDH Weekly',
siteUrl: 'https://mdhweekly.com/',
// @ts-ignore
transform(doc: any) {
const numberStr = doc.file.match(/issue-(\d+)\.md/)![1];
return {
...doc,
metaTitle: `第 ${numberStr} 期:${doc.title}`,
number: parseInt(numberStr, 10),
numberStr,
html: `
${doc.html}
<h2>小结</h2>
<p>
如果你喜欢 MDH 前端周刊,请转发给你的朋友,告诉他们
<a href="https://mp.weixin.qq.com/s?__biz=MjM5NDgyODI4MQ%3D%3D&mid=2247484802&idx=1&sn=caa84339125510680d435a40280a6600#wechat_redirect">
到这里来订阅
</a>
,这是对我最大的帮助。下期见!
</p>
<p
style="color: #b5495b"
>
MDH,让开发者有笑容 :)
</p>
`.trim(),
};
},
navs: [
{ title: '往期周刊', path: '/weekly' },
{ title: '知识星球', href: 'https://q.sorrycc.com/' },
{ title: '深度文章 RSS', href: '/articles.xml' },
{ title: 'RSS', href: '/rss.xml' },
{ title: 'Github', href: 'https://github.com/sorrycc/weekly' },
],
copyright: 'MDH Weekly since 2021',
rss: {
weekly: {
default: true,
feedOpts: {
image:
'https://img.alicdn.com/imgextra/i3/O1CN01uKTVpD1UK8BCxFBwo_!!6000000002498-2-tps-500-500.png',
copyright: 'MDH Weekly since 2021',
author: {
name: 'Chen Cheng',
email: '[email protected]',
link: 'https://sorrycc.com/',
},
},
transform(data: any, { doc }: any) {
return {
...data,
title: `第 ${doc.numberStr} 期:${doc.title}`,
};
},
},
},
},
favicons: [
'https://img.alicdn.com/imgextra/i3/O1CN01uKTVpD1UK8BCxFBwo_!!6000000002498-2-tps-500-500.png',
],
// why set false?
// 开启后,会拦截 .json 请求,然后访问 /posts.json 会一直走缓存不生效
mfsu: false,
hash: true,
});