Closed reginapizza closed 3 years ago
mike serve
shows you whatever is currently in your gh-pages
branch, not any local changes you've made. To update that, you'll need to run mike deploy
to create a commit with the latest changes on your gh-pages
branch.
For your case though, the easiest way to edit things would probably be to check out your gh-pages
branch and edit version-select.(js|css)
directly, then run python -m http.server 8000
to start up a test server to check the results in the browser. Once you're happy with the results, just copy version-select.(js|css)
to the docs folder of your main branch.
Thanks for the response. I tried what you said and I'm getting:
Serving HTTP on 0.0.0.0 port 8000 (http://0.0.0.0:8000/) ...
127.0.0.1 - - [18/Dec/2020 17:47:47] code 404, message File not found
127.0.0.1 - - [18/Dec/2020 17:47:47] "GET /1.7/ HTTP/1.1" 404 -
127.0.0.1 - - [18/Dec/2020 17:47:49] code 404, message File not found
127.0.0.1 - - [18/Dec/2020 17:47:49] "GET /1.7/ HTTP/1.1" 404 -
and my browser just shows a white page with the error response.
These are the steps I took:
regina-dev
) with my changes to remote branchgit checkout gh-pages
git pull origin regina-dev
git reset --hard regina-dev
mike deploy 1.7
mike deploy 1.7.1 latest --rebase
(told me mike: gh-pages is unrelated to origin/ph-pages
, Pass --ignore to ignore this or --rebase to rebase onto remote
mike list
(showed me 1.7.1 [latest] and 1.7)mike serve
(didn't have my changes)python -m http.server 8000
Really not sure where exactly I'm going wrong here
You shouldn't run mike deploy
from a checkout of the gh-pages
branch, since it won't be able to build your docs (the sources for the docs are on your other branch), and will probably cause weird things to happen. If you have some versioned docs already on the gh-pages
branch, then python -m http.server 8000
(from gh-pages
) should host your dos locally. For example:
git init
[edit docs]
mike install-extras
mike deploy 1.0 latest
mike set-default latest
git checkout gh-pages
[edit version-select.(js|css)]
python -m http.server 8000
Thank you so much @jimporter, this fixed my issue! I guess I just wasn't understanding how this worked with gh-pages but all good now
Hello! First off, thank you so much for this amazing tool, it's helping me tremendously to add versioning to material theme with mkdocs.
Regarding this issue, I'm almost sure I'm just doing something wrong, but when I run
mike serve
, my changes are not rendering in the browser when I check my sources in chrome developer tools. I have installedmike
and runmike install-extras
. When I runmike list
I have1.7
and1.7.1 [latest]
, and I've set my default withmike set-default latest
. All that works fine, and I can see my dropdown in the sidebar nav. I'm trying to move the dropdown to live in the header, but my code is not picking up the changes. Not sure it's necessary, but I've also runmkdocs build
and tried pushing my updated code up to my remote branch, neither of these solved my issue.My file structure from root looks like:
Not sure what else to try or if I'm doing something wrong, thank you in advance!