blueswen / mkdocs-swagger-ui-tag

A MkDocs plugin supports adding Swagger UI to the page.
https://blueswen.github.io/mkdocs-swagger-ui-tag/
MIT License
75 stars 7 forks source link

Mkdocs site_url not used to load asset #15

Closed DennyWeinberg closed 10 months ago

DennyWeinberg commented 11 months ago

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 commented 10 months ago

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 commented 10 months ago

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

Thanks!