2 import LightRouter from 'lightrouter';
4 // Initialize localization
6 import './config/i18n';
10 import ForumList from './components/forum_list/forum_list.svelte';
11 import Header from './components/header/header.svelte';
12 import Footer from './components/footer/footer.svelte';
15 import Author from './components/author/author.svelte';
16 import Home from './components/home/home.svelte';
17 import InvalidRoute from './components/invalid_route/invalid_route.svelte';
18 import Post from './components/post/post.svelte';
19 import Topic from './components/topic/topic.svelte';
20 import TopicIndex from './components/topic_index/topic_index.svelte';
25 // sets the route params and current page.
27 const setRoute = function setRoute(targetPage) {
29 return function (routerParams) {
31 params = routerParams;
36 const router = new LightRouter({
38 '': () => (page = Home) && true,
39 'f/{id}': setRoute(TopicIndex),
40 'g/{id}': setRoute(TopicIndex),
41 'a/{id}': setRoute(Author),
42 't/{id}': setRoute(Topic),
43 'p/{id}': setRoute(Post),
44 '.*': setRoute(InvalidRoute)
54 <svelte:component this={ page } params={ params } />
61 grid-column: col-start 2 / span 11;