Learn

_sentence_list

Create a sentence-like list of values.

The _sentence_list shortcut will turn a simple YAML list into a sentence-like list.

If the list contains one item, this will return just that item. If the list contains two items, this will return both items with “and” between them. If the list contains three or more items, this will return a comma-separated list with “and” before the last item.

Sample Usage

Input

categories:
  - technology
  - zoology
  - survival skills

Tag

{{ categories_sentence_list }}

Displayed Result

technology, zoology, and survival skills

This article was last updated on March 30th, 2016. Find an error? Please let us know!