diff --git a/lib/locomotive/liquid/drops/content.rb b/lib/locomotive/liquid/drops/content.rb index 118d4380..2e3fcb37 100644 --- a/lib/locomotive/liquid/drops/content.rb +++ b/lib/locomotive/liquid/drops/content.rb @@ -9,10 +9,28 @@ module Locomotive self._source._id.to_s end + # Returns the next content for the parent content type. + # If no content is found, nil is returned. + # + # Usage: + # + # {% if article.next %} + # Read next article + # {% endif %} + # def next self._source.next.to_liquid end + # Returns the previous content for the parent content type. + # If no content is found, nil is returned. + # + # Usage: + # + # {% if article.previous %} + # Read previous article + # {% endif %} + # def previous self._source.previous.to_liquid end