harp
harp copied to clipboard
Directory Indexes
I need directory indexes so I made this tiny hack. Do with it what you will.
How it works:
404.html
= 404.html
about.ejs
= about/index.html
(preferred way of doing things)
folder/index.ejs
= folder/index.html
(how it is right now in 0.14.0
, and it still works)
index.ejs
= index.html
And that's it.
There are no tests. Should I create some?
Hey! Thanks so much for the pull request. We’ve had some back-and-fourth with people in the past about what’s better, and I’m honestly not sure where that lands right now.
I can say that it would dramatically more likely that we’d accept it if there were tests, but I don’t want to ask you to do that unless we’re actually wanting the feature. So—I’ll comment back here when I have an answer on that. Really appreciate the contribution!
Thanks for the response. If I find the time, I'll try to add some tests.
Added a simple test for checking the preservation of existing directory indexes and the creation of new ones.
Please let me know if I can improve it.
Update: improved compile – ignores files named after http statuses.
I haven’t forgotten about this! Thanks for adding tests. We might not be able to add it right away, but I think it’s the right approach in the long run.
Existing discussion / problems around this:
- https://github.com/sintaxi/harp/issues/149
- http://stackoverflow.com/questions/26562723/harp-compile-html-path-error/26641282#26641282
No problem – I know you guys are probably busier than I am. Glad to hear that you are (possibly) adding it in the future, too. I can't believe I missed that issue, though.
Is this pull request still being considered for inclusion in harp? It would be helpful for a project I'm working on. Thanks!