Merge branch 'permalink-no-dir' of git://github.com/maul-esel/jekyll into maul-esel-permalink-no-dir
* 'permalink-no-dir' of git://github.com/maul-esel/jekyll: test per-post permalinks do not force the permalink to be a dir if it ends on .html Conflicts: features/step_definitions/jekyll_steps.rb
This commit is contained in:
commit
d4300be758
|
@ -63,3 +63,23 @@ Feature: Fancy permalinks
|
||||||
When I run jekyll
|
When I run jekyll
|
||||||
Then the _site directory should exist
|
Then the _site directory should exist
|
||||||
And I should see "Totally custom." in "_site/03-27-2009/custom-permalink-schema.html"
|
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"
|
||||||
|
|
|
@ -65,7 +65,7 @@ Given /^I have the following (draft|post)s?(?: (in|under) "([^"]+)")?:$/ do |sta
|
||||||
path = File.join(before, folder_post, after, filename)
|
path = File.join(before, folder_post, after, filename)
|
||||||
|
|
||||||
matter_hash = {}
|
matter_hash = {}
|
||||||
%w(title layout tag tags category categories published author path date).each do |key|
|
%w(title layout tag tags category categories published author path date permalink).each do |key|
|
||||||
matter_hash[key] = post[key] if post[key]
|
matter_hash[key] = post[key] if post[key]
|
||||||
end
|
end
|
||||||
matter = matter_hash.map { |k, v| "#{k}: #{v}\n" }.join.chomp
|
matter = matter_hash.map { |k, v| "#{k}: #{v}\n" }.join.chomp
|
||||||
|
|
|
@ -270,7 +270,7 @@ module Jekyll
|
||||||
def destination(dest)
|
def destination(dest)
|
||||||
# The url needs to be unescaped in order to preserve the correct filename
|
# The url needs to be unescaped in order to preserve the correct filename
|
||||||
path = File.join(dest, CGI.unescape(self.url))
|
path = File.join(dest, CGI.unescape(self.url))
|
||||||
path = File.join(path, "index.html") if template[/\.html$/].nil?
|
path = File.join(path, "index.html") if path[/\.html$/].nil?
|
||||||
path
|
path
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue