sergeche/docpad-plugin-menu — pull request #11 by maxlinc (2014-02-07 19:26:55+00:00)
Title: Option to skip documents with no menuOrder

I was trying to use the plugin and I found that it generated links for many unwanted pages, including custom error pages (e.g. 404.html.eco), blog posts, and other items I don't want to appear.

The simplest, most intuitive solution for me would to only include a page in the menu if `menuOrder` is set. This PR attempts to do that by adding a `skipUnordered` option to the plugin.

I originally hoped to skip if item.order was nil, but I ran into two issues:
- item.order seems to default to 0 somewhere
- I had to limit it to "leaf items" - items with documents - to make sure children a set `menuOrder` still showed up.

Let me know if you think there's a safe way to clean it up further. Perhaps deleting [line 23](https://github.com/maxlinc/docpad-plugin-menu/blob/master/src/menu.plugin.coffee#L23)?