From 968f3b0911245de58a8c4a19aae115baa19b6992 Mon Sep 17 00:00:00 2001 From: "maul.esel" Date: Sat, 13 Apr 2013 00:05:49 +0200 Subject: [PATCH] allow overriding page.path in YAML frontmatter --- lib/jekyll/page.rb | 2 +- lib/jekyll/post.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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.