Skip to content

Instantly share code, notes, and snippets.

@lukecathie
Created December 18, 2014 09:36
Show Gist options
  • Select an option

  • Save lukecathie/2b4eaad90467b3a7c266 to your computer and use it in GitHub Desktop.

Select an option

Save lukecathie/2b4eaad90467b3a7c266 to your computer and use it in GitHub Desktop.
Jekyll sort collections by date desc
{% assign work_items = site.work_items | sort: 'date' | reverse %}
{% for work_item in work_items limit:4 %}
<div>
<a href="{{ work_item.url | prepend: site.baseurl }}">{{ work_item.title }}</a>
</div>
{% endfor %}
@grrseguin

Copy link
Copy Markdown

๐Ÿ‘

@Chetabahana

Chetabahana commented May 19, 2018

Copy link
Copy Markdown

Possible also to add weight. e.g., weight: 100
{% assign work_items = site.work_items | sort: 'weight' %}

@SeanFromIT

Copy link
Copy Markdown

๐Ÿ‘

@jtoy

jtoy commented Dec 22, 2019

Copy link
Copy Markdown

thanks!

@akshayKhot

Copy link
Copy Markdown

Thanks!

@garraflavatra

Copy link
Copy Markdown

thanks!

@leedh

leedh commented Jan 7, 2022

Copy link
Copy Markdown

Thank you! Helpful

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment