diff options
Diffstat (limited to 'man/blogc-template.7.ronn')
-rw-r--r-- | man/blogc-template.7.ronn | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/man/blogc-template.7.ronn b/man/blogc-template.7.ronn index 3499d7c..1fdc479 100644 --- a/man/blogc-template.7.ronn +++ b/man/blogc-template.7.ronn @@ -143,7 +143,8 @@ based on the value and existence of variables in the current scope. The implementation of conditionals is simple, and each will just evaluate the value of a single variable. -The available conditionals are: `ifdef`, `ifndef` and `if`. +The available conditionals are: `ifdef`, `ifndef` and `if`. `else` statements +are supported. ### ifdef conditional @@ -154,9 +155,12 @@ This is how an `ifdef` conditional is defined in a template: {% ifdef TITLE %} This is title: {{ TITLE }} + {% else %} + Untitled entry {% endif %} -In this case, if the `TITLE` variable is defined, the content is included. +In this case, if the `TITLE` variable is defined, the content after the statement +is included. Otherwise, the content after `else` statement is included. ### ifndef conditional @@ -170,6 +174,8 @@ This is how an `ifndef` conditional is defined in a template: {% endif %} In this case, if the `TITLE` variable is not defined, the content is included. +`else` statements are supported here, even if it does not makes much sense to +be used this way. ### if conditional @@ -184,7 +190,9 @@ comparisions are strcmp(3)-like. This is how an `if` conditional is defined in a template: {% if TITLE == "My Title" %} - Title is "My Title" + Special description of "My Title" + {% else %} + Title is {{ TITLE }} {% endif %} Or: |