diff --git a/lib/jekyll/page.rb b/lib/jekyll/page.rb index c56396a4..80f5b884 100644 --- a/lib/jekyll/page.rb +++ b/lib/jekyll/page.rb @@ -125,7 +125,7 @@ module Jekyll self.data.deep_merge({ "url" => self.url, "content" => self.content, - "path" => File.join(@dir, @name).sub(/\A\//, '') }) + "path" => self.data['path'] || File.join(@dir, @name).sub(/\A\//, '') }) end # Obtain destination path. diff --git a/lib/jekyll/post.rb b/lib/jekyll/post.rb index 1da37001..5ea56898 100644 --- a/lib/jekyll/post.rb +++ b/lib/jekyll/post.rb @@ -287,7 +287,7 @@ module Jekyll "tags" => self.tags, "content" => self.content, "excerpt" => self.excerpt, - "path" => File.join(@dir, '_posts', @name).sub(/\A\//, '') }) + "path" => self.data['path'] || File.join(@dir, '_posts', @name).sub(/\A\//, '') }) end # Returns the shorthand String identifier of this Post.