diff --git a/features/permalinks.feature b/features/permalinks.feature index 050e75c3..0b42726a 100644 --- a/features/permalinks.feature +++ b/features/permalinks.feature @@ -63,3 +63,23 @@ Feature: Fancy permalinks 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" + + Scenario: Use per-post permalink + Given I have a _posts directory + And I have the following post: + | title | date | permalink | content | + | Some post | 4/14/2013 | /custom/posts/1 | bla bla | + When I run jekyll + Then the _site directory should exist + And the _site/custom/posts/1 directory should exist + And I should see "bla bla" in "_site/custom/posts/1/index.html" + + Scenario: Use per-post ending in .html + Given I have a _posts directory + And I have the following post: + | title | date | permalink | content | + | Some post | 4/14/2013 | /custom/posts/some.html | bla bla | + When I run jekyll + Then the _site directory should exist + And the _site/custom/posts directory should exist + And I should see "bla bla" in "_site/custom/posts/some.html" diff --git a/features/step_definitions/jekyll_steps.rb b/features/step_definitions/jekyll_steps.rb index fd58679d..731d155f 100644 --- a/features/step_definitions/jekyll_steps.rb +++ b/features/step_definitions/jekyll_steps.rb @@ -66,7 +66,7 @@ Given /^I have the following (draft|post)s?(?: (.*) "(.*)")?:$/ do |status, dire end matter_hash = {} - %w(title layout tag tags category categories published author path).each do |key| + %w(title layout tag tags category categories published author path permalink).each do |key| matter_hash[key] = post[key] if post[key] end matter = matter_hash.map { |k, v| "#{k}: #{v}\n" }.join.chomp