Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Directory Indexes #364

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Directory Indexes #364

wants to merge 3 commits into from

Conversation

oscarpalmer
Copy link

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?

@kennethormandy
Copy link
Collaborator

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!

@oscarpalmer
Copy link
Author

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

fixed a leaking global variable
@oscarpalmer
Copy link
Author

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.

uses http.STATUS_CODES to ignore error pages
test added for the above
@kennethormandy
Copy link
Collaborator

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:

@oscarpalmer
Copy link
Author

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.

@juliepagano
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants