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

Add link to root directory #23

Closed
whitneyit opened this issue Nov 13, 2014 · 10 comments
Closed

Add link to root directory #23

whitneyit opened this issue Nov 13, 2014 · 10 comments
Assignees

Comments

@whitneyit
Copy link

Currently, the htmlPath function correctly returns a series of links to child directories of a resource, but it does not provide a link to the "root" folder.

For example. Given you have navigated to "/foo/bar", the following html is created:

<h1>
    /
    <a href="/foo">foo</a>
    /
    <a href="/bar">bar</a>
</h1>

Would you guys be open to a PR that would simply prepend the following "<a href="/">~</a>" to what is being returned by htmlPath so as the generated html would look like this:

<h1>
    <a href="/">~</a>
    /
    <a href="/foo">foo</a>
    /
    <a href="/foo/bar">bar</a>
</h1>

This way there is a quick link back to the root folder of the directory that is being served.

@dougwilson
Copy link
Contributor

I'm not sure if ~ makes sense (especially since that signifies "user's home directory" in linux-like stuff). What does Apache do (this is modeled after Apache)?

@whitneyit
Copy link
Author

Yea I just chose the tilde cause nothing else really fit. The apache variant doesn't include a breadcrumb. If you want some examples just google "mp3 apache index of".

We could recycle one of the icons and serve that instead?

@dougwilson
Copy link
Contributor

If you want some examples just google "mp3 apache index of".

Ooo, good idea!

We could recycle one of the icons and serve that instead?

You mean use an icon for that path component? That could probably work. My only other thought was a ".", which is so tiny and probably no one would notice, or maybe a word? I do agree we should add the root link, though :) Just trying to think of a good way to fit it in.

@whitneyit
Copy link
Author

Yea a word seems simple enough, maybe, "root", "index", or something like that. Also, what the name of the root folder? So if you're serving from ~/Code/project the example above could be [project] / [foo] / [bar]. I'm not a total fan of that but it's an option.

In regards to icons, If you checkout the breadcrumbs on the apple site, they use their logo as the to go to the home page. So using an icon their isn't totally unacceptable.

@whitneyit
Copy link
Author

How about we just use ~. I chose it cause it means home as you said and that's what you're doing, navigating home. If there are any other complaints or pull requests it can be addressed there. Until then, how about we merge this instead of it getting forgotten.

@dougwilson
Copy link
Contributor

Until then, how about we merge this instead of it getting forgotten.

It doesn't get forgotten :) Issues like this stay in my inbox until they are resolved. We'll probably simply use an image. Perhaps drive.png, or if you think of a better one from this list: http://www.famfamfam.com/lab/icons/silk/previews/index_abc.png

@whitneyit
Copy link
Author

Yea drive.png works for me. Do you want me to create a PR?

@dougwilson
Copy link
Contributor

lol, I'm just going to use ~

@whitneyit
Copy link
Author

lol. Cheers

dougwilson added a commit that referenced this issue Dec 4, 2014
dougwilson added a commit that referenced this issue Dec 11, 2014
@dougwilson dougwilson self-assigned this Jan 2, 2015
@dougwilson
Copy link
Contributor

Published as 1.6.0

thaiat pushed a commit to thaiat/serve-index that referenced this issue Nov 23, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants