Redo and add more documentation to gh-pages.

This commit is contained in:
Brendan Dahl 2014-04-10 10:01:51 -07:00
parent 80fed15dd3
commit 3ce622a106
16 changed files with 530 additions and 23 deletions

View file

@ -0,0 +1,15 @@
module.exports = (env, callback) ->
count = (string, substr) ->
num = pos = 0
return 1/0 unless substr.length
num++ while pos = 1 + string.indexOf(substr, pos)
num
env.helpers.makeRelative = (source, dest) ->
return dest unless dest.indexOf("/") == 0
depth = count(source, '/') # 1 being /
ret = ""
ret += "../" while depth = depth - 1
ret + dest.substr(1)
callback()