Skip to content

Commit

Permalink
Merge commit '0a1e3cd2508c797d7b8d1038636a6e7111e5cd3d'. Fixes jekyll#33
Browse files Browse the repository at this point in the history
.

Conflicts:
	features/post_data.feature
  • Loading branch information
mojombo committed Jan 15, 2010
2 parents 5fec20d + 0a1e3cd commit a4f3f5c
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 9 deletions.
1 change: 1 addition & 0 deletions History.txt
Expand Up @@ -4,6 +4,7 @@
* Expand source to full path so includes work anywhere (#101)
* Fix highlighting on Ruby 1.9 (#65)
* Fix extension munging when pretty permalinks are enabled (#64)
* Stop sorting categories (#33)

== 0.5.7 / 2010-01-12
* Minor Enhancements
Expand Down
14 changes: 7 additions & 7 deletions features/post_data.feature
Expand Up @@ -82,17 +82,17 @@ Feature: Post data
And I should see "Post tags: twist" in "_site/2009/05/18/star-wars.html"

Scenario: Use post.categories variable when categories are in folders
Given I have a movies directory
And I have a movies/scifi directory
And I have a movies/scifi/_posts directory
Given I have a scifi directory
And I have a scifi/movies directory
And I have a scifi/movies/_posts directory
And I have a _layouts directory
And I have the following post in "movies/scifi":
And I have the following post in "scifi/movies":
| title | date | layout | content |
| Star Wars | 3/27/2009 | simple | Luke, I am your father. |
And I have a simple layout that contains "Post categories: {{ page.categories | array_to_sentence_string }}"
When I run jekyll
Then the _site directory should exist
And I should see "Post categories: movies and scifi" in "_site/movies/scifi/2009/03/27/star-wars.html"
And I should see "Post categories: scifi and movies" in "_site/scifi/movies/2009/03/27/star-wars.html"

Scenario: Use post.categories variable when category is in YAML
Given I have a _posts directory
Expand All @@ -110,11 +110,11 @@ Feature: Post data
And I have a _layouts directory
And I have the following post:
| title | date | layout | categories | content |
| Star Wars | 3/27/2009 | simple | ['movies', 'scifi'] | Luke, I am your father. |
| Star Wars | 3/27/2009 | simple | ['scifi', 'movies'] | Luke, I am your father. |
And I have a simple layout that contains "Post categories: {{ page.categories | array_to_sentence_string }}"
When I run jekyll
Then the _site directory should exist
And I should see "Post categories: movies and scifi" in "_site/movies/scifi/2009/03/27/star-wars.html"
And I should see "Post categories: scifi and movies" in "_site/scifi/movies/2009/03/27/star-wars.html"

Scenario: Disable a post from being published
Given I have a _posts directory
Expand Down
2 changes: 1 addition & 1 deletion lib/jekyll/post.rb
Expand Up @@ -124,7 +124,7 @@ def url
"month" => date.strftime("%m"),
"day" => date.strftime("%d"),
"title" => CGI.escape(slug),
"categories" => categories.sort.join('/')
"categories" => categories.join('/')
}.inject(template) { |result, token|
result.gsub(/:#{token.first}/, token.last)
}.gsub(/\/\//, "/")
Expand Down
2 changes: 1 addition & 1 deletion test/test_post.rb
Expand Up @@ -131,7 +131,7 @@ def do_render(post)

should "process the url correctly" do
assert_equal "/:categories/:year/:month/:day/:title.html", @post.template
assert_equal "/beer/food/2008/10/19/foo-bar.html", @post.url
assert_equal "/food/beer/2008/10/19/foo-bar.html", @post.url
end
end

Expand Down

0 comments on commit a4f3f5c

Please sign in to comment.