0

i'm using jekyll to build a simple personal portfolio, and so far it's been fantastic.

on the index page, i'm trying to get a bunch of image thumbnails of varying sizes to display - in whatever way they best fit - using Dave Desandro's Isotope. these thumbnails link to full pages about each project.

the problem is, the jekyll file format of 0100-01-01-file.md pre-sorts all the posts by date, so by the time the Isotope script runs, all the images are just in chronological order, and not fit together like tetris bricks. this leaves these awkward rows of variously sized images, instead of a nice brick wall-looking thing.

jekyll-issue

is there any way to go around, override, or avoid using the date function? i just want the images mashed in there, in no particular order.

index page code looks like:

{% for item in site.categories.project reversed %}
  <a href='{{site.baseurl}}{{item.url}}' class='project pad1'>
    <img src='{{item.splash}}' class='splash'>
  </a>
{% endfor %}

where "splash" is the thumbnail image. thanks in advance for your help.

ryan
  • 33
  • 1
  • 7
  • I'm also fairly new to Jekyll but I'm also loving it. From what it looks like there's not much control over sorting an array, but this post may offer some insight: http://stackoverflow.com/questions/9218769/order-an-array-with-jekyll-liquid-template – trnelson Oct 21 '14 at 18:04

1 Answers1

1

By default post are sorted by date but you can sort them with any post variable.

 {% assign posts = site.categories.project | sort: "title" %}

If you set a weight: 10 you can sort your post by weight.

David Jacquel
  • 51,670
  • 6
  • 121
  • 147