-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathappConfig.js
202 lines (200 loc) · 4.7 KB
/
appConfig.js
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
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
export const APP_CONFIG = {
META: {
name: 'Memrise',
description: 'Boost your memory by matching the tiles',
shortDescription: 'Boost your memory',
keywords: 'memrise, matchup game, memory booster',
app: {
background: '#26323b',
},
social: {
twitter: '@Fateh_AK_',
},
},
CLOUDFLARE_ANALYTICS_TOKEN: '9c2a66de92e84a38a387f978e0be99dc',
PROD_BASE_URL: 'https://memrise.pages.dev',
};
export const META_TAGS = [
{
name: 'keywords',
content: APP_CONFIG.META.keywords,
},
{
name: 'name',
content: `${APP_CONFIG.META.name} • ${APP_CONFIG.META.shortDescription}`,
},
{
name: 'description',
content: APP_CONFIG.META.description,
},
{
name: 'image',
content: `${APP_CONFIG.PROD_BASE_URL}/banner.png`,
},
// Open Graph tags
{
property: 'og:title',
content: `${APP_CONFIG.META.name} • ${APP_CONFIG.META.shortDescription}`,
},
{
property: 'og:description',
content: APP_CONFIG.META.description,
},
{
property: 'og:image',
content: `${APP_CONFIG.PROD_BASE_URL}/banner.png`,
},
{
property: 'og:url',
content: APP_CONFIG.PROD_BASE_URL,
},
{
property: 'og:type',
content: 'website',
},
// Twitter tags
{
name: 'twitter:card',
content: 'summary_large_image',
},
{
name: 'twitter:site',
content: APP_CONFIG.META.social.twitter,
},
{
name: 'twitter:creator',
content: APP_CONFIG.META.social.twitter,
},
{
name: 'twitter:title',
content: `${APP_CONFIG.META.name} • ${APP_CONFIG.META.shortDescription}`,
},
{
name: 'twitter:description',
content: APP_CONFIG.META.description,
},
{
name: 'twitter:image',
content: `${APP_CONFIG.PROD_BASE_URL}/banner.png`,
},
// Add to homescreen for Chrome on Android. Fallback for PWA
{
name: 'application-name',
content: APP_CONFIG.META.name,
},
// Windows phone tile icon
{
name: 'msapplication-TileImage',
content: `${APP_CONFIG.PROD_BASE_URL}/icon.png`,
},
{
name: 'msapplication-TileColor',
content: APP_CONFIG.META.app.background,
},
{
name: 'msapplication-tap-highlight',
content: 'no',
},
// iOS Safari
{
name: 'apple-mobile-web-app-title',
content: APP_CONFIG.META.name,
},
{
name: 'apple-mobile-web-app-capable',
content: 'yes',
},
{
name: 'apple-mobile-web-app-status-bar-style',
content: 'black',
},
// PWA
{
name: 'theme-color',
content: APP_CONFIG.META.app.background,
},
{
name: 'mask-icon',
content: '/icon.png',
color: APP_CONFIG.META.app.background,
},
];
export const PWA_CONFIG = {
base: '/',
registerType: 'autoUpdate',
includeAssets: ['favicon.ico', 'robots.txt', 'apple-touch-icon.png'],
manifest: {
name: APP_CONFIG.META.name,
short_name: APP_CONFIG.META.name,
description: APP_CONFIG.META.shortDescription,
background_color: APP_CONFIG.META.app.background,
theme_color: APP_CONFIG.META.app.background,
start_url: '.',
orientation: 'any',
display: 'standalone',
icons: [
{
src: '/icon.png',
sizes: '512x512',
type: 'image/png',
purpose: 'any maskable',
},
{
src: '/logo.svg',
sizes: '48x48 72x72 96x96 128x128 256x256 512x512',
type: 'image/svg+xml',
purpose: 'any maskable',
},
],
},
workbox: {
sourcemap: false,
cleanupOutdatedCaches: true,
maximumFileSizeToCacheInBytes: 4194304,
globPatterns: ['**/*.{html,css,js,svg,png,gif,jpg,ico,json,woff2,txt}'],
runtimeCaching: [
{
urlPattern: /^https:\/\/fonts\.googleapis\.com\/.*/i,
handler: 'CacheFirst',
options: {
cacheName: 'google-fonts-cache',
expiration: {
maxEntries: 10,
maxAgeSeconds: 60 * 60 * 24 * 365, // <== 365 days
},
cacheableResponse: {
statuses: [0, 200],
},
},
},
{
urlPattern: /^https:\/\/fonts\.gstatic\.com\/.*/i,
handler: 'CacheFirst',
options: {
cacheName: 'gstatic-fonts-cache',
expiration: {
maxEntries: 10,
maxAgeSeconds: 60 * 60 * 24 * 365, // <== 365 days
},
cacheableResponse: {
statuses: [0, 200],
},
},
},
{
urlPattern: /^https:\/\/cdnjs\.cloudflare\.com\/.*/i,
handler: 'NetworkFirst',
options: {
cacheName: 'cloudflare-cdn-cache',
expiration: {
maxEntries: 10,
maxAgeSeconds: 60 * 60 * 24 * 7, // <== 7 days
},
cacheableResponse: {
statuses: [0, 200],
},
},
},
],
},
};