Module: Lifer::Builder::HTML::FromLiquid::Filters

Defined in:
lib/lifer/builder/html/from_liquid/filters.rb

Overview

This module provides Liquid filters to be used within Liquid templates. In many cases these utilities exist to be pseudo-compatible with Jekyll.

Examples:

A filter in a Liquid template.

{{ entry.published_at | date_to_xmlschema }}

Instance Method Summary collapse

Instance Method Details

#date_to_xmlschema(input) ⇒ String

Converts date to ISO-8601 format.

Parameters:

  • input (String)

    A date string, I hope.

Returns:

  • (String)

    The transformed date string.



15
# File 'lib/lifer/builder/html/from_liquid/filters.rb', line 15

def date_to_xmlschema(input) = Util.date_as_iso8601(input)

#handleize(input) ⇒ String

Transforms a string to kabab-case.

Examples:

Result

handleize("hello_there") #=> "hello-there"

Parameters:

  • input (String)

    A string.

Returns:

  • (String)

    The transformed string.



24
# File 'lib/lifer/builder/html/from_liquid/filters.rb', line 24

def handleize(input) = Util.handleize(input)