chrisbobbe / jekyll-theme-prologue

A Jekyll version of the "Prologue" theme by HTML5 UP
https://chrisbobbe.github.io/jekyll-theme-prologue/
Other
429 stars 932 forks source link

Cannot sort a null object error #54

Open ghost opened 4 years ago

ghost commented 4 years ago

When I ran your theme I got this error:

Liquid Exception: Liquid error (line 1): Cannot sort a null object. in /_layouts/home.html

The row is:

{%- assign _sections = site.sections | sort: 'order' -%}

I had to remove the sort method to get it runs. Perhaps it should check if the object is null before sorting?

tannersullie commented 2 years ago

Thank you so much for this. I was going crazy last night. I am using the remote-theme and got the following error:

Liquid Exception: Liquid error (/private/var/folders/_r/t6w49w3n7wvbt7k50vr89trr0000gn/T/jekyll-remote-theme-20220410-1850-92d3dj/_includes/documents-collection.html line 4): Cannot sort a null object. included in /_layouts/collection.html

After removing the sort on a "portfolio-archive.md" page, boom. Worked.