harp icon indicating copy to clipboard operation
harp copied to clipboard

Directory Indexes

Open oscarpalmer opened this issue 9 years ago • 6 comments

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?

oscarpalmer avatar Oct 20 '14 19:10 oscarpalmer

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!

kennethormandy avatar Oct 20 '14 20:10 kennethormandy

Thanks for the response. If I find the time, I'll try to add some tests.

oscarpalmer avatar Oct 20 '14 21:10 oscarpalmer

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.

oscarpalmer avatar Oct 21 '14 10:10 oscarpalmer

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

kennethormandy avatar Oct 29 '14 21:10 kennethormandy

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.

oscarpalmer avatar Oct 30 '14 00:10 oscarpalmer

Is this pull request still being considered for inclusion in harp? It would be helpful for a project I'm working on. Thanks!

juliepagano avatar Jun 15 '15 22:06 juliepagano