@@ -32,7 +32,7 @@ const airtable_base = 'appSCAap8SWbFRtu0';
32
32
33
33
let mode = 'universal' // loads airtable dynamically
34
34
// const mode = 'universal' // loads airtable during build-time only (any changes to airtable won't be reflected live)
35
- if ( process . env . NODE_ENV == 'production ' ) {
35
+ if ( process . env . NODE_ENV == 'spa ' ) {
36
36
mode = 'spa'
37
37
// mode = 'universal'
38
38
}
@@ -251,31 +251,69 @@ module.exports = {
251
251
id : site_ga ,
252
252
// disabled: true // gdpr, policy.js enables it: https://medium.com/dailyjs/google-analytics-gdpr-and-vuejs-e1bd6affd2b4
253
253
} ] ,
254
- [ '@nuxtjs/markdownit' , {
255
- html : true ,
256
- } ] ,
254
+ // ['@nuxtjs/markdownit', {
255
+ // html: true,
256
+ // }],
257
257
[ '@nuxtjs/google-tag-manager' , {
258
258
id : 'GTM-WCR3X43'
259
259
} ] ,
260
+ '@nuxtjs/pwa' ,
261
+ 'nuxt-device-detect' ,
260
262
] ,
261
- markdownit : {
262
- // preset: 'default',
263
- injected : false , // markdownit.js plugin takes over injection
264
- // to use custom injection, remove if (_options.injected === true) { block from @nuxtjs /markdownit/index.js
265
- // use the custom plugin/markdownit to inject properly; the official thing is broken
266
- // injected: true, // commented out to allow attrs in lang="md" blocks
267
- // BUG: in @nuxtjs /markdownit/index.js: this needs to be set:
268
- // options: Object.assign({}, options, this.options.markdownit)
269
- // this allows lang="md" to continue processing plugins like markdown-it-attrs, otherwise it doesn't do that anymore
270
- // otherwise plugins will break
271
- html : true ,
272
- typographer : true ,
273
- linkify : true ,
274
- breaks : true ,
275
- use : [
276
- 'markdown-it-attrs' ,
277
- [ 'markdown-it-attrs' , { 'leftDelimiter' : '[' , 'rightDelimiter' : ']' } ]
278
- ] ,
263
+ // this is buggy, using own plugin instead
264
+ // markdownit: {
265
+ // // preset: 'default',
266
+ // injected: false, // markdownit.js plugin takes over injection
267
+ // // to use custom injection, remove if (_options.injected === true) { block from @nuxtjs /markdownit/index.js
268
+ // // use the custom plugin/markdownit to inject properly; the official thing is broken
269
+ // // injected: true, // commented out to allow attrs in lang="md" blocks
270
+ // // BUG: in @nuxtjs /markdownit/index.js: this needs to be set:
271
+ // // options: Object.assign({}, options, this.options.markdownit)
272
+ // // this allows lang="md" to continue processing plugins like markdown-it-attrs, otherwise it doesn't do that anymore
273
+ // // otherwise plugins will break
274
+ // html: true,
275
+ // typographer: true,
276
+ // linkify: true,
277
+ // breaks: true,
278
+ // use: [
279
+ // 'markdown-it-attrs',
280
+ // ['markdown-it-attrs', {'leftDelimiter': '[', 'rightDelimiter': ']'}]
281
+ // ],
282
+ // },
283
+
284
+
285
+ manifest : {
286
+ name : 'Phage Directory' ,
287
+ short_name : 'phagedirectory' ,
288
+ display : 'standalone' ,
289
+ start_url : 'https://phage.directory/' ,
290
+ theme_color : site_color ,
291
+ background_color : '#FFFFFF' ,
292
+ lang : 'en' ,
293
+ // icons: PWAIcons
294
+ } ,
295
+
296
+ workbox : {
297
+ runtimeCaching : [
298
+ {
299
+ urlPattern : 'https://api.airtable.com/v0/appSCAap8SWbFRtu0/.*' ,
300
+ handler : 'cacheFirst' ,
301
+ method : 'GET' ,
302
+ strategyOptions : { cacheableResponse : { statuses : [ 0 , 200 ] } }
303
+ } ,
304
+ // {
305
+ // urlPattern: 'https://fonts.googleapis.com/.*',
306
+ // handler: 'cacheFirst',
307
+ // method: 'GET',
308
+ // strategyOptions: {cacheableResponse: {statuses: [0, 200]}}
309
+ // },
310
+ // {
311
+ // urlPattern: 'https://fonts.gstatic.com/.*',
312
+ // handler: 'cacheFirst',
313
+ // method: 'GET',
314
+ // strategyOptions: {cacheableResponse: {statuses: [0, 200]}}
315
+ // },
316
+ ]
279
317
} ,
280
318
281
319
build : {
@@ -383,11 +421,11 @@ module.exports = {
383
421
path : '/antibiotics' ,
384
422
component : resolve ( __dirname , 'pages/dir.vue' )
385
423
} ,
386
- {
387
- name : 'orgs' ,
388
- path : '/orgs' ,
389
- component : resolve ( __dirname , 'pages/dir.vue' )
390
- } ,
424
+ // {
425
+ // name: 'orgs',
426
+ // path: '/orgs',
427
+ // component: resolve(__dirname, 'pages/dir.vue')
428
+ // },
391
429
{
392
430
name : 'labs' ,
393
431
path : '/labs' ,
@@ -405,11 +443,11 @@ module.exports = {
405
443
// },
406
444
407
445
// news alerts
408
- {
409
- name : 'alerts' ,
410
- path : '/alerts/:id' ,
411
- component : resolve ( __dirname , 'pages/alerts.vue' )
412
- } ,
446
+ // {
447
+ // name: 'alerts',
448
+ // path: '/alerts/:id',
449
+ // component: resolve(__dirname, 'pages/alerts.vue')
450
+ // },
413
451
414
452
415
453
// blog / news / 'viral' newsletter; resolves to generic Blog page
0 commit comments