neq support
All checks were successful
Publish npm package / publish (push) Successful in 1m24s

This commit is contained in:
Gregor Lohaus
2026-05-24 15:46:25 +02:00
parent e16fc8b482
commit 0fab9c8d38
7 changed files with 36 additions and 9 deletions

View File

@@ -60,6 +60,7 @@ render("./output", {
|---|---|
| `<@if(context.x)>` | Conditional block — boolean check (must end with `<@endif>`) |
| `<@if(eq(context.x,"value"))>` | Conditional block — string equality check |
| `<@if(neq(context.x,"value"))>` | Conditional block — string inequality check |
| `<@elseif(context.y)>` | Else-if branch (same forms as `@if`) |
| `<@else>` | Else branch |
| `<@endif>` | End conditional block |
@@ -72,6 +73,7 @@ render("./output", {
|---|---|
| `<@if(context.x)>dirname` | Conditionally include directory/file (boolean check) |
| `<@if(eq(context.x,"value"))>dirname` | Conditionally include by string equality |
| `<@if(neq(context.x,"value"))>dirname` | Conditionally include by string inequality |
| `<@var(context.x)>` | Dynamic directory/file name |
These can be combined: `<@if(context.web.create)><@var(context.web.dir)>` creates a directory named by `context.web.dir` only if `context.web.create` is true.