Skip to content

Commit

Permalink
Don't use hardcoded index files
Browse files Browse the repository at this point in the history
contentTree.index now returns first item in tree beginning with index

Fixes #28
  • Loading branch information
jnordberg committed Jul 30, 2012
1 parent 3b6f2c2 commit f6f3e1c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/content.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,9 @@ ContentTree = (filename) ->
Object.defineProperty @, 'filename',
get: -> filename
Object.defineProperty @, 'index',
get: -> @['index.md'] or @['index.markdown']
get: ->
for key, item of this
if key[0...5] is 'index' then return item

ContentTree.fromDirectory = (directory, base, callback) ->
if !callback?
Expand Down

0 comments on commit f6f3e1c

Please sign in to comment.