parent
6905c80470
commit
0da5389cbb
|
|
@ -61,8 +61,19 @@ Here's the full list of placeholders available:
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<p>
|
<p>
|
||||||
Year from the post's filename. May be overridden via the document’s
|
Year from the post’s filename with four digits.
|
||||||
<code>date</code> front matter
|
May be overridden via the document’s <code>date</code> front matter.
|
||||||
|
</p>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<p><code>short_year</code></p>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<p>
|
||||||
|
Year from the post’s filename without the century. (00..99)
|
||||||
|
May be overridden via the document’s <code>date</code> front matter.
|
||||||
</p>
|
</p>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
@ -72,8 +83,8 @@ Here's the full list of placeholders available:
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<p>
|
<p>
|
||||||
Month from the post's filename. May be overridden via the document’s
|
Month from the post’s filename. (01..12)
|
||||||
<code>date</code> front matter
|
May be overridden via the document’s <code>date</code> front matter.
|
||||||
</p>
|
</p>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
@ -83,19 +94,35 @@ Here's the full list of placeholders available:
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<p>
|
<p>
|
||||||
Month without leading zeros from the post's filename. May be
|
Month without leading zeros from the post’s filename. May be
|
||||||
overridden via the document’s <code>date</code> front matter
|
overridden via the document’s <code>date</code> front matter.
|
||||||
</p>
|
</p>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<p><code>short_month</code></p>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<p>Three-letter month abbreviation, e.g. “Jan”.</p>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<p><code>long_month</code></p>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<p>Full month name, e.g. “January”.</p>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td>
|
<td>
|
||||||
<p><code>day</code></p>
|
<p><code>day</code></p>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<p>
|
<p>
|
||||||
Day from the post's filename. May be overridden via the document’s
|
Day of the month from the post’s filename. (01..31)
|
||||||
<code>date</code> front matter
|
May be overridden via the document’s <code>date</code> front matter.
|
||||||
</p>
|
</p>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
@ -105,8 +132,8 @@ Here's the full list of placeholders available:
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<p>
|
<p>
|
||||||
Day without leading zeros from the post's filename. May be overridden
|
Day of the month without leading zeros from the post’s filename.
|
||||||
via the document’s <code>date</code> front matter
|
May be overridden via the document’s <code>date</code> front matter.
|
||||||
</p>
|
</p>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
@ -115,18 +142,47 @@ Here's the full list of placeholders available:
|
||||||
<p><code>y_day</code></p>
|
<p><code>y_day</code></p>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<p>Day of the year from the post's filename, with leading zeros.</p>
|
<p>Ordinal day of the year from the post’s filename, with leading zeros. (001..366)</p>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td>
|
<td>
|
||||||
<p><code>short_year</code></p>
|
<p><code>w_year</code></p>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<p>
|
<p>Week year which may differ from the month year for up to three days at the start of January and end of December</p>
|
||||||
Year without the century from the post's filename. May be overridden
|
</td>
|
||||||
via the document’s <code>date</code> front matter
|
</tr>
|
||||||
</p>
|
<tr>
|
||||||
|
<td>
|
||||||
|
<p><code>week</code></p>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<p>Week number of the current year, starting with the first week having a majority of its days in January. (01..53)</p>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<p><code>w_day</code></p>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<p>Day of the week, starting with Monday. (1..7)</p>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<p><code>short_day</code></p>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<p>Three-letter weekday abbreviation, e.g. “Sun”.</p>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<p><code>long_day</code></p>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<p>Weekday name, e.g. “Sunday”.</p>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
|
|
@ -135,7 +191,7 @@ Here's the full list of placeholders available:
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<p>
|
<p>
|
||||||
Hour of the day, 24-hour clock, zero-padded from the post's
|
Hour of the day, 24-hour clock, zero-padded from the post’s
|
||||||
<code>date</code> front matter. (00..23)
|
<code>date</code> front matter. (00..23)
|
||||||
</p>
|
</p>
|
||||||
</td>
|
</td>
|
||||||
|
|
@ -146,7 +202,7 @@ Here's the full list of placeholders available:
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<p>
|
<p>
|
||||||
Minute of the hour from the post's <code>date</code> front matter. (00..59)
|
Minute of the hour from the post’s <code>date</code> front matter. (00..59)
|
||||||
</p>
|
</p>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
@ -156,7 +212,7 @@ Here's the full list of placeholders available:
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<p>
|
<p>
|
||||||
Second of the minute from the post's <code>date</code> front matter. (00..59)
|
Second of the minute from the post’s <code>date</code> front matter. (00..59)
|
||||||
</p>
|
</p>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
@ -237,6 +293,14 @@ For posts, Jekyll also provides the following built-in styles for convenience:
|
||||||
<p><code>/:categories/:year/:y_day/:title:output_ext</code></p>
|
<p><code>/:categories/:year/:y_day/:title:output_ext</code></p>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<p><code>weekdate</code></p>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<p><code>/:categories/:year/W:week/:short_day/:title.html</code></p>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td>
|
<td>
|
||||||
<p><code>none</code></p>
|
<p><code>none</code></p>
|
||||||
|
|
|
||||||
|
|
@ -305,6 +305,8 @@ module Jekyll
|
||||||
"/:categories/:year/:month/:day/:title:output_ext"
|
"/:categories/:year/:month/:day/:title:output_ext"
|
||||||
when :ordinal
|
when :ordinal
|
||||||
"/:categories/:year/:y_day/:title:output_ext"
|
"/:categories/:year/:y_day/:title:output_ext"
|
||||||
|
when :weekdate
|
||||||
|
"/:categories/:year/W:week/:short_day/:title:output_ext"
|
||||||
else
|
else
|
||||||
permalink_style.to_s
|
permalink_style.to_s
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -35,46 +35,89 @@ module Jekyll
|
||||||
category_set.to_a.join("/")
|
category_set.to_a.join("/")
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# CCYY
|
||||||
def year
|
def year
|
||||||
@obj.date.strftime("%Y")
|
@obj.date.strftime("%Y")
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# MM: 01..12
|
||||||
def month
|
def month
|
||||||
@obj.date.strftime("%m")
|
@obj.date.strftime("%m")
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# DD: 01..31
|
||||||
def day
|
def day
|
||||||
@obj.date.strftime("%d")
|
@obj.date.strftime("%d")
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# hh: 00..23
|
||||||
def hour
|
def hour
|
||||||
@obj.date.strftime("%H")
|
@obj.date.strftime("%H")
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# mm: 00..59
|
||||||
def minute
|
def minute
|
||||||
@obj.date.strftime("%M")
|
@obj.date.strftime("%M")
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# ss: 00..59
|
||||||
def second
|
def second
|
||||||
@obj.date.strftime("%S")
|
@obj.date.strftime("%S")
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# D: 1..31
|
||||||
def i_day
|
def i_day
|
||||||
@obj.date.strftime("%-d")
|
@obj.date.strftime("%-d")
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# M: 1..12
|
||||||
def i_month
|
def i_month
|
||||||
@obj.date.strftime("%-m")
|
@obj.date.strftime("%-m")
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# MMM: Jan..Dec
|
||||||
def short_month
|
def short_month
|
||||||
@obj.date.strftime("%b")
|
@obj.date.strftime("%b")
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# MMMM: January..December
|
||||||
|
def long_month
|
||||||
|
@obj.date.strftime("%B")
|
||||||
|
end
|
||||||
|
|
||||||
|
# YY: 00..99
|
||||||
def short_year
|
def short_year
|
||||||
@obj.date.strftime("%y")
|
@obj.date.strftime("%y")
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# CCYYw, ISO week year
|
||||||
|
# may differ from CCYY for the first days of January and last days of December
|
||||||
|
def w_year
|
||||||
|
@obj.date.strftime("%G")
|
||||||
|
end
|
||||||
|
|
||||||
|
# WW: 01..53
|
||||||
|
# %W and %U do not comply with ISO 8601-1
|
||||||
|
def week
|
||||||
|
@obj.date.strftime("%V")
|
||||||
|
end
|
||||||
|
|
||||||
|
# d: 1..7 (Monday..Sunday)
|
||||||
|
def w_day
|
||||||
|
@obj.date.strftime("%u")
|
||||||
|
end
|
||||||
|
|
||||||
|
# dd: Mon..Sun
|
||||||
|
def short_day
|
||||||
|
@obj.date.strftime("%a")
|
||||||
|
end
|
||||||
|
|
||||||
|
# ddd: Monday..Sunday
|
||||||
|
def long_day
|
||||||
|
@obj.date.strftime("%A")
|
||||||
|
end
|
||||||
|
|
||||||
|
# DDD: 001..366
|
||||||
def y_day
|
def y_day
|
||||||
@obj.date.strftime("%j")
|
@obj.date.strftime("%j")
|
||||||
end
|
end
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue