diff --git a/lib/jekyll/tags/post_url.rb b/lib/jekyll/tags/post_url.rb index 04c1ef29..c8b820b8 100644 --- a/lib/jekyll/tags/post_url.rb +++ b/lib/jekyll/tags/post_url.rb @@ -14,7 +14,7 @@ module Jekyll "'#{name}' does not contain valid date and/or title." end - @name_regex = %r!^#{path}#{date}-#{slug}\.[^.]+! + @name_regex = %r!^_posts/#{path}#{date}-#{slug}\.[^.]+|^#{path}_posts/?#{date}-#{slug}\.[^.]+! end def post_date @@ -23,7 +23,7 @@ module Jekyll end def ==(other) - other.basename.match(@name_regex) + other.relative_path.match(@name_regex) end def deprecated_equality(other)