HUGO
News Docs Themes Community GitHub

and

and VALUE...

Returns the first falsy argument. If all arguments are truthy, returns the last argument.

block

block NAME CONTEXT

Defines a template and executes it in place.

break

break

Used with the range statement, stops the innermost iteration and bypasses all remaining iterations.

continue

continue

Used with the range statement, stops the innermost iteration and continues to the next iteration.

define

define NAME

Defines a template.

else

else VALUE

Begins an alternate block for if, with, and range statements.

end

end

Terminates if, with, range, block, and define statements.

if

if EXPR

Executes the block if the expression is truthy.

len

len VALUE

Returns the length of a string, slice, map, or collection.

not

not VALUE

Returns the boolean negation of its single argument.

or

or VALUE...

Returns the first truthy argument. If all arguments are falsy, returns the last argument.

range

range COLLECTION

Iterates over a non-empty collection, binds context (the dot) to successive elements, and executes the block.

return

return [VALUE]

Used within partial templates, terminates template execution and returns the given value, if any.

template

template NAME [CONTEXT]

Executes the given template, optionally passing context.

try

try EXPRESSION

Returns a TryValue object after evaluating the given expression.

urlquery

urlquery VALUE [VALUE...]

Returns the escaped value of the textual representation of its arguments in a form suitable for embedding in a URL query.

with

with EXPR

Binds context (the dot) to the expression and executes the block if expression is truthy.