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 07:25:54 -0500
committerGitHub <noreply@github.com>2019-11-28 07:25:54 -0500
commitfaaf63ad895bd51541a9984273d52c71645a0b28 (patch)
tree90e949913650da4b619e3ab1e875731b1410d93f /nuxt.config.js
parent72549ed7b81fc01445fecdb7889bab4cf2a1590f (diff)
parent73e5c7a20e5e8f6a54ab484ea2ce1aac16200b1d (diff)
downloadpuszcza-faaf63ad895bd51541a9984273d52c71645a0b28.tar.gz
puszcza-faaf63ad895bd51541a9984273d52c71645a0b28.zip
Merge pull request #8 from 19pdh/develop
Posts & ranking
Diffstat (limited to 'nuxt.config.js')
-rw-r--r--nuxt.config.js42
1 files changed, 40 insertions, 2 deletions
diff --git a/nuxt.config.js b/nuxt.config.js
index a0ae413..104781c 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
    */
@@ -67,6 +83,28 @@ export default {
     /*
      ** 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']
+      })
+    }
+  },
+  hooks: {
+    generate: {
+      routeCreated({ route, path, errors }) {
+        console.log(route)
+        console.log(path)
+        console.log(errors)
+      }
+    }
   }
 }