Pug can conditionally run code based on variables (passed from your server or based in Pug itself).
if (statement)
// Pug code
else if (statement)
// Pug code
else
// Pug code
unless (statement)
// Pug code
| Parameter | Details | 
|---|---|
| if (statement) | Evaluates statementto see if it returns true or false. The code nested underneathifwill run only ifstatementreturns true. | 
| else if (statement) | Chained to an existing iforelse ifstatement; it only runs if the previous statement evaluated to false. The code nested underneath theelse ifstatement will run only ifstatementevaluates to true. | 
| else | The code nested underneath the elsestatement will run only if all previous statements returned false. | 
| unless (statement) | The negation of if (statement); the code nested underneathifwill run only ifstatementreturns false. It is the same asif (!statement). |