mmistakes / jekyll-theme-skinny-bones

A Jekyll starter with a variety of flexible layouts and components.
https://mmistakes.github.io/jekyll-theme-skinny-bones
MIT License
804 stars 906 forks source link

Do not display breadcrumbs on empty categories #9

Closed katafrakt closed 10 years ago

katafrakt commented 10 years ago

Apparently as for jekyll 2.4.0 (I don't know about earlier versions) page.categories is always an array, making the condition if page.categories insufficient - leading to render ugly breadcrumbs like HOME / /.

I've added additional condition to check if aforementioned array is not empty.

mmistakes commented 10 years ago

So I tested this on Jekyll 2.4.0 and doesn't seem to work properly.

Using the test posts in my gh-pages branch for Skinny Bones any of the posts with categories: articles don't show breadcrumbs at all. Posts with categories: media show fine. Not sure why the category name would effect this, but it does.

katafrakt commented 10 years ago

That's weird. I'll take a look.

katafrakt commented 10 years ago
  1. Your posts from media category use media layout and I did not update this one. My bad. That's why they worked.
  2. It looks that liquid does not like conditions like if !page.categories.empty? so I changed it into its own way to check for array length (if page.categories != empty). Seems to work for me again.