about summary refs log tree commit diff
path: root/nuxt.config.js
diff options
context:
space:
mode:
authorPatryk Niedźwiedziński <pniedzwiedzinski19@gmail.com>2019-11-28 11:18:45 +0100
committerPatryk Niedźwiedziński <pniedzwiedzinski19@gmail.com>2019-11-28 11:18:45 +0100
commit7051b88fd36e56dcfab7b73b80811c93bc1d0921 (patch)
treefec99da81e654e710a2df1f0cb66cff1c4406a7b /nuxt.config.js
parent1b70d2f3c1dbed43317c1da7ed8092daac27168d (diff)
parente12c489d3ad6111c78c9cb4d4b8ab77b053c49ad (diff)
downloadpuszcza-7051b88fd36e56dcfab7b73b80811c93bc1d0921.tar.gz
puszcza-7051b88fd36e56dcfab7b73b80811c93bc1d0921.zip
Merge remote-tracking branch 'origin/develop' into feature/ranking
Diffstat (limited to 'nuxt.config.js')
-rw-r--r--nuxt.config.js50
1 files changed, 44 insertions, 6 deletions
diff --git a/nuxt.config.js b/nuxt.config.js
index 2663e3b..4c07f72 100644
--- a/nuxt.config.js
+++ b/nuxt.config.js
@@ -1,3 +1,7 @@
+import k from './api'
+
+const BASE_URL = process.env.DEPLOY_PRIME_URL || 'http://localhost:3000'
+
 export default {
   mode: 'universal',
   /*
@@ -5,7 +9,8 @@ export default {
    */
   head: {
     htmlAttrs: {
-      lang: 'pl'
+      lang: 'pl',
+      prefix: 'og: http://ogp.me/ns#'
     },
     title: '19 PDH Puszcza',
     meta: [
@@ -20,6 +25,11 @@ export default {
       {
         name: 'google-site-verification',
         content: 'V9-RG4-ertDzO9hqxuG29PkDUM8PGqaSOYUMiMaGUOY'
+      },
+      {
+        hid: 'og:image',
+        name: 'og:image',
+        content: `${BASE_URL}/assets/og/default.jpg`
       }
     ],
     link: [
@@ -31,6 +41,12 @@ export default {
       }
     ]
   },
+  env: {
+    baseUrl: process.env.DEPLOY_URL || 'http://localhost:3000'
+  },
+  generate: {
+    routes: k.getPosts().map(post => post.route)
+  },
   /*
    ** Customize the progress-bar color
    */
@@ -64,15 +80,37 @@ export default {
   /*
    ** Build configuration
    */
+  markdownit: {
+    preset: 'default',
+    linkify: true,
+    breaks: true
+  },
   build: {
     /*
      ** You can extend webpack config here
      */
-    extend(config, ctx) {}
+    extend(config, { isDev, isClient }) {
+      if (isClient) {
+        config.node = {
+          fs: 'empty',
+          child_process: 'empty',
+          tls: 'empty',
+          net: 'empty'
+        }
+      }
+      config.module.rules.push({
+        test: /\.md$/,
+        use: ['raw-loader']
+      })
+    }
   },
-  markdownit: {
-    preset: 'default',
-    linkify: true,
-    breaks: true
+  hooks: {
+    generate: {
+      routeCreated({ route, path, errors }) {
+        console.log(route)
+        console.log(path)
+        console.log(errors)
+      }
+    }
   }
 }