Tags and Filters available in Jekyll 3.0.3 -

Test count - Passed - Failed

Here is a list of available Tags and Filters in Jekyll.
This is a work in progress, feel free to contribute via github repository.


Tests results

jekyll

jekyll:array:array_to_sentence_string jekyll Documentation - Back to top

{% assign my_array = "one|two|three" | split: "|" %}{{ my_array | array_to_sentence_string }}
Expected
one, two, and three
Result
one, two, and three

jekyll:array:push Back to top

{% assign my_array = "one|two" | split: "|" %}{{ my_array | push: "three" }}
Expected
onetwothree
Result
onetwothree
Comment
Jekyll 2.4 specific

jekyll:array:pop Back to top

{% assign my_array = "one|two|three" | split: "|" %}{{ my_array | pop }}
Expected
three
Result
onetwo
Comment
Jekyll 2.4 specific

jekyll:array:pop Back to top

{% assign my_array = "one|two|three" | split: "|" %}{{ my_array | pop: 2 }}
Expected
twothree
Result
one
Comment
Jekyll 2.4 specific

jekyll:array:shift Back to top

{% assign my_array = "one|two|three" | split: "|" %}{{ my_array | shift }}
Expected
one
Result
twothree
Comment
Jekyll 2.4 specific

jekyll:array:shift Back to top

{% assign my_array = "one|two|three" | split: "|" %}{{ my_array | shift: 2 }}
Expected
onetwo
Result
three
Comment
Jekyll 2.4 specific

jekyll:array:unshift Back to top

{% assign my_array = "one|two" | split: "|" %}{{ my_array | unshift: "three" }}
Expected
threeonetwo
Result
threeonetwo
Comment
Jekyll 2.4 specific

jekyll:enumerable:where jekyll Documentation - Back to top

{% capture post %}{{ site.data.test-datas.posts | where:"weight", 10 }}{% endcapture %}{{ post }}
Expected
{"title"=>"a", "content"=>"a title body", "weight"=>10, "group"=>"titi"}
Result
{"title"=>"a", "content"=>"a title body", "weight"=>10, "group"=>"titi"}
Comment
this filter need better testing

jekyll:enumerable:group_by Back to top

{% assign groups = site.data.test-datas.posts | group_by: "group" %} {% for group in groups %}{{ group.name }}{% for item in group.items %}{{item.title}}{%endfor%}{%endfor%}
Expected
totoABtitiab
Result
totoABtitiab
nl2space
true
Comment
this filter need better testing

jekyll:enumerable:jsonify jekyll Documentation - Back to top

{{ site.data.test-datas.posts[0] | jsonify }}
Expected
{"title":"A","content":"A title body","weight":30,"group":"toto"}
Result
{"title":"A","content":"A title body","weight":30,"group":"toto"}

jekyll:enumerable:sort jekyll Documentation - Back to top

{% assign posts = site.data.test-datas.posts | sort: "weight" %}{% for post in posts %}{{ post.title }}{% endfor %}
Expected
baBA
Result
baBA

jekyll:enumerable:sort jekyll Documentation - Back to top

{% assign posts = site.data.test-datas.posts | sort: "weight", "last" %}{% for post in posts %}{{ post.title }}{% endfor %}
Expected
aBAb
Result
aBAb

jekyll:enumerable:sort jekyll Documentation - Back to top

{% assign posts = site.data.test-datas.posts | sort: "weight", "first" %}{% for post in posts %}{{ post.title }}{% endfor %}
Expected
baBA
Result
baBA

jekyll:string:number_of_words jekyll Documentation - Back to top

{{ "three word sentence" | number_of_words }}
Expected
3
Result
3

jekyll:string:markdownify jekyll Documentation - Back to top

{{ "**strong** and *em*" | markdownify | escape }}
Expected
<p><strong>strong</strong> and <em>em</em></p>
Result
<p><strong>strong</strong> and <em>em</em></p>
nl2space
true
Comment
this test is passing. problem in the expected tag that adds a newline

jekyll:date:date_to_xmlschema jekyll Documentation - Back to top

{{ "Fri, 07 Nov 2008 00:00:00 +0100" | date_to_xmlschema }}
Expected
2008-11-07T00:00:00+01:00
Result
2008-11-06T23:00:00+00:00

jekyll:date:date_to_rfc822 jekyll Documentation - Back to top

{{ "2008-11-07T00:00:00+01:00" | date_to_rfc822 }}
Expected
Fri, 07 Nov 2008 00:00:00 +0100
Result
Thu, 06 Nov 2008 23:00:00 +0000

jekyll:date:date_to_string jekyll Documentation - Back to top

{{ "Fri, 07 Nov 2008 00:00:00 +0100" | date_to_string }}
Expected
07 Nov 2008
Result
06 Nov 2008

jekyll:date:date_to_long_string jekyll Documentation - Back to top

{{ "Fri, 07 Nov 2008 00:00:00 +0100" | date_to_long_string }}
Expected
07 November 2008
Result
06 November 2008
{% include test_en.html %}
Description
simple include
Expected
english include
Result
english include
nl2space
true
{% assign tpl = "test_en.html" %}{% include {{ tpl }} %}
Description
include with file name in a variable
Expected
english include
Result
english include
nl2space
true
{% assign lang = "en" %}{% capture filename %}test_{{ lang }}.html{% endcapture %}{% include {{filename}} %}
Description
include with "dynamic" file name concatenation
Expected
english include
Result
english include
nl2space
true
{% assign lang = "en" %}{% include test_{{ lang }}.html %}
Description
include with "dynamic" file name concatenation in include tag
Expected
english include
Result
this test throw an exception on current Jekyll version
nl2space
true
Comment
Jekyll 2.3 - Only one variable tag is allowed in the include tag.
{% assign name = "titi" %}{% include test_include.html %}
Description
include calling variable defined in parent template
Expected
titi
Result
titi
nl2space
true

jekyll:theme:include_relative jekyll Documentation - Back to top

{% include_relative _includes/test_en.html %}
Description
simple include_relative
Expected
english include
Result
english include
nl2space
true

jekyll:theme:include_relative jekyll Documentation - Back to top

{% assign tpl = "_includes/test_en.html" %}{% include_relative {{ tpl }} %}
Description
include_relative with file name in a variable
Expected
english include
Result
english include
nl2space
true

jekyll:theme:include_relative jekyll Documentation - Back to top

{% assign lang = "en" %}{% capture filename %}_includes/test_{{ lang }}.html{% endcapture %}{% include_relative {{filename}} %}
Description
include_relative with "dynamic" file name concatenation
Expected
english include
Result
english include
nl2space
true

jekyll:theme:include_relative jekyll Documentation - Back to top

{% assign lang = "en" %}{% include_relative _includes/test_{{ lang }}.html %}
Description
include_relative with "dynamic" file name concatenation in include tag
Expected
english include
Result
this test throw an exception on current Jekyll version
nl2space
true
Comment
Jekyll 2.3 - Only one variable tag is allowed in the include tag.

jekyll:theme:include_relative jekyll Documentation - Back to top

{% assign name = "titi" %}{% include_relative _includes/test_include.html %}
Description
include_relative calling variable defined in parent template
Expected
titi
Result
titi
nl2space
true

liquid

liquid:operators:contains liquid Documentation - Back to top

{% if "Hello world !" contains "Hello" %}contains{% else %}not found{% endif %}
Expected
contains
Result
contains

liquid:operators:contains liquid Documentation - Back to top

{% if "Hello world !" contains "Jelyll" %}contains{% else %}not found{% endif %}
Expected
not found
Result
not found

liquid:operators:contains liquid Documentation - Back to top

{% assign my_array = "one|two|three" | split: "|" %}{% if my_array contains "one" %}contains{% else %}not found{% endif %}
Expected
contains
Result
contains

liquid:operators:contains liquid Documentation - Back to top

{% assign my_array = "one|two|three" | split: "|" %}{% if my_array contains "four" %}contains{% else %}not found{% endif %}
Expected
not found
Result
not found
{% assign my_array = "one|two|three" | split: "|" %}{% for num in my_array %}{{ num }}{% endfor %}
Expected
onetwothree
Result
onetwothree
{% assign my_array = "one|two|three" | split: "|" %}{{ my_array[0] }}{{ my_array[1] }}{{ my_array[2] }}
Expected
onetwothree
Result
onetwothree

liquid:control-flow:if liquid Documentation - Back to top

{% if 1 == 1 %}OK{% endif %}
Expected
OK
Result
OK

liquid:control-flow:if liquid Documentation - Back to top

{% if 1 == "1" %}OK{% endif %}
Expected
Result

liquid:control-flow:elsif-else liquid Documentation - Back to top

{% assign name="toto" %}{% if name == "toto" %}toto{% elsif name == "titi" %}titi{% else %}nobody{% endif %}
Expected
toto
Result
toto

liquid:control-flow:elsif-else liquid Documentation - Back to top

{% assign name="titi" %}{% if name == "toto" %}toto{% elsif name == "titi" %}titi{% else %}nobody{% endif %}
Expected
titi
Result
titi

liquid:control-flow:elsif-else liquid Documentation - Back to top

{% assign name="yoyo" %}{% if name == "toto" %}toto{% elsif name == "titi" %}titi{% else %}nobody{% endif %}
Expected
nobody
Result
nobody

liquid:control-flow:case-when liquid Documentation - Back to top

{% assign handle = 'cake' %}{% case handle %}{% when 'cake' %}This is a cake{% when 'cookie' %}This is a cookie{% else %}This is not a cake nor a cookie{% endcase %}
Expected
This is a cake
Result
This is a cake

liquid:control-flow:case-when liquid Documentation - Back to top

{% assign handle = 'cookie' %}{% case handle %}{% when 'cake' %}This is a cake{% when 'cookie' %}This is a cookie{% else %}This is not a cake nor a cookie{% endcase %}
Expected
This is a cookie
Result
This is a cookie

liquid:control-flow:case-when liquid Documentation - Back to top

{% assign handle = 'bacon' %}{% case handle %}{% when 'cake' %}This is a cake{% when 'cookie' %}This is a cookie{% else %}This is not a cake nor a cookie{% endcase %}
Expected
This is not a cake nor a cookie
Result
This is not a cake nor a cookie

liquid:control-flow:unless liquid Documentation - Back to top

{% assign name='toto' %}{% unless name == 'titi' %}Not {% endunless %}titi
Expected
Not titi
Result
Not titi

liquid:control-flow:unless liquid Documentation - Back to top

{% assign name='titi' %}{% unless name == 'titi' %}Not{% endunless %}titi
Expected
titi
Result
titi
My name is {% comment %}NOT{% endcomment %}Titi.
Expected
My name is Titi.
Result
My name is Titi.

liquid:forloop:forloop.first liquid Documentation - Back to top

{% for num in site.data.test-datas.multi-dim-array.arrayone %}{% if forloop.first == true %}{{ num }}{% else %}-{% endif %}{% endfor %}
Expected
one--
Result
one--

liquid:forloop:forloop.index liquid Documentation - Back to top

{% for num in site.data.test-datas.multi-dim-array.arrayone %}{{ forloop.index }}{% endfor %}
Expected
123
Result
123

liquid:forloop:forloop.index0 liquid Documentation - Back to top

{% for num in site.data.test-datas.multi-dim-array.arrayone %}{{ forloop.index0 }}{% endfor %}
Expected
012
Result
012

liquid:forloop:forloop.last liquid Documentation - Back to top

{% for num in site.data.test-datas.multi-dim-array.arrayone %}{% if forloop.last == true %}{{ num }}{% else %}-{% endif %}{% endfor %}
Expected
--three
Result
--three

liquid:forloop:forloop.rindex liquid Documentation - Back to top

{% for num in site.data.test-datas.multi-dim-array.arrayone %}{{ forloop.rindex }}{% endfor %}
Expected
321
Result
321

liquid:forloop:forloop.rindex0 liquid Documentation - Back to top

{% for num in site.data.test-datas.multi-dim-array.arrayone %}{{ forloop.rindex0 }}{% endfor %}
Expected
210
Result
210

liquid:forloop:forloop.length liquid Documentation - Back to top

{% for num in site.data.test-datas.multi-dim-array.arrayone %}{% capture length %}{{ forloop.length }}{% endcapture %}{% endfor %}{{ length }}
Expected
3
Result
3
{% assign my_array = "one|two|three" | split: "|" | join: ", " %}{{ my_array }}
Expected
one, two, three
Result
one, two, three
{{ "one|two|three" | split: "|" | first }}
Expected
one
Result
one
{% assign my_array = "one|two|three" | split: "|" %}{{ my_array.first }}
Expected
one
Result
one
Comment
first can be used in dot notation, in cases where it needs to be used inside a tag.
{{ "one|two|three" | split: "|" | last }}
Expected
three
Result
three
{% assign my_array = "one|two|three" | split: "|" %}{{ my_array.last }}
Expected
three
Result
three
Comment
last can be used in dot notation, in cases where it needs to be used inside a tag.
{% assign mapping = site.data.test-datas.multi-dim-array | map: "arrayone" %}{{ mapping }}
Expected
onetwothree
Result
onetwothree
{{ "this is a 30 character string!" | size }}
Expected
30
Result
30
{{ "one|two|three" | split: "|" | size }}
Expected
3
Result
3
{% assign posts = site.data.test-datas.posts | sort: "weight" %}{% for post in posts %}{{ post.weight }}{% endfor %}
Expected
102030
Result
102030
Comment
this filter is overriden by Jekyll sort
{% assign posts = site.data.test-datas.posts | sort: "title" %}{% for post in posts %}{{ post.title }}{% endfor %}
Expected
ABab
Result
ABab
Comment
this filter is overriden by Jekyll sort
{{ 4.6 | ceil }}
Expected
5
Result
5
Comment
liquid 3.0

liquid:math:divided_by liquid Documentation - Back to top

{{ 6 | divided_by: 3 }}
Expected
2
Result
2

liquid:math:divided_by liquid Documentation - Back to top

{{ 3 | divided_by: 5 }}
Expected
0
Result
0
Comment
integers division returns integer

liquid:math:divided_by liquid Documentation - Back to top

{{ "3" | divided_by: 5 }}
Expected
0
Result
0
Comment
integers division returns integer

liquid:math:divided_by liquid Documentation - Back to top

{{ "3.0" | divided_by: 5 }}
Expected
0.6
Result
0.6

liquid:math:divided_by liquid Documentation - Back to top

{{ 3.0 | divided_by: 5 }}
Expected
0.6
Result
0.6

liquid:math:divided_by liquid Documentation - Back to top

{{ "3" | divided_by: 5.0 }}
Expected
0.6
Result
0.6

liquid:math:divided_by liquid Documentation - Back to top

{{ 3 | divided_by: "5.0" }}
Expected
0.6
Result
0.6
{{ 4.6 | floor }}
Expected
4
Result
4
Comment
liquid 3.0
{{ 16 | minus: 15 }}
Expected
1
Result
1
{{ "16" | minus: 15 }}
Expected
1
Result
1
{{ 16 | minus: "15" }}
Expected
1
Result
1
{{ 1 | minus: 0.5 }}
Expected
0.5
Result
0.5
{{ 1 | minus: "0.5" }}
Expected
0.5
Result
0.5
{{ "1" | minus: 0.5 }}
Expected
0.5
Result
0.5
{{ 16 | plus: 15 }}
Expected
31
Result
31
{{ "16" | plus: 15 }}
Expected
31
Result
31
{{ 16 | plus: "15" }}
Expected
31
Result
31
{{ 1.6 | plus: 1.5 }}
Expected
3.1
Result
3.1
{{ "1.6" | plus: 1.5 }}
Expected
3.1
Result
3.1
{{ 1.6 | plus: "1.5" }}
Expected
3.1
Result
3.1
{{ 4.6 | round }}
Expected
5
Result
5
Comment
liquid 3.0
{{ 4.3 | round }}
Expected
4
Result
4
Comment
liquid 3.0
{{ 4.5612 | round: 2 }}
Expected
456
Result
4.56
Comment
liquid 3.0
{{ 100 | times: 2 }}
Expected
200
Result
200
{{ 10.12 | times: 10 }}
Expected
101.2
Result
101.2
{{ 10 | times: 10.12 }}
Expected
101.2
Result
101.2
{{ 12 | modulo: 5 }}
Expected
2
Result
2
{{ "12" | modulo: 5 }}
Expected
2
Result
2
{{ 12 | modulo: "5" }}
Expected
2
Result
2
{{ 1.2 | modulo: 5 }}
Expected
1.2
Result
1.2
{{ 15.5 | modulo: 5.1 }}
Expected
0.2
Result
0.2
{{ 'sales' | append: '.jpg' }}
Expected
sales.jpg
Result
sales.jpg

liquid:string:capitalize liquid Documentation - Back to top

{{ 'capitalize me' | capitalize }}
Expected
Capitalize me
Result
Capitalize me

liquid:string:downcase liquid Documentation - Back to top

{{ 'UPPERCASE' | downcase }}
Expected
uppercase
Result
uppercase
{{ "<p>test</p>" | escape }}
Expected
<p>test</p>
Result
<p>test</p>

liquid:string:newline_to_br liquid Documentation - Back to top

{{ site.data.test-datas.string-with-newlines | newline_to_br | escape }}
Expected
One<br /> Two<br /> Three<br />
Result
One<br /> Two<br /> Three<br />
{{ 'sale' | prepend: 'Made a great ' }}
Expected
Made a great sale
Result
Made a great sale
{{ "Hello, world. Goodbye, world." | remove: "world" }}
Expected
Hello, . Goodbye, .
Result
Hello, . Goodbye, .

liquid:string:remove_first liquid Documentation - Back to top

{{ "Hello, world. Goodbye, world." | remove_first: "world" }}
Expected
Hello, . Goodbye, world.
Result
Hello, . Goodbye, world.
{{ 'Hello World !' | replace: 'World', 'Jekyll' }}
Expected
Hello Jekyll !
Result
Hello Jekyll !

liquid:string:replace_first liquid Documentation - Back to top

{{ 'Awesome Awesome Shoes' | replace_first: 'Awesome', 'Mega' }}
Expected
Mega Awesome Shoes
Result
Mega Awesome Shoes
{{ "hello" | slice: 2 }}
Expected
e
Result
l
Comment
liquid 3.0
{{ "hello" | slice: 1, 3 }}
Expected
ell
Result
ell
Comment
liquid 3.0
{{ "hello" | slice: -3, 2  }}
Expected
el
Result
ll
Comment
liquid 3.0
{% assign words = "Uses cheat codes, calls the game boring." | split: " " %}{% for word in words %}{{ word }}{% endfor %}
Expected
Usescheatcodes,callsthegameboring.
Result
Usescheatcodes,callsthegameboring.
|{{'   too many spaces      '|strip}}|
Expected
|too many spaces|
Result
|too many spaces|
Comment
liquid 3.0
|{{ '   too many spaces           ' | lstrip }}|
Expected
|too many spaces |
Result
|too many spaces |
Comment
liquid 3.0
|{{ '   too many spaces           ' | rstrip }}|
Expected
| too many spaces|
Result
| too many spaces|
Comment
liquid 3.0

liquid:string:strip_html liquid Documentation - Back to top

{{ "<h1>Hello</h1> World" | strip_html }}
Expected
Hello World
Result
Hello World

liquid:string:strip_newlines liquid Documentation - Back to top

{{ site.data.test-datas.string-with-newlines | strip_newlines }}
Expected
OneTwoThree
Result
OneTwoThree

liquid:string:truncate liquid Documentation - Back to top

{{ "The cat came back the very next day" | truncate: 10 }}
Expected
The cat...
Result
The cat...

liquid:string:truncatewords liquid Documentation - Back to top

{{ "The cat came back the very next day" | truncatewords: 4 }}
Expected
The cat came back...
Result
The cat came back...
{{ 'i want this to be uppercase' | upcase }}
Expected
I WANT THIS TO BE UPPERCASE
Result
I WANT THIS TO BE UPPERCASE

kramdown

kramdown:gfm:multiple-underscores-in-words kramdown Documentation - Back to top

{{ "perform_complicated_task"  | markdownify }}
Expected

perform_complicated_task

Result

perform_complicated_task

Comment
Multiple underscores in words

kramdown:gfm:url-autolinking kramdown Documentation - Back to top

{{ "http://example.com"  | markdownify }}
Expected
Result

http://example.com

Comment
URL autolinking

kramdown:gfm:strikethrough kramdown Documentation - Back to top

{{ "~~Mistaken text.~~"  | markdownify }}
Expected
<del>Mistaken text.</del>
Result

Mistaken text.

Comment
Strikethrough

kramdown:gfm:fenced-code-blocks kramdown Documentation - Back to top

{% capture tag %} ``` function test() {
  console.log("toto");
} ``` {% endcapture %} {{ tag  | markdownify }}
Expected

function test() { console.log("toto"); }

Result

function test() { console.log("toto"); }

nl2space
true
Comment
Fenced code blocks

kramdown:gfm:syntax-highlighting kramdown Documentation - Back to top

{% capture tag %}
```ruby
def start
  puts "toto"
end
```
{% endcapture %}
{{ tag  | markdownify }}
Expected
def start puts "toto" end 
Result
def start
  puts "toto"
end
nl2space
true
Comment
Syntax highlighting