Liquid Letters


Liquid Letters Overview Liquid Letters adds Twig filters to count words, give reading times, and convert text to list items.

Using Word Count {{ entry.field | wordCount }}

Will output

100

Using Read Time The readTime filter requires a timing parameter of seconds(sec), minutes(min), hours(hr), or days(day, just for fun!).

Seconds {{ entry.field | readTime('sec')

Minuts {{ entry.field | readTime('min')

Hours {{ entry.field | readTime('hr')

Days {{ entry.field | readTime('day')

The output will be the number of the duration to read. If no timing or an invalid timing is submitted, the filter will return the text timing invalid.

Using To List | toList will convert a multiline text field (rich text) into an unordered list.

If {{ entry.field }} is: `

The quick brown fox...

...an oft repeated sententce.

Much ado about this.` {{ entry.field | toList }} will return:

  • The quick brown fox...
  • ...an oft repeated sentence.
  • Much ado about this.

|toList accepts 1 parameter to change its output. Passing 'ol' will output a numbered list. {{ entry.field | toList('ol') }} will return:

  1. The quick brown fox...
  2. ...an oft repeated sentence.
  3. Much ado about this.

Passing 'li' will only return the list items. {{ entry.field | toList('li') }} will return:

The quick brown fox......an oft repeated sentence.Much ado about this.

Free

Package Name

To install this plugin, search for its package name on the Plugin Store and click “Install”.


Information