module Liquid

It works similar to Rails content_for. Calling content_for stores a block of markup in an identifier for later use. In order to access this stored content in other templates or the layout, you would pass the identifier as an argument to content_for.

Usage:

{% content_for not_authorized %}

alert('You are not authorized to do that!');

{% endcontent_for %}

You can then use content_for :not_authorized anywhere in your templates. {% if current_user.nil? %}

{% yield not_authorized %}

{% endif %}

Returns a Google Analytics tag.

Usage:

{% google_analytics_tag 'UA-XXXXX-X' %}

Returns a JavaScript tag with the content inside.

Usage:

{% javascript_tag %}

alert('Hello Liquid Rails!');

{% endjavascript_tag %}

Paginate a collection

Usage:

{% paginate listing.photos by 5 %}

 {% for photo in paginate.collection %}
   {{ photo.caption }}
 {% endfor %}
{% endpaginate %}