rohitkoul / hugo-swagger-shortcode

MIT License
4 stars 3 forks source link

Generated content not using baseUrl #1

Open simonwfarrow opened 5 years ago

simonwfarrow commented 5 years ago

Firstly - thanks for the shortcode.

When I generate from a markdown file with this content: {{< swagger-spec url="../api.yaml" >}}

The generated index.html script tag does not have the correct relative path for the swagger-ui js files. I set the baseUrl on the build by running: hugo -b="http://localhost/pages/"

This generates a script tag like :

When it should be :

All other links apply this correctly.

simonwfarrow commented 5 years ago

I think the fix is to change to this in the swagger-spec.html

<script src="{{"js/swagger-js/swagger-ui-bundle.js"| relURL}}">