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 support for using README as index in folders as well #2

Closed
FokkeZB opened this issue Dec 13, 2016 · 6 comments
Closed

Add support for using README as index in folders as well #2

FokkeZB opened this issue Dec 13, 2016 · 6 comments

Comments

@FokkeZB
Copy link

FokkeZB commented Dec 13, 2016

It would be great if the plugin would not just work on the root README, but on READMEs in any folder, unless there is already an index.

The benefit here is that relative links in markdown sources could point to folders, which would then render fine in Jekyll and when browsing the source on GitHub would also show the index (since GitHub shows README in a folder)

@benbalter
Copy link
Owner

The benefit here is that relative links in markdown sources could point to folders, which would then render fine in Jekyll and when browsing the source on GitHub would also show the index (since GitHub shows README in a folder)

This may be better implemented in https://github.com/benbalter/jekyll-relative-links.

@FokkeZB
Copy link
Author

FokkeZB commented Dec 13, 2016

@benbalter wow, I didn't know about that one! To bad that like benbalter/jekyll-optional-front-matter#5 it doesn't seem to work on collections I'll create an issue for that.

That said, I don't think it belongs in that plugin because I think what I want works the other way. On GitHub, when I have a Markdown file with a link to a folder (e.g. check [this]) and I have this/README.md then GitHub is so kind to display that README.md with the folder listing. Now when generated as Jekyll site I'd like the link unchanged but this/README.md rendered at this/index.html so that I get the same effect. So I don't want the link to change, but the basename of the file.

@stevemoser
Copy link

@FokkeZB Exactly. If the goal of these changes is to 'make it work like github.com' then a README.md should be agnostic to which folder it is in.

@benbalter
Copy link
Owner

@FokkeZB I understand your logic. It's slightly different, in that [this] is a link to the folder listing, and GitHub.com decorates that folder listing with the folder's README, if present, but I am sympathetic to your logic. Can you explain a bit more about why you're linking to a folder (a link would be helpful, if public).

I'm hesitant to add the feature without a strong use case, because I suspect scanning every folder for the existence of a README would be much more expensive than only looking in the root (or only looking when linked to).

@FokkeZB
Copy link
Author

FokkeZB commented Dec 14, 2016

Put simple, I just want browsing the markdown sources on GitHub to be identical as browsing the generated site.

On GitHub, you'd want to link to the dir and not the README in that for because that gets you both the directly listing (similar to a local menu on the site) and the README. Plus, if the README is a fallback for having an index.md, then the link doesn't need to be modified when generating the site. It's clean, good UX on both source and site side.

I'd like to implement this for https://github.com/TheThingsNetwork/docs/

@benbalter
Copy link
Owner

Fixed via #5.

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

No branches or pull requests

3 participants