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

Redirect readme.md to index.md creates redirect loop #36

Closed
drts01 opened this issue Apr 11, 2022 · 3 comments · Fixed by #37
Closed

Redirect readme.md to index.md creates redirect loop #36

drts01 opened this issue Apr 11, 2022 · 3 comments · Fixed by #37

Comments

@drts01
Copy link
Contributor

drts01 commented Apr 11, 2022

I believe v1.0.4 resolves issue #24, but introduces the same result when use_directory_urls is set to false.

use_directory_urls: false

theme:
  name: "material"

plugins:
- redirects:
    redirect_maps:
      index.md: readme.md
@oprypin
Copy link
Contributor

oprypin commented Apr 11, 2022

Sorry, it isn't immediately clear to me what you mean.

So you're saying there is a problem, and to reproduce it it is enough to just create this config, no actual doc files necessary.

And what exactly is the issue (expected result vs actual result)?

@oprypin
Copy link
Contributor

oprypin commented Apr 11, 2022

Ah it's in the title, I missed that

Redirects to nested README.md/index.md

that'd be "actual"

and "expected" would be redirects to... wait what? Aren't these two paths equivalent in the result, meaning that the redirect is not needed?

@drts01
Copy link
Contributor Author

drts01 commented May 16, 2022

I am trying to achieve a structure like:

use_directory_urls: false

theme:
  name: "material"
  features:
    - navigation.indexes
    - navigation.tabs
    - navigation.top

plugins:
  - redirects:
      redirect_maps:
        index.md: readme.md

nav:
  - Home:
    - Readme: readme.md
    - Changelog: changelog.md
    - Contributing: contributing.md
    - License: license.md
  - Source: code/

This works for me in v1.0.3 because the readme check use to happen only if use_directory_urls was True. d983418#diff-e301f7075814e13e828bc2c0c891570d8429bcc915cbb25854f3715aeadee276R76-R82

I have opened an issue with Mkdocs to determine the proper behavior of readme.md, mkdocs/mkdocs#2846

drts01 added a commit to drts01/mkdocs-redirects that referenced this issue May 16, 2022
@drts01 drts01 changed the title Redirects to nested README.md/index.md without directory URLS Redirect readme.md to index.md creates redirect loop May 17, 2022
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 a pull request may close this issue.

2 participants