diff --git a/lib/jekyll/post.rb b/lib/jekyll/post.rb
index <HASH>..<HASH> 100644
--- a/lib/jekyll/post.rb
+++ b/lib/jekyll/post.rb
@@ -63,7 +63,7 @@ module Jekyll
     #
     # Returns <String>
     def dir
-      path = @categories ? '/' + @categories.join('/') : ''
+      path = (@categories && !@categories.empty?) ? '/' + @categories.join('/') : ''
       if permalink
         permalink.to_s.split("/")[0..-2].join("/")
       else
fix double slash caused by empty categories