-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
Problem loading assets in mkdocs deployed on github pages #4678
Comments
Thanks for reporting. When deploying, you need to specify Line 23 in 80b4a4c
The reason is that MkDocs will resolve asset URLs relative to the configured site URL. If no site URL is configured, |
Thank you very much for your suport, it worked perfectly!!!! |
this was in response to squidfunk#4678 (comment)
* added note on importance of site_url this was in response to #4678 (comment) * re-wording to say why site_url is always needed
Contribution guidelines
I've found a bug and checked that ...
mkdocs
orreadthedocs
themescustom_dir
,extra_javascript
andextra_css
Description
Hello, don't know if this is the right place to ask for help, but i'm having a little problem and can't find the solution to it. By the way, love mkdocs and the material theme and I would appreciate if you could help me.
Mkdocs works perfect when served locally (localhost), but displays without styles or images when deployed to github.
Thank you in advance, if more information is needed please let me now.
Expected behaviour
I installed mkdocs, initiated a new project in a repo and configurated the yaml as the guide said. mkdocs serves works perfect as in local server everything displays as expected. Then I deploy with the command with the option gh-deploy on mkdocs but on github doesn't load assets images or styles, only the HTML.
Actual behaviour
This is where the build shoud deploy the website. I did it from command line via mkdocs command, and it pushed to the new branch of the repository (gh-deploy)
https://danimrprofe.github.io/apuntes/
As you can see no styles ar shown:
This is how the website is displayed (without styles). Seems to be looking at the media in the root of the URL, where they are not. I mean, the HTML looks for:
https://danimrprofe.github.io/assets/images/favicon.png
Instead of where it really is:
https://danimrprofe.github.io/apuntes/assets/images/favicon.png
My pages options in the repo.
Steps to reproduce
Package versions
Configuration
System information
The text was updated successfully, but these errors were encountered: