Added permalink time variables
This commit is contained in:
parent
8563f59125
commit
22b59ae793
|
@ -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:
|
||||
|
|
|
@ -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"),
|
||||
|
|
|
@ -73,6 +73,36 @@ permalink is defined according to the format `/:categories/:year/:month/:day/:ti
|
|||
<p>Year from the Post’s filename without the century.</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<p><code>hour</code></p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
Hour of the day, 24-hour clock, zero-padded from the Post’s filename. (00..23)
|
||||
</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<p><code>minute</code></p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
Minute of the hour from the Post’s filename. (00..59)
|
||||
</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<p><code>second</code></p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
Second of the minute from the Post’s filename. (00..60)
|
||||
</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<p><code>title</code></p>
|
||||
|
|
Loading…
Reference in New Issue