Skip to content
This repository was archived by the owner on Nov 8, 2022. It is now read-only.

Commit 06afde8

Browse files
committed
chore: merge branch 'dev'
2 parents 7e64b1d + 15e5b38 commit 06afde8

File tree

5 files changed

+70
-48
lines changed

5 files changed

+70
-48
lines changed

config/next_offline.js

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
// Cache strategies
2+
// By default next-offline will precache all the Next.js webpack emitted files and the user-defined static ones (inside /static)
3+
// see more: https://github.com/hanford/next-offline
4+
5+
module.exports = {
6+
workboxOpts: {
7+
runtimeCaching: [
8+
{
9+
urlPattern: /\.(?:png|gif|jpg|jpeg|svg)$/,
10+
handler: 'CacheFirst',
11+
options: {
12+
cacheName: 'images',
13+
expiration: {
14+
maxAgeSeconds: 7 * 24 * 60 * 60, // 7 Days
15+
},
16+
},
17+
},
18+
{
19+
urlPattern: /\.(?:css)$/,
20+
handler: 'StaleWhileRevalidate',
21+
},
22+
{
23+
// github avatars
24+
urlPattern: /^https:\/\/avatars2\.githubusercontent\.com/,
25+
handler: 'CacheFirst',
26+
options: {
27+
cacheName: 'github-images',
28+
expiration: {
29+
maxAgeSeconds: 7 * 24 * 60 * 60, // 7 Days
30+
},
31+
},
32+
},
33+
{
34+
// google fonts
35+
urlPattern: /^https:\/\/fonts\.googleapis\.com/,
36+
handler: 'CacheFirst',
37+
},
38+
{
39+
// google fonts
40+
urlPattern: /^https:\/\/fonts\.gstatic\.com/,
41+
handler: 'CacheFirst',
42+
},
43+
{
44+
// staticfile cdn
45+
urlPattern: /^https:\/\/cdn\.staticfile\.org/,
46+
handler: 'CacheFirst',
47+
},
48+
{
49+
// antd fonts
50+
urlPattern: /^https:\/\/at\.alicdn\.com/,
51+
handler: 'CacheFirst',
52+
},
53+
{
54+
// ali cdn
55+
urlPattern: /^https:\/\/gosspublic\.alicdn\.com/,
56+
handler: 'CacheFirst',
57+
},
58+
{
59+
// ali cdn
60+
urlPattern: /^https:\/\/a\.alipayobjects\.com/,
61+
handler: 'CacheFirst',
62+
},
63+
],
64+
},
65+
}
File renamed without changes.

containers/ThemeWrapper/MarkDownStyle.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -346,7 +346,7 @@ const MarkDownStyle = styled.div`
346346
margin-bottom: 0;
347347
font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, Courier,
348348
monospace;
349-
font-size: 12px;
349+
font-size: 1.2rem;
350350
}
351351
352352
.markdown-body .octicon {

next.config.js

Lines changed: 3 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ const withOffline = require('next-offline')
1313
const withBundleAnalyzer = require('@next/bundle-analyzer')({
1414
enabled: process.env.ANALYZE === 'true',
1515
})
16+
17+
const offlineConfig = require('./config/next_offline')
1618
// next-plugins end
1719

1820
const nextConfig = {
@@ -68,52 +70,7 @@ module.exports = withPlugins(
6870
withProgressBar,
6971
withBundleAnalyzer,
7072
withSourceMaps,
71-
[
72-
withOffline,
73-
// Cache strategies
74-
// By default next-offline will precache all the Next.js webpack emitted files and the user-defined static ones (inside /static)
75-
// see more: https://github.com/hanford/next-offline
76-
{
77-
workboxOpts: {
78-
runtimeCaching: [
79-
{
80-
urlPattern: /\.(?:png|gif|jpg|jpeg|svg)$/,
81-
handler: 'CacheFirst',
82-
options: {
83-
cacheName: 'images',
84-
expiration: {
85-
maxAgeSeconds: 7 * 24 * 60 * 60, // 7 Days
86-
},
87-
},
88-
},
89-
{
90-
urlPattern: /\.(?:css)$/,
91-
handler: 'StaleWhileRevalidate',
92-
},
93-
{
94-
// google fonts
95-
urlPattern: /^https:\/\/fonts\.googleapis\.com/,
96-
handler: 'CacheFirst',
97-
},
98-
{
99-
// staticfile cdn
100-
urlPattern: /^https:\/\/cdn\.staticfile\.org/,
101-
handler: 'CacheFirst',
102-
},
103-
{
104-
// ali cdn
105-
urlPattern: /^https:\/\/gosspublic\.alicdn\.com/,
106-
handler: 'CacheFirst',
107-
},
108-
{
109-
// ali cdn
110-
urlPattern: /^https:\/\/a\.alipayobjects\.com/,
111-
handler: 'CacheFirst',
112-
},
113-
],
114-
},
115-
},
116-
],
73+
[withOffline, offlineConfig],
11774
],
11875
nextConfig
11976
)

pages/_app.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import NextSeo from 'next-seo'
1111
* that will apply to every page. Full info on how the default works
1212
* can be found here: https://github.com/garmeeh/next-seo#default-seo-configuration
1313
*/
14-
import SEO from '../next-seo.config'
14+
import SEO from '../config/next_seo'
1515

1616
const { Sentry, captureException } = sentry({
1717
release: process.env.SENTRY_RELEASE,

0 commit comments

Comments
 (0)