about summary refs log tree commit diff
diff options
context:
space:
mode:
authorPatryk Niedźwiedziński <pniedzwiedzinski19@gmail.com>2019-10-17 21:56:13 +0200
committerPatryk Niedźwiedziński <pniedzwiedzinski19@gmail.com>2019-10-17 21:56:13 +0200
commit5cbfdab567005a963ef3c4f1ee4f1412f9c0de47 (patch)
tree637695cbd54494fe0f98a31f66c0f8ad6589a1a5
parent61dfb8f8e6aa261c3743ef7315a5358cb8867ab9 (diff)
downloadpuszcza-5cbfdab567005a963ef3c4f1ee4f1412f9c0de47.tar.gz
puszcza-5cbfdab567005a963ef3c4f1ee4f1412f9c0de47.zip
Fix empty post list
-rw-r--r--components/NavBar.vue14
-rw-r--r--components/NavLink.vue4
-rw-r--r--layouts/default.vue8
3 files changed, 18 insertions, 8 deletions
diff --git a/components/NavBar.vue b/components/NavBar.vue
index 2887464..4ffdf16 100644
--- a/components/NavBar.vue
+++ b/components/NavBar.vue
@@ -8,14 +8,21 @@
     <button @click="toggleMenu" class="menu-toggler">Menu</button>
     <ul :class="linksClass" @click="toggleMenu">
       <!-- Loop for generating links -->
-      <NavLink v-for="route in routes" :key="route.path" :link="route.path" :name="route.name"></NavLink>
+      <NavLink v-for="route in routes" :key="route.path" :link="route.path" :name="route.name" />
+      <NavLink
+        v-for="route in staticRoutes"
+        :key="route.path"
+        :link="route.path"
+        :name="route.name"
+        static
+      />
       <NavLink
         v-for="route in externalRoutes"
         :key="route.path"
         :link="route.path"
         :name="route.name"
-        :external="true"
-      ></NavLink>
+        external
+      />
     </ul>
   </nav>
 </template>
@@ -30,6 +37,7 @@ export default {
   props: {
     routes: Array,
     externalRoutes: Array,
+    staticRoutes: Array,
     title: String,
     logo: String
   },
diff --git a/components/NavLink.vue b/components/NavLink.vue
index 253dde9..6074db0 100644
--- a/components/NavLink.vue
+++ b/components/NavLink.vue
@@ -1,6 +1,7 @@
 <template>
   <li class="navlink">
     <a v-if="external" class="link" target="_blank" rel="”noopener”" :href="link">{{ name }}</a>
+    <a v-else-if="static" class="link" :href="link">{{ name }}</a>
     <nuxt-link v-else class="link" :to="link">{{ name }}</nuxt-link>
   </li>
 </template>
@@ -10,7 +11,8 @@ export default {
   props: {
     link: String,
     name: String,
-    external: { type: Boolean, default: false }
+    external: { type: Boolean, default: false },
+    static: { type: Boolean, default: false }
   }
 }
 </script>
diff --git a/layouts/default.vue b/layouts/default.vue
index 3341547..7f9ec5b 100644
--- a/layouts/default.vue
+++ b/layouts/default.vue
@@ -2,11 +2,11 @@
   <div id="app">
     <NavBar
       :routes="routes"
-      :externalRoutes="externalRoutes"
+      :staticRoutes="staticRoutes"
       title="19 PDH Puszcza"
       logo="/assets/krajka-logo.svg"
     />
-    <nuxt id="content" />
+    <nuxt id="content" :key="$route.path" />
     <Footer :routes="routes" :specialRoutes="specialRoutes" />
   </div>
 </template>
@@ -23,9 +23,9 @@ export default {
       routes: [
         { path: '/', name: 'Strona główna' },
         { path: '/download', name: 'Do pobrania' },
-        { path: '/kontakt', name: 'Kontakt' },
-        { path: '/kronika', name: 'Kronika' }
+        { path: '/kontakt', name: 'Kontakt' }
       ],
+      staticRoutes: [{ path: '/kronika', name: 'Kronika' }],
       externalRoutes: [
         // {
         //   path: 'https://kronika-puszcza.netlify.com',