Skip to content

Allow non-index.md files to be used as the homepage #608

Closed

Description

@d0ugal

ReadTheDocs allows README.md files, GitHub also renders those as the root. We should support that and/or a way for users to pick.

Activity

  1. added this to the 1.0.0 milestone on Jun 7, 2015
  2. waylan commented on Jun 7, 2015

    @waylan
    Contributor

    While I understand the desire not to duplicate information, I'm having trouble understanding how this would work. In my projects the README.md file is in the same dir as mkdocs.yml. However, the homepage would be at docs/index.md. Right now anyone using non-windows systems could potentially use a symbolic link for one of them, but that is not cross-platform and may not always work with version control systems, so it's not really a tenable solution. Would there be some setting which points to the README which effectively says "use this file instead of docs/index.md"? But what would the path be relative to?

  3. d0ugal commented on Jun 7, 2015

    @d0ugal
    ContributorAuthor

    Quite often people name the root document docs/README.md - one advantage is that GitHub renders that and can make the documentation browsable, assuming you link well enough from that page. I'm not sure if there are any other advantages.

  4. d0ugal commented on Jun 7, 2015

    @d0ugal
    ContributorAuthor

    This is the example I seen today while replying to an post on the mailing list. https://github.com/apache/aurora/tree/master/docs

  5. waylan commented on Jun 7, 2015

    @waylan
    Contributor

    Ah, got it. I hadn't considered that. Thanks.

  6. SEJeff commented on Jun 8, 2015

    @SEJeff

    Instead of hardcoding either index.md or README.md, why not simply keep the existing code and add a config option like index_page or something:

    This seems totally reasonable to me and could be added to the existing documentation prominently:

    index_page: README.md

    Surely this can't be that hard to do? I might be willing to take a stab at it as I'd really like to move the Aurora docs over towards using mkdocs if possible. To get buy-in on that from the core team / committers would require this feature.

    Oh and for reference, check this mkdocs theme out which perfectly replicates the upstream documentation site rendered using the ruby tool middleman.

  7. d0ugal commented on Jun 8, 2015

    @d0ugal
    ContributorAuthor

    @SEJeff You are right, it really wouldn't be that hard technically to implement. However, I am on a constant mission to keep the number of configuration options as low as possible. I think that is a reasonable addition however, I just want to carefully consider it.

    One alternative would be to automatically try a few names in order, for example, index.md then README.md then home.md.

    Oh and for reference, check this mkdocs theme out which perfectly replicates the upstream documentation site rendered using the ruby tool middleman.

    Nice! Looks like that is shaping up well.

  8. d0ugal commented on Jun 8, 2015

    @d0ugal
    ContributorAuthor
  9. SEJeff commented on Jun 8, 2015

    @SEJeff

    If that's what you'd prefer, it totally works for me.

  10. d0ugal commented on Jun 10, 2015

    @d0ugal
    ContributorAuthor

    Thinking about this a bit more, there are really two cases we need to cover.

    • If the user doesn't manually provide a pages config, we should make the index.md the index if it exists, if it doesn't try README.md and if neither are found display an error.
    • If the user does define the full pages structure, we should take the first one and make that the homepage regardless of what the files are called.
  11. fedotxxl commented on Aug 14, 2015

    @fedotxxl

    +1 for index_page: README.md

  12. BrianHicks commented on Dec 7, 2015

    @BrianHicks

    Is this in a released version? I'd really like to use it as well.

  13. waylan commented on Dec 7, 2015

    @waylan
    Contributor

    This issue is still open as it hasn't been added at all. I'm sure a pull request implementing it would be welcome.

  14. machow commented on Jan 12, 2016

    @machow

    +1, I've run into the same problem. Do you think the implementation should start from the refactoring branch or master?

  15. 3 remaining items

  16. GPMueller commented on Jul 14, 2017

    @GPMueller

    @waylan

    Would there be some setting which points to the README which effectively says "use this file instead of docs/index.md"? But what would the path be relative to?

    How about relative to docs_dir? It might also be nice to be able to actually specify the top-level Readme of a repo as index_page.

  17. ppKrauss commented on Sep 9, 2017

    @ppKrauss

    Hi @GPMueller, @llonchj , @fedotxxl, @waylan ... Perhaps the easiest way is to express the external files (any that is not into /docs) at mkdocs.yml, and the mkdocs-software validating relative paths, example:

    pages:
        - Home: ../README.md
        - Topic1: topic1.md
        - Topic2: ../repoTopic/README.md
  18. waylan commented on Sep 10, 2017

    @waylan
    Contributor

    @ppKrauss this issue is about converting README.md => index.html without changing location. Basically, when no index.md is found within a dir within the docs_dir, but README.md is found, then README.md is used and treated as if it was index.md. Using a file from a different location is an entirely different issue which should be addressed via symbolic links.

  19. ppKrauss commented on Sep 10, 2017

    @ppKrauss

    @waylan I have no good experience with symbolic links when working with git clone... This is the main cenario, all the contents in a git repo. See eg. this readme, this other and this other one, all in folder or subfolder structures of a repo.... Not make sense, for me, an "working overhead" for user, making and controling symbolic links.

    I not understand the problem with relative paths with ../
    perhaps an option in mkdocs or config, to enable/disable "external files from doc_dir" (default as disable no problem).

  20. waylan commented on Sep 10, 2017

    @waylan
    Contributor

    @ppKrauss as I stated previously, that is a different issue than is being discussed here. Please keep the discussion here to the relevant issue of using a README file as an index file.

  21. ppKrauss commented on Sep 10, 2017

    @ppKrauss

    Hi @waylan , please reopen #1279 to discuss this global solution.

  22. valzi commented on Jan 20, 2018

    @valzi

    Has this been implemented yet? I hate having to keep my file named index.md. I regularly export it to PDF and have to rename the pdf file every time.

  23. ppKrauss commented on Jan 20, 2018

    @ppKrauss

    PS: this issue is "about converting README.md => index.html without changing location"... But I think that not make sense when I say - Home: ../README.md at mkdocs.yml (!).
    There are a precedence order, and is natural to suppose mkdocs.yml on the top:

    1. Use as global index.html what mkdocs.yml say to use as Home.
    2. Use as global index.html the root's README.md.
    3. Use as global index.html the root's index.md.
  24. shacker commented on Apr 7, 2018

    @shacker

    @d0ugal (2015):

    For reference, ReadTheDocs look for an index.md file and then try README.md if it can't be found.

    That is not what I experienced today. When I built the project from github with only a README.md, then followed the link provided by RTD, I got a 404. I then renamed the doc to index.md and rebuilt, and it worked (but of course that leaves my github repo without a displayed readme).

  25. ve3 commented on Dec 7, 2019

    @ve3

    I see that this issue is closed but still cannot found how to change index page to something that is not index.md, readme.md.

  26. waylan commented on Dec 7, 2019

    @waylan
    Contributor

    @ve3 We closed this when we added support for readme.md. We have no intention of supporting any other file names as index pages.

  27. ve3 commented on Dec 8, 2019

    @ve3

    I see @d0ugal mentioned about home.md too this file is created and use in GitHub Wiki page.
    It would be good if mkdocs support it. :)

  28. alcorwalter commented on Nov 29, 2022

    @alcorwalter

    I don't understand this choice as Mkdocs is structure/file based.
    My documentations deserve better structure readability. If you have to maintain many collaborative documentations, it's impossible to guess the content of files named "index.md" or "readme.md". I would find it really useful to have a contextual/user-defined name for the first/default page.

  29. added a commit that references this issue on Jan 18, 2025
    34ef3ca
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions