diff --git a/features/permalinks.feature b/features/permalinks.feature index f63aaf81..67dfbb47 100644 --- a/features/permalinks.feature +++ b/features/permalinks.feature @@ -83,3 +83,13 @@ Feature: Fancy permalinks 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" + + Scenario: Use per-post ending in .htm + Given I have a _posts directory + And I have the following post: + | title | date | permalink | content | + | Some post | 2013-04-14 | /custom/posts/some.htm | bla bla | + When I run jekyll build + 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.htm" diff --git a/lib/jekyll/post.rb b/lib/jekyll/post.rb index b13deff8..293e2c5d 100644 --- a/lib/jekyll/post.rb +++ b/lib/jekyll/post.rb @@ -269,7 +269,7 @@ module Jekyll def destination(dest) # The url needs to be unescaped in order to preserve the correct filename path = Jekyll.sanitized_path(dest, URL.unescape_path(url)) - path = File.join(path, "index.html") if path[/\.html$/].nil? + path = File.join(path, "index.html") if path[/\.html?$/].nil? path end