Added examples
This commit is contained in:
parent
75f4835d3e
commit
769b0569db
@ -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 %}
|
||||
# <a href="/articles/{{ article.next._permalink }}">Read next article</a>
|
||||
# {% 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 %}
|
||||
# <a href="/articles/{{ article.previous._permalink }}">Read previous article</a>
|
||||
# {% endif %}
|
||||
#
|
||||
def previous
|
||||
self._source.previous.to_liquid
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user