benbalter/jekyll-readme-index

Add support for using README as index in folders as well

Closed this issue ยท 6 comments

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)

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.

@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.

@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.

@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).

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/

Fixed via #5.