{{#isEmpty}} helper

Checks if the given collection is empty. Use it to show a fallback, such as a short message, when a list like tags has no items. The opposite check is isNotEmpty.

Syntax:

{{#isEmpty COLLECTION}}
   If COLLECTION is empty
{{else}}
   If COLLECTION is not empty
{{/isEmpty}}

Example:

{{#isEmpty tags}}
   No tags
{{/isEmpty}}

Create your first website with Publii

Join thousands of creators who chose independence. Create content locally and publish lightning-fast, secure websites on your own terms.

Download Publii

Free and open source. Windows, macOS and Linux.

Read the getting started guide