Merge pull request #1142 from kmikael/filters-documentation
Documentation for `date_to_rfc822` and `uri_escape`
This commit is contained in:
commit
2393ae58b7
|
@ -100,6 +100,16 @@ module Jekyll
|
|||
CGI::escape(input)
|
||||
end
|
||||
|
||||
# URI escape a string.
|
||||
#
|
||||
# input - The String to escape.
|
||||
#
|
||||
# Examples
|
||||
#
|
||||
# uri_escape('foo, bar \\baz?')
|
||||
# # => "foo,%20bar%20%5Cbaz?"
|
||||
#
|
||||
# Returns the escaped String.
|
||||
def uri_escape(input)
|
||||
URI.escape(input)
|
||||
end
|
||||
|
|
|
@ -37,6 +37,20 @@ common tasks easier.
|
|||
</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<p class='name'><strong>Date to RFC-822 Format</strong></p>
|
||||
<p>Convert a Date into the RFC-822 format used for RSS feeds.</p>
|
||||
</td>
|
||||
<td class='align-center'>
|
||||
<p>
|
||||
<code class='filter'>{% raw %}{{ site.time | date_to_rfc822 }}{% endraw %}</code>
|
||||
</p>
|
||||
<p>
|
||||
<code class='output'>Mon, 17 Nov 2008 13:07:54 -0800</code>
|
||||
</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<p class='name'><strong>Date to String</strong></p>
|
||||
|
@ -93,6 +107,22 @@ common tasks easier.
|
|||
</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<p class='name'><strong>URI Escape</strong></p>
|
||||
<p>
|
||||
URI escape a string.
|
||||
</p>
|
||||
</td>
|
||||
<td class='align-center'>
|
||||
<p>
|
||||
<code class='filter'>{% raw %}{{ “'foo, bar \\baz?'” | uri_escape }}{% endraw %}</code>
|
||||
</p>
|
||||
<p>
|
||||
<code class='output'>foo,%20bar%20%5Cbaz?</code>
|
||||
</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<p class='name'><strong>Number of Words</strong></p>
|
||||
|
|
Loading…
Reference in New Issue