|
|
@ -197,19 +197,6 @@ to(name) { |
|
|
|
}).bind(this); |
|
|
|
} |
|
|
|
|
|
|
|
self.route.base('/blog/') |
|
|
|
self.route("/", () => { self.route(`/posts/${self.state._id}`); }); |
|
|
|
self.route("/posts", () => { self.route(`/posts/${self.state._id}`); }); |
|
|
|
self.route("posts/*", posts); |
|
|
|
self.route("posts", (() => {posts(self.state._id)})); |
|
|
|
self.route("projects", projects); |
|
|
|
self.route("about", about); |
|
|
|
self.route("links", links); |
|
|
|
|
|
|
|
self.one("updated", () => { |
|
|
|
route.start(true); |
|
|
|
}); |
|
|
|
|
|
|
|
function getcategories() { |
|
|
|
window.cached("/blog/categories") |
|
|
|
.then((resp) => resp.json()) |
|
|
@ -219,10 +206,17 @@ function getcategories() { |
|
|
|
}); |
|
|
|
} |
|
|
|
|
|
|
|
self.on("mount", getcategories); |
|
|
|
|
|
|
|
self.on("mount", () => { |
|
|
|
console.log(decodeURIComponent(self.opts.initial_post)); |
|
|
|
self.route.base('/blog/') |
|
|
|
self.route("/", () => { self.route(`/posts/${self.state._id}`); }); |
|
|
|
self.route("/posts", () => { self.route(`/posts/${self.state._id}`); }); |
|
|
|
self.route("posts/*", posts); |
|
|
|
self.route("posts", (() => {posts(self.state._id)})); |
|
|
|
self.route("projects", projects); |
|
|
|
self.route("about", about); |
|
|
|
self.route("links", links); |
|
|
|
route.start(true); |
|
|
|
getcategories(); |
|
|
|
}); |
|
|
|
|
|
|
|
</script> |
|
|
|