[from now] 2014/06/22 17:20:08

diff --git a/src/dist/assets/index.html b/src/dist/assets/index.html
index 3f114ea..a9568bd 100644
--- a/src/dist/assets/index.html
+++ b/src/dist/assets/index.html
@@ -17,7 +17,19 @@
             </ul>
           </div>

-          <div class="col-sm-9 col-sm-offset-3 col-md-10 col-md-offset-2 main" ng-view="">
+          <div class="col-sm-9 col-sm-offset-3 col-md-10 col-md-offset-2 main">
+            <div class="row">
+              <div ng-view="">
+              </div>
+            </div>
+            <div class="row page-nav">
+              <div ng-show="previous()" class="page-nav-link">
+                <a class="glyphicon glyphicon-chevron-left page-nav-link-previous" ng-click="goPrevious()"></a>
+              </div>
+              <div ng-show="next()" class="page-nav-link">
+                <a class="glyphicon glyphicon-chevron-right page-nav-link-next" ng-click="goNext()"></a>
+              </div>
+            </div>
           </div>
         </div>
       </div>
@@ -31,7 +43,7 @@
       <script src="scripts/app.js"></script>

       <script type="text/ng-template" id="toc-template">
-        <a href="#/{{ tocNode.path }}" ng-bind="tocNode.numbers + '. ' + tocNode.title"></a>
+        <a href="#{{ tocNode.path }}" ng-bind="tocNode.numbers + '. ' + tocNode.title"></a>
         <ul>
           <li ng-repeat="tocNode in tocNode.children" ng-include="'toc-template'"></li>
         </ul>
diff --git a/src/dist/assets/scripts/app.js b/src/dist/assets/scripts/app.js
index a439c96..606a6ad 100644
--- a/src/dist/assets/scripts/app.js
+++ b/src/dist/assets/scripts/app.js
@@ -14,8 +14,8 @@ angular

     function registerPagesRoute(tocNodes) {
       tocNodes.forEach(function (tocNode) {
-        $routeProvider.when('/' + tocNode.path, {
-          templateUrl: '/' + tocNode.path
+        $routeProvider.when(tocNode.path, {
+          templateUrl: tocNode.path
         });
         if (tocNode.children) {
           registerPagesRoute(tocNode.children)
@@ -25,6 +25,42 @@ angular

     registerPagesRoute(gaiden.toc);
   })
-  .controller('MainController', function ($scope) {
+  .controller('MainController', function ($scope, $location) {
     $scope.toc = gaiden.toc;
+
+    $scope.previous = function () {
+      return current().previous;
+    };
+
+    $scope.next = function () {
+      return current().next;
+    };
+
+    $scope.goPrevious = function () {
+      $location.path($scope.previous());
+    };
+
+    $scope.goNext = function () {
+      $location.path($scope.next());
+    };
+
+    function current(tocNodes) {
+      if ($location.path() === '/') {
+        return gaiden.toc[0].path;
+      }
+      tocNodes = tocNodes || gaiden.toc;
+      for (var i = 0; i < tocNodes.length; i++) {
+        var tocNode = tocNodes[i];
+        if (tocNode.path === $location.path()) {
+          return tocNode;
+        }
+        if (tocNode.children) {
+          var foundInChildren = current(tocNode.children);
+          if (foundInChildren) {
+            return foundInChildren;
+          }
+        }
+      }
+      return null;
+    }
   });
diff --git a/src/dist/assets/styles/main.css b/src/dist/assets/styles/main.css
index c35d6eb..990331b 100644
--- a/src/dist/assets/styles/main.css
+++ b/src/dist/assets/styles/main.css
@@ -69,3 +69,17 @@
 .sidebar ul li:first-child {
     padding: .8em 0 .3em 0;
 }
+
+.page-nav {
+    overflow: auto;
+}
+
+.page-nav-link {
+    width: 50%;
+    float: left;
+    text-align: center;
+}
+
+.page-nav-link a {
+    font-size: 200%;
+}
diff --git a/src/main/groovy/gaiden/kai/writer/TocWriter.groovy b/src/main/groovy/gaiden/kai/writer/TocWriter.groovy
index 71f8108..007efc2 100644
--- a/src/main/groovy/gaiden/kai/writer/TocWriter.groovy
+++ b/src/main/groovy/gaiden/kai/writer/TocWriter.groovy
@@ -62,6 +62,6 @@ private String toJson(TocSource tocSource) {

     private String getOutputPathOf(TocNode tocNode) {
         def pageWriter = pageWriterResolver.resolve(tocNode.pageSource)
-        pageWriter.getOutputPathOf(tocNode.pageSource).toString()
+        "/" + pageWriter.getOutputPathOf(tocNode.pageSource).toString()
     }
 }