import Router from 'vue-router'

import ForumView from '../components/views/ForumView.vue'
import BoardView from '../components/views/BoardView.vue'
import ThreadView from '../components/views/ThreadView.vue'

import ForumSidebar from '../components/sidebars/ForumSidebar.vue'
import BoardSidebar from '../components/sidebars/BoardSidebar.vue'

Vue.use(Router)

const routes = [
    {
        path: '/',
        components: {
            main: ForumView,
            sidebar: ForumSidebar
        }
    },
    {
        path: '/~:board/',
        components: {
            main: BoardView,
            sidebar: BoardSidebar
        }
    },
    {
        path: '/~:board/:key/:slug/',
        components: {
            main: ThreadView,
            sidebar: BoardSidebar
        }
    }
]

const router = new Router({
    mode: 'history',
    routes,
    scrollBehavior(to, from, savedPosition) {
        return savedPosition ? savedPosition : { x: 0, y: 0 }
    }
})

export default router

@@ -374,24 +374,47 @@
 s = %5B%0A    %7B%0A
+        name: 'forum',%0A
         path
@@ -416,24 +416,24 @@
  path: '/',%0A
-
         comp
@@ -520,32 +520,55 @@
  %7D%0A    %7D,%0A    %7B%0A
+        name: 'board',%0A
         path: '/
@@ -672,38 +672,62 @@
        %7D%0A    %7D,%0A
-
     %7B%0A
+        name: 'thread',%0A
         path: '/

add names to routes.