From 080108b0f0a5cc50aa1eefdc80dc2d03897baef7 Mon Sep 17 00:00:00 2001 From: Nick Quaranto Date: Sat, 25 Apr 2009 01:07:05 -0400 Subject: [PATCH] Making sure permalinks were set right, and only generating the url once --- features/permalinks.feature | 6 +++--- features/support/env.rb | 2 +- lib/jekyll/post.rb | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/features/permalinks.feature b/features/permalinks.feature index defc75db44f..9bd7c848bb4 100644 --- a/features/permalinks.feature +++ b/features/permalinks.feature @@ -28,7 +28,7 @@ Feature: Fancy permalinks And I have the following post: | title | category | date | content | | Custom Permalink Schema | stuff | 3/27/2009 | Totally custom. | - And I have a configuration file with "permalink" set to "blog/:year/:month/:day/:title" + And I have a configuration file with "permalink" set to "/blog/:year/:month/:day/:title" When I run jekyll Then the _site directory should exist And I should see "Totally custom." in "_site/blog/2009/03/27/custom-permalink-schema/index.html" @@ -38,7 +38,7 @@ Feature: Fancy permalinks And I have the following post: | title | category | date | content | | Custom Permalink Schema | stuff | 3/27/2009 | Totally custom. | - And I have a configuration file with "permalink" set to ":category/:title.html" + And I have a configuration file with "permalink" set to "/:categories/:title.html" When I run jekyll Then the _site directory should exist And I should see "Totally custom." in "_site/stuff/custom-permalink-schema.html" @@ -48,7 +48,7 @@ Feature: Fancy permalinks And I have the following post: | title | category | date | content | | Custom Permalink Schema | stuff | 3/27/2009 | Totally custom. | - And I have a configuration file with "permalink" set to ":month-:day-:year/:title.html" + And I have a configuration file with "permalink" set to "/:month-:day-:year/:title.html" When I run jekyll Then the _site directory should exist And I should see "Totally custom." in "_site/03-27-2009/custom-permalink-schema.html" diff --git a/features/support/env.rb b/features/support/env.rb index c5ba09b3b88..91734f0899f 100644 --- a/features/support/env.rb +++ b/features/support/env.rb @@ -14,5 +14,5 @@ def run_jekyll(opts = {}) bg = '&' end - system "#{JEKYLL_PATH}" #>> /dev/null" + system "#{JEKYLL_PATH} >> /dev/null" end diff --git a/lib/jekyll/post.rb b/lib/jekyll/post.rb index 928ef7e3e5e..dfd1fc31c99 100644 --- a/lib/jekyll/post.rb +++ b/lib/jekyll/post.rb @@ -123,7 +123,7 @@ def template def url return permalink if permalink - { + @url ||= { "year" => date.strftime("%Y"), "month" => date.strftime("%m"), "day" => date.strftime("%d"),