Last active
December 16, 2015 03:19
-
-
Save jhauraw/5369536 to your computer and use it in GitHub Desktop.
A test of how Liquid Template language evaluates YAML Front Matter variables of the truthy, falsy type. Meant for debugging Jekyll templates.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Each value of 'single' in 'yaml-results-truthy.yml' was run | |
# through each of these '{% if %} clauses. | |
# | |
# If the '{% if %}' clause evaluated to truthy, the statement | |
# is shown in 'yaml-results-truthy.yml' under the --- block | |
# for that value of 'single'. | |
# If falsy, nothing is printed and nothing was added to the | |
# results file. | |
{% if page.single %} | |
page.single | |
{% endif %} | |
{% if page.single == '' %} | |
page.single == '' | |
{% endif %} | |
{% if page.single != '' %} | |
page.single != '' | |
{% endif %} | |
{% if page.single == true %} | |
page.single == true | |
{% endif %} | |
{% if page.single != true %} | |
page.single != true | |
{% endif %} | |
{% if page.single == 'true' %} | |
page.single == 'true' | |
{% endif %} | |
{% if page.single == false %} | |
page.single == false | |
{% endif %} | |
{% if page.single != false %} | |
page.single != false | |
{% endif %} | |
{% if page.single == 'false' %} | |
page.single == 'false' | |
{% endif %} | |
{% if page.single == null %} | |
page.single == null | |
{% endif %} | |
{% if page.single != null %} | |
page.single != null | |
{% endif %} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Example YAML Front Matter variable 'single', and the corre- | |
# sponding TRUTHY results when set with common TRUTHY/FALSY | |
# values. | |
# Below each --- block are the results of running the given | |
# value of 'single' through each of the Liquid '{% if %}' | |
# clauses in 'yaml-if-truthy.liquid'. | |
--- | |
single: | |
--- | |
page.single != '' # E.g., when 'single' has no value {% if page.single != '' %} returns truthy | |
page.single != true | |
page.single != false | |
page.single == null | |
--- | |
single: '' | |
--- | |
page.single | |
page.single == '' | |
page.single != true | |
page.single != false | |
page.single != null | |
--- | |
single: true | |
--- | |
page.single | |
page.single != '' | |
page.single == true | |
page.single != false | |
page.single != null | |
--- | |
single: 'true' | |
--- | |
page.single | |
page.single != '' | |
page.single != true | |
page.single == 'true' | |
page.single != false | |
page.single != null | |
--- | |
single: false | |
--- | |
page.single != '' | |
page.single != true | |
page.single == false | |
page.single != null | |
--- | |
single: 'false' | |
--- | |
page.single | |
page.single != '' | |
page.single != true | |
page.single != false | |
page.single == 'false' | |
page.single != null | |
--- | |
single: null | |
--- | |
page.single != '' | |
page.single != true | |
page.single != false | |
page.single == null | |
--- | |
single: 'null' | |
--- | |
page.single | |
page.single != '' | |
page.single != true | |
page.single != false | |
page.single != null | |
--- | |
single: nil | |
--- | |
page.single | |
page.single != '' | |
page.single != true | |
page.single != false | |
page.single != null | |
--- | |
single: 'nil' | |
--- | |
page.single | |
page.single != '' | |
page.single != true | |
page.single != false | |
page.single != null | |
--- | |
single: 0 | |
--- | |
page.single | |
page.single != '' | |
page.single != true | |
page.single != false | |
page.single == 0 | |
page.single != null | |
--- | |
single: 1 | |
--- | |
page.single | |
page.single != '' | |
page.single != true | |
page.single != false | |
page.single == 1 | |
page.single != null |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment