creationix / wheat

Wheat is a blog engine for coders written in node.JS
Other
1.36k stars 134 forks source link

Check for categories #14

Closed TooTallNate closed 13 years ago

TooTallNate commented 13 years ago

The new categories seem awesome!

I found a glitch while testing them out: when an article has no categories, the chaos!

acmarques commented 13 years ago

Ooops, I think I left this comment in the wrong place! :)

I noticed this issue yesterday, but I did a slightly different solution:

http://github.com/acmarques/wheat/commit/cb848e687a1687616d70a4cbb0969cf650b68765

When reading the article, if there are no categories declared, I simply return an empty array. The problem is that I was returning undefined.

This way it is not necessary to change code in other places than in the article function.

What do you think guys?