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

404 Error but directories are there with path #78

Closed stepin105361 closed 2 years ago

stepin105361 commented 2 years ago

Hey @jimporter , you can check my repo siteisecl in my profile and you can see that i have made my repo and then pushed the docs and file via gitbash and then did mkdocs gh-deploy (to make the gh-pages branch in the repo), after that i did mike deploy 4.0 to make the 4.0 version active in the site but before doing mike deploy 4.0 i was able to see the site but now i am getting the 404 error and you can see the mkdocs.yml file and also 4.0 folder in the gh-pages pages(its a small repo). What is happening?

jimporter commented 2 years ago

It's not necessary to run mkdocs gh-deploy, and will just add a bunch of files that you should remove later. However, that's not really the issue. Your site (https://stepin105361.github.io/siteisecl/) isn't actually being built with MkDocs at all. It's being built with Jekyll.

If you look at the deployments for your pages, you might notice that there are 2 deployments at the same time, every time you make a change: https://github.com/stepin105361/siteisecl/deployments/activity_log?environment=github-pages. The newer of the two is always the latest commit on your master branch. That's not right, but it's not something MkDocs or mike should have any direct involvement with.

Make sure you're actually using the gh-pages branch for your pages. Go to your repo -> Settings -> Pages -> Source, and check that it's set to Branch: gh-pages / (root). You could also check under repo -> Settings -> Environments -> github-pages, and try tweaking the deployment branches. I didn't have to do that on any of my repos though.

stepin105361 commented 2 years ago

Hey @jimporter , glad to catch you online, so, i made the directory into gh-pages / root now but the page looks odd. not mkdocs at all whatsoever. How to change it to look like that i made?

stepin105361 commented 2 years ago

P.S. Anyway to have a short discussion on call somewhere like zoom or meet or anything? would be glad to have a short few minutes call if its not too much to ask for. The process i followed is here:

  1. Made the whole documentation locally
  2. Made themkdocs.yml nav file
  3. Made the repo and then locally pushed them to remote by gitbash then git add commit and all that stuff
  4. Didmkdocs gh-deploy to make the gh-pages thing come up
  5. ran that git fetch thing(instruction in your repo to be able to push via mike)
  6. did mike deploy 4.0 and it made the site directory locally and pushed 4.0 to gh-pages in the repo.

You said that mkdocs gh-deploy is not necessary, then how to bring the gh-pages branch up? because without doing mkdocs gh-deploy i tried to do mike deploy 4.0, it made the files locally but didnt push to anywhere at all, and i thought that happened because there was no gh-pages to send to.

As i said, i can explain better if its possible to do communicate via a meet or something(audio and screenshare). Help me out a bit here if you can.

jimporter commented 2 years ago

@stepin105361 I looked at the site again, and everything seems fine to me now. I guess you modified your Github repo settings, because now when I visit your site (https://stepin105361.github.io/siteisecl/), I see the unversioned MkDocs docs as I'd expect, and if I visit the 4.0 subdirectory (https://stepin105361.github.io/siteisecl/4.0/), I see the versioned docs that I'd expect as well.

You said that mkdocs gh-deploy is not necessary, then how to bring the gh-pages branch up? because without doing mkdocs gh-deploy i tried to do mike deploy 4.0, it made the files locally but didnt push to anywhere at all, and i thought that happened because there was no gh-pages to send to.

Assuming your local clone is up-to-date with the remote (which you can do via git fetch), all you should need to do is mike deploy 4.0 --push. If you prefer to verify the contents of your gh-pages branch first, then call mike deploy 4.0, check that everything is ok (e.g. via mike serve), and then call git push origin gh-pages.

stepin105361 commented 2 years ago

hey @jimporter , seems like ive got a hang of it now, one last thing and sorry for bothering, but my condition now is that my files are locally present now and i need to make some changes and make it live as 4.1, can you tell me what to do ? and how do i keep changes live at github too?

jimporter commented 2 years ago

The workflow I recommend is this:

  1. If there are changes on Github that you don't have locally yet, run git pull. (Note: this should only be needed if you're working with multiple people, or you made some changes from another computer)
  2. Edit your *.md files on the master branch.
  3. Commit those files to master.
  4. git push to push your local master to Github.
  5. Run mike deploy 4.1 --push. This will compile your docs, add a commit to gh-pages, and then push to Github.