-
Notifications
You must be signed in to change notification settings - Fork 0
/
redirects.ts
172 lines (167 loc) · 15.6 KB
/
redirects.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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
// 支持在 generate 阶段生成重定向配置,为了在免费版 CloudFlare Pages 上实现重定向功能
const redirects: { [path: string]: { redirect: { to: string, statusCode?: number } } } = {
// page redirects
'/page/2': { redirect: { to: '/archives', statusCode: 301 } },
'/page/3': { redirect: { to: '/archives', statusCode: 301 } },
'/page/4': { redirect: { to: '/archives', statusCode: 301 } },
'/page/5': { redirect: { to: '/archives', statusCode: 301 } },
'/page/6': { redirect: { to: '/archives', statusCode: 301 } },
'/page/7': { redirect: { to: '/archives', statusCode: 301 } },
'/page/8': { redirect: { to: '/archives', statusCode: 301 } },
'/page/9': { redirect: { to: '/archives', statusCode: 301 } },
// tag redirects
'/tag/a-li-yun': { redirect: { to: '/tags/阿里云', statusCode: 301 } },
'/tag/android': { redirect: { to: '/tags/Android', statusCode: 301 } },
'/tag/asp-net': { redirect: { to: '/tags/.NET', statusCode: 301 } },
'/tag/cdn': { redirect: { to: '/tags/DevOps', statusCode: 301 } },
'/tag/centos': { redirect: { to: '/tags/Linux', statusCode: 301 } },
'/tag/ci': { redirect: { to: '/tags/DevOps', statusCode: 301 } },
'/tag/csharp': { redirect: { to: '/tags/.NET', statusCode: 301 } },
'/tag/devops': { redirect: { to: '/tags/DevOps', statusCode: 301 } },
'/tag/docker': { redirect: { to: '/tags/Docker', statusCode: 301 } },
'/tag/dotnet': { redirect: { to: '/tags/.NET', statusCode: 301 } },
'/tag/ef': { redirect: { to: '/tags/.NET', statusCode: 301 } },
'/tag/essay': { redirect: { to: '/tags/随笔', statusCode: 301 } },
'/tag/frontend': { redirect: { to: '/tags/前端', statusCode: 301 } },
'/tag/ghost-blog': { redirect: { to: '/tags/Ghost', statusCode: 301 } },
'/tag/gitlab': { redirect: { to: '/tags/DevOps', statusCode: 301 } },
'/tag/https': { redirect: { to: '/tags/DevOps', statusCode: 301 } },
'/tag/iis': { redirect: { to: '/tags/DevOps', statusCode: 301 } },
'/tag/kubernetes': { redirect: { to: '/tags/k8s', statusCode: 301 } },
'/tag/life': { redirect: { to: '/tags/生活', statusCode: 301 } },
'/tag/log': { redirect: { to: '/tags/日志', statusCode: 301 } },
'/tag/ops': { redirect: { to: '/tags/DevOps', statusCode: 301 } },
'/tag/others': { redirect: { to: '/archives', statusCode: 301 } },
'/tag/python': { redirect: { to: '/tags/Python', statusCode: 301 } },
'/tag/qun-hui': { redirect: { to: '/tags/群晖', statusCode: 301 } },
'/tag/shi-ci': { redirect: { to: '/tags/诗词', statusCode: 301 } },
'/tag/ssl': { redirect: { to: '/tags/DevOps', statusCode: 301 } },
'/tag/summary': { redirect: { to: '/tags/小结', statusCode: 301 } },
'/tag/tech': { redirect: { to: '/tags/技术', statusCode: 301 } },
'/tag/thought': { redirect: { to: '/tags/思考', statusCode: 301 } },
'/tag/tool': { redirect: { to: '/tags/工具', statusCode: 301 } },
'/tag/visual-studio': { redirect: { to: '/tags/.NET', statusCode: 301 } },
'/tag/vlog': { redirect: { to: '/tags/Vlog', statusCode: 301 } },
'/tag/wechat': { redirect: { to: '/tags/前端', statusCode: 301 } },
'/tag/you-xi': { redirect: { to: '/tags/游戏', statusCode: 301 } },
// post redirects
// very old path with date
'/2013-winter-holiday-plan': { redirect: { to: '/posts/2013-winter-holiday-plan', statusCode: 301 } },
'/2013/10/03/fix-chinese-url-in-wordpress-in-iis/': { redirect: { to: '/posts/fix-chinese-url-in-wordpress-in-iis', statusCode: 301 } },
'/2014-beginning': { redirect: { to: '/posts/2014-beginning', statusCode: 301 } },
'/2015-start-working': { redirect: { to: '/posts/2015-start-working', statusCode: 301 } },
'/2015/03/17/entity-framework-code-first-two-foreign-keys-from-same-table/': { redirect: { to: '/posts/entity-framework-code-first-two-foreign-keys-from-same-table', statusCode: 301 } },
'/2015/03/23/authenticationmanager-signout': { redirect: { to: '/posts/authenticationmanager-signout-not-working', statusCode: 301 } },
'/2015/04/13/fix-fixed-bug-in-ios-when-call-virtual-keyboards': { redirect: { to: '/posts/fix-fixed-bug-in-ios-when-call-virtual-keyboards', statusCode: 301 } },
'/2016/11/09/aliyun-cdn-not-support-sni/': { redirect: { to: '/posts/aliyun-cdn-not-support-sni', statusCode: 301 } },
'/2017/11/16/wxapp-ssl-error/': { redirect: { to: '/posts/wxapp-ssl-error', statusCode: 301 } },
'/about-paipai': { redirect: { to: '/posts/about-paipai', statusCode: 301 } },
'/aliyun-cdn-not-support-sni': { redirect: { to: '/posts/aliyun-cdn-not-support-sni', statusCode: 301 } },
'/android-unit-test': { redirect: { to: '/posts/android-unit-test', statusCode: 301 } },
'/android-webview-picture-cache': { redirect: { to: '/posts/android-webview-picture-cache', statusCode: 301 } },
'/android-wifi-connection': { redirect: { to: '/posts/android-wifi-connection', statusCode: 301 } },
'/asp-net-core-ef-sqlite-add-foreign-key-to-exist-table': { redirect: { to: '/posts/asp-net-core-ef-sqlite-add-foreign-key-to-exist-table', statusCode: 301 } },
'/asp-net-core-first-experience': { redirect: { to: '/posts/asp-net-core-first-experience', statusCode: 301 } },
'/at-the-crossroads-of-life': { redirect: { to: '/posts/at-the-crossroads-of-life', statusCode: 301 } },
'/audiowave-animation': { redirect: { to: '/posts/audiowave-animation', statusCode: 301 } },
'/authenticationmanager-signout-not-working': { redirect: { to: '/posts/authenticationmanager-signout-not-working', statusCode: 301 } },
'/bad-request-invalid-hostname': { redirect: { to: '/posts/bad-request-invalid-hostname', statusCode: 301 } },
'/baixiang-poems': { redirect: { to: '/posts/baixiang-poems', statusCode: 301 } },
'/batch-edit-acl-for-oss': { redirect: { to: '/posts/batch-edit-acl-for-oss', statusCode: 301 } },
'/beginning-of-2021': { redirect: { to: '/posts/beginning-of-2021', statusCode: 301 } },
'/best-game-red-dead-redemption-2': { redirect: { to: '/posts/best-game-red-dead-redemption-2', statusCode: 301 } },
'/brief-summary': { redirect: { to: '/posts/brief-summary', statusCode: 301 } },
'/celebrate-19th-national-congress': { redirect: { to: '/posts/celebrate-19th-national-congress', statusCode: 301 } },
'/centos-wire-ieee8021x-config': { redirect: { to: '/posts/centos-wire-ieee8021x-config', statusCode: 301 } },
'/change-domain-in-weixin': { redirect: { to: '/posts/change-domain-in-weixin', statusCode: 301 } },
'/could-not-load-file-or-assembly': { redirect: { to: '/posts/could-not-load-file-or-assembly', statusCode: 301 } },
'/csharp-get-ipaddress': { redirect: { to: '/posts/csharp-get-ipaddress', statusCode: 301 } },
'/devops-gitlab-ci-aliyun-k8s': { redirect: { to: '/posts/devops-gitlab-ci-aliyun-k8s', statusCode: 301 } },
'/diary-of-waiting-for-baby-born': { redirect: { to: '/posts/diary-of-waiting-for-baby-born', statusCode: 301 } },
'/docker-registry-auth-with-same-domain': { redirect: { to: '/posts/docker-registry-auth-with-same-domain', statusCode: 301 } },
'/dockerfile-maven': { redirect: { to: '/posts/dockerfile-maven', statusCode: 301 } },
'/empty-your-self': { redirect: { to: '/posts/empty-your-self', statusCode: 301 } },
'/entity-framework-code-first-two-foreign-keys-from-same-table': { redirect: { to: '/posts/entity-framework-code-first-two-foreign-keys-from-same-table', statusCode: 301 } },
'/essay': { redirect: { to: '/posts/essay-20180301', statusCode: 301 } },
'/fastboot-failed-remote-operation-not-permitted': { redirect: { to: '/posts/fastboot-failed-remote-operation-not-permitted', statusCode: 301 } },
'/fighting-2020': { redirect: { to: '/posts/fighting-2020', statusCode: 301 } },
'/fix-chinese-url-in-wordpress-in-iis': { redirect: { to: '/posts/fix-chinese-url-in-wordpress-in-iis', statusCode: 301 } },
'/fix-fixed-bug-in-ios-when-call-virtual-keyboards': { redirect: { to: '/posts/fix-fixed-bug-in-ios-when-call-virtual-keyboards', statusCode: 301 } },
'/forbid-index-of-your-host': { redirect: { to: '/posts/forbid-index-of-your-host', statusCode: 301 } },
'/frontend-components-and-docker-deploy': { redirect: { to: '/posts/frontend-components-and-docker-deploy', statusCode: 301 } },
'/get-video-rotation-by-mp4box-js': { redirect: { to: '/posts/get-video-rotation-by-mp4box-js', statusCode: 301 } },
'/ghost-docker-mail-config': { redirect: { to: '/posts/ghost-docker-mail-config', statusCode: 301 } },
'/gitlab-ci-auto-deploy-python-lib': { redirect: { to: '/posts/gitlab-ci-auto-deploy-python-lib', statusCode: 301 } },
'/good-bye-mylo': { redirect: { to: '/posts/good-bye-mylo', statusCode: 301 } },
'/good-bye-newegg': { redirect: { to: '/posts/good-bye-newegg', statusCode: 301 } },
'/hadb-me-back': { redirect: { to: '/posts/hadb-me-back', statusCode: 301 } },
'/hello-osmo-pocket': { redirect: { to: '/posts/hello-osmo-pocket', statusCode: 301 } },
'/hexo-with-travis-ci': { redirect: { to: '/posts/hexo-with-travis-ci', statusCode: 301 } },
'/how-to-become-a-fullstack-developer': { redirect: { to: '/posts/how-to-become-a-fullstack-developer', statusCode: 301 } },
'/how-to-modify-windows-library-icon': { redirect: { to: '/posts/how-to-modify-windows-library-icon', statusCode: 301 } },
'/how_to_delete_web_service_of_synology_dsm_7_2': { redirect: { to: '/posts/how-to-delete-web-service-of-synology-dsm-7-2', statusCode: 301 } },
'/icbc-plugin-cause-blank-line-in-chrome': { redirect: { to: '/posts/icbc-plugin-cause-blank-line-in-chrome', statusCode: 301 } },
'/japanese-cuisine-team-building': { redirect: { to: '/posts/japanese-cuisine-team-building', statusCode: 301 } },
'/jiankongbao': { redirect: { to: '/posts/jiankongbao', statusCode: 301 } },
'/k8s-cert-manager-tls': { redirect: { to: '/posts/k8s-cert-manager-tls', statusCode: 301 } },
'/move-duoshuo-comments': { redirect: { to: '/posts/move-duoshuo-comments', statusCode: 301 } },
'/nas': { redirect: { to: '/posts/nas', statusCode: 301 } },
'/new-blog-theme': { redirect: { to: '/posts/new-blog-theme', statusCode: 301 } },
'/old-friend-dinner': { redirect: { to: '/posts/old-friend-dinner', statusCode: 301 } },
'/plan-b': { redirect: { to: '/posts/plan-b', statusCode: 301 } },
'/post-views-for-wordpress-themes': { redirect: { to: '/posts/post-views-for-wordpress-themes', statusCode: 301 } },
'/publishing-asp-net-core-to-iis-with-web-deploy-using-visual-studio': { redirect: { to: '/posts/publishing-asp-net-core-to-iis-with-web-deploy-using-visual-studio', statusCode: 301 } },
'/qiniu-ssl-certificate-expire-problem': { redirect: { to: '/posts/qiniu-ssl-certificate-expire-problem', statusCode: 301 } },
'/redis-windows-sentinel': { redirect: { to: '/posts/redis-windows-sentinel', statusCode: 301 } },
'/review-2021-and-look-forward-to-2022': { redirect: { to: '/posts/review-2021-and-look-forward-to-2022', statusCode: 301 } },
'/rumengling': { redirect: { to: '/posts/rumengling', statusCode: 301 } },
'/self-reflection-about-lazy-and-friendship': { redirect: { to: '/posts/self-reflection-about-lazy-and-friendship', statusCode: 301 } },
'/server-migration-finished': { redirect: { to: '/posts/server-migration-finished', statusCode: 301 } },
'/set-eclipse-juno-for-android': { redirect: { to: '/posts/set-eclipse-juno-for-android', statusCode: 301 } },
'/set-win8-explorer-to-my-computer': { redirect: { to: '/posts/set-win8-explorer-to-my-computer', statusCode: 301 } },
'/several-intent-filters-in-one-activity': { redirect: { to: '/posts/several-intent-filters-in-one-activity', statusCode: 301 } },
'/shanghai-luohu': { redirect: { to: '/posts/shanghai-luohu', statusCode: 301 } },
'/show-computer-on-desktop-in-windows-server': { redirect: { to: '/posts/show-computer-on-desktop-in-windows-server', statusCode: 301 } },
'/small-black-dog': { redirect: { to: '/posts/small-black-dog', statusCode: 301 } },
'/snaps-to-device-pixels': { redirect: { to: '/posts/snaps-to-device-pixels', statusCode: 301 } },
'/solve-pycharm-adding-pipenv-error': { redirect: { to: '/posts/solve-pycharm-adding-pipenv-error', statusCode: 301 } },
'/sqlite-error-no-such-table': { redirect: { to: '/posts/sqlite-error-no-such-table', statusCode: 301 } },
'/start-of-2018': { redirect: { to: '/posts/start-of-2018', statusCode: 301 } },
'/story-of-xiaohei': { redirect: { to: '/posts/story-of-xiaohei', statusCode: 301 } },
'/sublime-text-2-supergood-code-editor': { redirect: { to: '/posts/sublime-text-2-supergood-code-editor', statusCode: 301 } },
'/summer-summary': { redirect: { to: '/posts/summer-summary', statusCode: 301 } },
'/synology-letsencrypt-multiple-domain-cert-configuration': { redirect: { to: '/posts/synology-letsencrypt-multiple-domain-cert-configuration', statusCode: 301 } },
'/the-end-of-2015': { redirect: { to: '/posts/the-end-of-2015', statusCode: 301 } },
'/thief-came-into-my-house': { redirect: { to: '/posts/thief-came-into-my-house', statusCode: 301 } },
'/thoughts-about-growth': { redirect: { to: '/posts/thoughts-about-growth', statusCode: 301 } },
'/thoughts-about-the-future': { redirect: { to: '/posts/thoughts-about-the-future', statusCode: 301 } },
'/thoughts-about-value': { redirect: { to: '/posts/thoughts-about-value', statusCode: 301 } },
'/three-small-things': { redirect: { to: '/posts/three-small-things', statusCode: 301 } },
'/timedrotatingfilehandler-backupcount-problem': { redirect: { to: '/posts/timedrotatingfilehandler-backupcount-problem', statusCode: 301 } },
'/tomorrow-go-back-to-school-to-finish-my-winter-life': { redirect: { to: '/posts/tomorrow-go-back-to-school-to-finish-my-winter-life', statusCode: 301 } },
'/transfer-blog-to-aliyun-docker': { redirect: { to: '/posts/transfer-blog-to-aliyun-docker', statusCode: 301 } },
'/try-mono-for-android': { redirect: { to: '/posts/try-mono-for-android', statusCode: 301 } },
'/type-initialization-exception': { redirect: { to: '/posts/type-initialization-exception', statusCode: 301 } },
'/ubuntu-mp3-messy-code': { redirect: { to: '/posts/ubuntu-mp3-messy-code', statusCode: 301 } },
'/uninstall-orbit-plugin-for-chrome': { redirect: { to: '/posts/uninstall-orbit-plugin-for-chrome', statusCode: 301 } },
'/upgrade-ghost-5-0-to-5-42': { redirect: { to: '/posts/upgrade-ghost-5-0-to-5-42', statusCode: 301 } },
'/upgrade-to-net-core-app-1-0-1-problem': { redirect: { to: '/posts/upgrade-to-net-core-app-1-0-1-problem', statusCode: 301 } },
'/use-custom-domain-for-hexo-on-github': { redirect: { to: '/posts/use-custom-domain-for-hexo-on-github', statusCode: 301 } },
'/use-gitlab-to-deploy-ghost-theme-automatically': { redirect: { to: '/posts/use-gitlab-to-deploy-ghost-theme-automatically', statusCode: 301 } },
'/use-wds-to-cover-your-house-with-wifi': { redirect: { to: '/posts/use-wds-to-cover-your-house-with-wifi', statusCode: 301 } },
'/using-ghost': { redirect: { to: '/posts/using-ghost', statusCode: 301 } },
'/using-of-android-cleartaskonlaunch': { redirect: { to: '/posts/using-of-android-cleartaskonlaunch', statusCode: 301 } },
'/vs2015-installer-not-work-in-windows-xp': { redirect: { to: '/posts/vs2015-installer-not-work-in-windows-xp', statusCode: 301 } },
'/web-deploy': { redirect: { to: '/posts/web-deploy', statusCode: 301 } },
'/webkit-white-spacenowrap': { redirect: { to: '/posts/webkit-white-spacenowrap', statusCode: 301 } },
'/win8-app-develop-study-design-logo': { redirect: { to: '/posts/win8-app-develop-study-design-logo', statusCode: 301 } },
'/windows-close-monitor-tool': { redirect: { to: '/posts/windows-close-monitor-tool', statusCode: 301 } },
'/written-at-the-end-of-march': { redirect: { to: '/posts/written-at-the-end-of-march', statusCode: 301 } },
'/wxapp-ssl-error': { redirect: { to: '/posts/wxapp-ssl-error', statusCode: 301 } },
}
for (const [_path, config] of Object.entries(redirects)) {
if (config.redirect?.to) {
config.redirect.to = encodeURI(config.redirect.to)
}
}
export default redirects