diff --git a/features/permalinks.feature b/features/permalinks.feature index cb90d1f7..bc13de88 100644 --- a/features/permalinks.feature +++ b/features/permalinks.feature @@ -64,6 +64,19 @@ Feature: Fancy permalinks Then the _site directory should exist And I should see "Totally custom." in "_site/03-27-2009/custom-permalink-schema.html" + Scenario: Use custom permalink schema with date and time + Given I have a _posts directory + And I have the following post: + | title | category | date | content | + | Custom Permalink Schema | stuff | 2009-03-27 22:31:07 | Totally custom. | + And I have a configuration file with: + | key | value | + | permalink | "/:year:month:day:hour:minute:second.html" | + | timezone | UTC | + When I run jekyll build + Then the _site directory should exist + And I should see "Totally custom." in "_site/20090327223107.html" + Scenario: Use per-post permalink Given I have a _posts directory And I have the following post: diff --git a/lib/jekyll/post.rb b/lib/jekyll/post.rb index 62973d1d..85d168d9 100644 --- a/lib/jekyll/post.rb +++ b/lib/jekyll/post.rb @@ -227,6 +227,9 @@ module Jekyll :year => date.strftime("%Y"), :month => date.strftime("%m"), :day => date.strftime("%d"), + :hour => date.strftime("%H"), + :minute => date.strftime("%M"), + :second => date.strftime("%S"), :title => slug, :i_day => date.strftime("%-d"), :i_month => date.strftime("%-m"), diff --git a/site/_docs/permalinks.md b/site/_docs/permalinks.md index 962d4fe7..ddbbc13f 100644 --- a/site/_docs/permalinks.md +++ b/site/_docs/permalinks.md @@ -73,6 +73,36 @@ permalink is defined according to the format `/:categories/:year/:month/:day/:ti

Year from the Post’s filename without the century.

+ + +

hour

+ + +

+ Hour of the day, 24-hour clock, zero-padded from the Post’s filename. (00..23) +

+ + + + +

minute

+ + +

+ Minute of the hour from the Post’s filename. (00..59) +

+ + + + +

second

+ + +

+ Second of the minute from the Post’s filename. (00..60) +

+ +

title