Liquid

Templates use LiquidJS to show data, with conditions, loops and filters.

{% assign pct = memory.used_percent | round %}
{% if pct > 80 %}…{% endif %}
{% for d in disk.disks %}…{% else %}No drives{% endfor %}
{% comment %} A note {% endcomment %}

Strict mode

  • An unknown variable is an error, and the element shows the error in place of the widget.
  • Only LiquidJS's built-in filters are available, plus StormGauge's in_unit for sizes.
  • divided_by always returns a decimal. Add | floor for a whole number.

Tips

  • Round what you show: | round for percentages, | in_unit: "auto", 1 for sizes.
  • Use {% for %}…{% else %} so empty lists still look intentional.
  • Do calculations once at the top with {% assign %}.
  • Templates re-render often, so keep loops small.