Created
August 29, 2011 11:32
-
-
Save shiftkey/1178225 to your computer and use it in GitHub Desktop.
Enumerating Fun and Games in Ruby
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# all i wanted to do was this with what I thought was | |
# an Enumerable set of posts using Jekyll | |
{% for ps in site.posts.skip(3) %} | |
<!-- partial view --> | |
{% endfor %} | |
# but i couldn't work out what type site.posts was at runtime | |
# ( using .class didn't output anything | |
# i stumbled (literally) across this alternate syntax which works | |
{% for ps in site.posts offset:3 %} | |
<!-- partial view --> | |
{% endfor %} | |
# and this is how you do .Take as well | |
{% for ps in site.posts limit:20 %} | |
<!-- partial view --> | |
{% endfor %} | |
# sigh |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment