Skip to main content Link Search Menu Expand Document (external link)

assign a new variable

  • Use the Assign keyword to set a value for a variable.

Example below assigns the variable positiveVal the absolute value of -42, which is 42:

{% assign positiveVal = -42 | abs %}