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

Mkdocs site_url not used to load asset #15

Closed
DennyWeinberg opened this issue Sep 27, 2023 · 2 comments
Closed

Mkdocs site_url not used to load asset #15

DennyWeinberg opened this issue Sep 27, 2023 · 2 comments

Comments

@DennyWeinberg
Copy link

DennyWeinberg commented Sep 27, 2023

I host my mkdocs on gitlab pages, inside a group, so the url is: https://namespace.gitlab.io/project.
When using swagger-ui-doc, I specify /assets/openapi.json, which works great when doing a serve. However, when opening the gitlab page, I'm getting 404 because he tries to load the json from https://namespace.gitlab.io/assets/openapi.json, so project is missing here.
In my mkdocs.yml, I tried to specify the site_url then: https://namespace.gitlab.io/project, which still doesn't help. Same result.

Any ideas?

@blueswen
Copy link
Owner

Hi @DennyWeinberg

All OpenAPI file paths are processed using relative paths, such as ../../assets/openapi.json. If this does not resolve your issue, you may provide your modocs.yml, Markdown files, and file structure.

@DennyWeinberg
Copy link
Author

Yes that worked indeed. Might be useful to add that to the doc.

Thanks!

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

No branches or pull requests

2 participants