jimporter / mike

Manage multiple versions of your MkDocs-powered documentation via Git
BSD 3-Clause "New" or "Revised" License
534 stars 47 forks source link

Not able to read the .md files or html files #68

Closed stepin105361 closed 3 years ago

stepin105361 commented 3 years ago

@jimporter I have a directory where i've got a mkdocs.yml file and i have no issues serving it locally even on GitHub(via mkdocs serve), but while serving it locally through MIKE for versioning i am facing the issue where mike is not able to find the document. The process i am following is just for the first version i am giving mike deploy 0.4 as the first version to deploy and after that I put mike serve to see it locally. It is able to produce the first page of the whole thing but when i am navigating to the next page it showing 404 not found and the directory it is searching for the document it's trying to fetch is also not there i.e its putting %20 after all folder names and i dont think its anywhere like that either on the site folder built by the mkdocs and mike or the docs folder i have. Some solution/insight regarding this issue will be appreciated.

git issue 404 git issue directory
jimporter commented 3 years ago

Do you have a repository where I can see the source .md files (and ideally the resulting .html pages)? It's hard to debug this without more information.

However, as a guess, it sounds like you might not be using relative paths in your .md files; otherwise, the URL in your 404 should start with the version number, (i.e. /0.4/quick-start-guides/...). If you have a link that looks like [my link](/quick-start-guides/...), you should get rid of the leading slash (and adjust the relative path as needed) so it looks like [my link](quick-start-guides/...).

If this is indeed the problem, it's not just a mike issue. MkDocs doesn't support absolute paths for links, and advises relative paths instead.

stepin105361 commented 3 years ago

FIrst, The relative path in .md files? The .md files contains the content needed to be displayed and they do not contain any paths per se. Second, even without versioning implementation, when i am trying to serve, i am getting the 404 error. Third, even when i am implementing versioning via mkdocs deploy 4.0 and then serving it(i already have the folder 4.0 where the docs are there) and then performing mkdocs serve, I am getting same 404 error with the directory asking for the version folder i.e.

git issue 4
jimporter commented 3 years ago

Unfortunately, there's not much more help I can provide unless you have a repository I can examine, ideally with both your .md source files and the generated .html. Without that, all I can do is guess.

EDIT: Scratch that, I think I found the repo in question and can reproduce the issue. I have a fix in progress, but note that this shouldn't affect your ability to deploy the site to Github. It only causes issues when using the local development server (mike serve).

stepin105361 commented 3 years ago

https://github.com/stepin105361/Isecl-site The site is also live at https://stepin105361.github.io/Isecl-site/ Above is the repo and when i try to mike serve it locally it shows 404 errors. Hope this info helps. Because after this thing is solved, implementing more versions should not be an issue I think.

jimporter commented 3 years ago

Cool, I'm glad it's working properly on the live site. My fix for the development server (mike serve) will be out with v1.1.1, whenever that happens (probably a couple of weeks, but it really depends on when I have time).

stepin105361 commented 2 years ago

Any Updates @jimporter ? I needed it to make my website versions live.

jimporter commented 2 years ago

Based on the discussion above, it seems like this has always worked on the live site (i.e. github.io), but the bug was that the local development server didn't properly unescape URLs from requests. That part is fixed and shipped as a part of v1.1.1 (released Sep 13).

As I understand things, there's nothing left to do here. Is there still an issue? If so, could you describe it in more detail, and ideally show an example of the problem in action?