sumi

Basics · Logic

If blocks

Templates branch with {if …}…{/if}. The condition is a Go boolean expression, not template text, so a signal needs an explicit .Get() — the auto-unwrap that applies to {count} in body text does not reach inside a control-flow block.

This app tracks one task. Pressing a key toggles its done signal, but the ✓ marker shows all the time. We only want it when the task is actually done.

Your turn

Wrap the marker in an {if}:

{if done.Get()}
    <p class="done">✓ done</p>
{/if}

Press Run, click into the terminal, and press a key to toggle — the marker appears and disappears. Solve shows the finished version; Reset restores the start.

⌘↵ to run