[from now] 2014/09/19 00:32:51

diff --git a/gaiden-core/src/test/resources/without-pages/build/1_first.html b/gaiden-core/src/test/resources/without-pages/build/1_first.html
index b7cf65e..8766c37 100644
--- a/gaiden-core/src/test/resources/without-pages/build/1_first.html
+++ b/gaiden-core/src/test/resources/without-pages/build/1_first.html
@@ -16,10 +16,23 @@
         <span class="title"><a href="#">Gaiden</a></span>
       </div>
       <div class="sidebar">
-        /Users/yamkazu/IdeaProjects/gaiden/gaiden-core/src/test/resources/without-pages/1_first.md
-        /Users/yamkazu/IdeaProjects/gaiden/gaiden-core/src/test/resources/without-pages/2_second/2_1_child.md
-        /Users/yamkazu/IdeaProjects/gaiden/gaiden-core/src/test/resources/without-pages/2_second.md
-        /Users/yamkazu/IdeaProjects/gaiden/gaiden-core/src/test/resources/without-pages/3_third.md
+        <ul>
+          <li><a href="/Users/yamkazu/IdeaProjects/gaiden/gaiden-core/src/test/resources/without-pages/build/1_first.html">1_first</a></li>
+          <li>
+            2_second
+            <ul>
+              <li><a href="/Users/yamkazu/IdeaProjects/gaiden/gaiden-core/src/test/resources/without-pages/build/2_second/2_1_child.html">2_1_child</a></li>
+            </ul>
+          </li>
+          <li><a href="/Users/yamkazu/IdeaProjects/gaiden/gaiden-core/src/test/resources/without-pages/build/2_second.html">2_second</a></li>
+          <li>
+            3_third
+            <ul>
+              <li><a href="/Users/yamkazu/IdeaProjects/gaiden/gaiden-core/src/test/resources/without-pages/build/3_third/3_1_child.html">3_1_child</a></li>
+            </ul>
+          </li>
+          <li><a href="/Users/yamkazu/IdeaProjects/gaiden/gaiden-core/src/test/resources/without-pages/build/4_fourth.html">4_fourth</a></li>
+        </ul>
       </div>
       <div class="content">
         <div class="content-handle"></div>
diff --git a/gaiden-core/src/test/resources/without-pages/build/2_second.html b/gaiden-core/src/test/resources/without-pages/build/2_second.html
index 9a6a4b9..fb1f8a1 100644
--- a/gaiden-core/src/test/resources/without-pages/build/2_second.html
+++ b/gaiden-core/src/test/resources/without-pages/build/2_second.html
@@ -16,10 +16,23 @@
         <span class="title"><a href="#">Gaiden</a></span>
       </div>
       <div class="sidebar">
-        /Users/yamkazu/IdeaProjects/gaiden/gaiden-core/src/test/resources/without-pages/1_first.md
-        /Users/yamkazu/IdeaProjects/gaiden/gaiden-core/src/test/resources/without-pages/2_second/2_1_child.md
-        /Users/yamkazu/IdeaProjects/gaiden/gaiden-core/src/test/resources/without-pages/2_second.md
-        /Users/yamkazu/IdeaProjects/gaiden/gaiden-core/src/test/resources/without-pages/3_third.md
+        <ul>
+          <li><a href="/Users/yamkazu/IdeaProjects/gaiden/gaiden-core/src/test/resources/without-pages/build/1_first.html">1_first</a></li>
+          <li>
+            2_second
+            <ul>
+              <li><a href="/Users/yamkazu/IdeaProjects/gaiden/gaiden-core/src/test/resources/without-pages/build/2_second/2_1_child.html">2_1_child</a></li>
+            </ul>
+          </li>
+          <li><a href="/Users/yamkazu/IdeaProjects/gaiden/gaiden-core/src/test/resources/without-pages/build/2_second.html">2_second</a></li>
+          <li>
+            3_third
+            <ul>
+              <li><a href="/Users/yamkazu/IdeaProjects/gaiden/gaiden-core/src/test/resources/without-pages/build/3_third/3_1_child.html">3_1_child</a></li>
+            </ul>
+          </li>
+          <li><a href="/Users/yamkazu/IdeaProjects/gaiden/gaiden-core/src/test/resources/without-pages/build/4_fourth.html">4_fourth</a></li>
+        </ul>
       </div>
       <div class="content">
         <div class="content-handle"></div>
diff --git a/gaiden-core/src/test/resources/without-pages/build/2_second/2_1_child.html b/gaiden-core/src/test/resources/without-pages/build/2_second/2_1_child.html
index 82acf2d..091c5f3 100644
--- a/gaiden-core/src/test/resources/without-pages/build/2_second/2_1_child.html
+++ b/gaiden-core/src/test/resources/without-pages/build/2_second/2_1_child.html
@@ -16,10 +16,23 @@
         <span class="title"><a href="#">Gaiden</a></span>
       </div>
       <div class="sidebar">
-        /Users/yamkazu/IdeaProjects/gaiden/gaiden-core/src/test/resources/without-pages/1_first.md
-        /Users/yamkazu/IdeaProjects/gaiden/gaiden-core/src/test/resources/without-pages/2_second/2_1_child.md
-        /Users/yamkazu/IdeaProjects/gaiden/gaiden-core/src/test/resources/without-pages/2_second.md
-        /Users/yamkazu/IdeaProjects/gaiden/gaiden-core/src/test/resources/without-pages/3_third.md
+        <ul>
+          <li><a href="/Users/yamkazu/IdeaProjects/gaiden/gaiden-core/src/test/resources/without-pages/build/1_first.html">1_first</a></li>
+          <li>
+            2_second
+            <ul>
+              <li><a href="/Users/yamkazu/IdeaProjects/gaiden/gaiden-core/src/test/resources/without-pages/build/2_second/2_1_child.html">2_1_child</a></li>
+            </ul>
+          </li>
+          <li><a href="/Users/yamkazu/IdeaProjects/gaiden/gaiden-core/src/test/resources/without-pages/build/2_second.html">2_second</a></li>
+          <li>
+            3_third
+            <ul>
+              <li><a href="/Users/yamkazu/IdeaProjects/gaiden/gaiden-core/src/test/resources/without-pages/build/3_third/3_1_child.html">3_1_child</a></li>
+            </ul>
+          </li>
+          <li><a href="/Users/yamkazu/IdeaProjects/gaiden/gaiden-core/src/test/resources/without-pages/build/4_fourth.html">4_fourth</a></li>
+        </ul>
       </div>
       <div class="content">
         <div class="content-handle"></div>
diff --git a/src/main/dist/themes/default/layouts/explorer.html b/src/main/dist/themes/default/layouts/explorer.html
index 9169c89..953f39a 100644
--- a/src/main/dist/themes/default/layouts/explorer.html
+++ b/src/main/dist/themes/default/layouts/explorer.html
@@ -1,38 +1,40 @@
 <%
+import static java.nio.file.Files.*
+import static gaiden.util.PathUtils.*
+
 def current = config.sourceDirectory
+
 println '<ul>'
 document.pages.each { page ->
-    if (current && java.nio.file.Files.isSameFile(page.source.path.parent, current)) {
-        println "<li>${gaiden.util.PathUitls.removeExtension(page.source.path.fileName)}</li>"
-    } else if (current && current.startsWith(page.source.path.parent)) {
-        def relativePath = current.relativize(page.source.path.parent)
-        relativePath.each { parent ->
-            println "</ul></li>"
-        }
-        println "<li>${gaiden.util.PathUitls.removeExtension(page.source.path.fileName)}</li>"
-    } else if (current && page.source.path.parent.startsWith(current)) {
-        def relativePath = current.relativize(page.source.path.parent)
-        relativePath.each { parent ->
-            println "<li>${parent}<ul>"
-        }
-        println "<li>${gaiden.util.PathUitls.removeExtension(page.source.path.fileName)}</li>"
-    } else {
-        def found = (0..(Math.min(current.nameCount, page.source.path.parent.nameCount))).find {
-            current.getName(it) != page.source.path.parent.getName(it)
-        }
-        (current.nameCount - found).times {
-            println '</ul></li>'
-        }
-        (current.nameCount..page.source.path.parent.nameCount).each { int index ->
-            println "<li>${page.source.path.parent.getName(index)}<ul>"
+    if (!isSameFile(page.source.path.parent, current)) {
+        if (current.startsWith(page.source.path.parent)) {
+            def relativePath = current.relativize(page.source.path.parent)
+            relativePath.each { parent ->
+                println '</ul></li>'
+            }
+        } else if (page.source.path.parent.startsWith(current)) {
+            def relativePath = current.relativize(page.source.path.parent)
+            relativePath.each { parent ->
+                println "<li>${parent}<ul>"
+            }
+        } else {
+            def found = (0..(Math.min(current.nameCount, page.source.path.parent.nameCount))).find {
+                current.getName(it) != page.source.path.parent.getName(it)
+            }
+            (current.nameCount - found).times {
+                println '</ul></li>'
+            }
+            (found..(page.source.path.parent.nameCount - 1)).each {
+                println "<li>${page.source.path.parent.getName(it)}<ul>"
+            }
         }
-        println "<li>${gaiden.util.PathUitls.removeExtension(page.source.path.fileName)}</li>"
     }
+    println "<li><a href=\"${page.outputPath}\">${removeExtension(page.source.path.fileName)}</a></li>"
     current = page.source.path.parent
 }

 (current.nameCount - config.sourceDirectory.nameCount).times {
-    println "</ul></li>"
+    println '</ul></li>'
 }
 println '</ul>'
 %>