Hugo Swagger UI Module which ships with a shortcode and standalone preset layout.
Become a backer or sponsor to support our work.
Module | github.com/hugomods/swagger-ui |
---|---|
Stats |
Please use github.com/hbstack/swagger-ui
instead if you’re using HB Framework, which applies extra styles to match dark mode.
1module:
2 imports:
3 - path: github.com/hugomods/swagger-ui
Note
Please skip this step if your theme supports HugoPress, such as HB Framework themes.
1<head>
2 ...
3 {{ partialCached "hugomods/swagger-ui/assets/css" . }}
4 {{ partialCached "hugomods/swagger-ui/assets/js" . }}
5 ...
6</head>
To use a standalone preset, you’ll need to specify the layout
as swagger-ui
and the swagger_ui.url
.
1---
2title: SwaggerUI
3description: SwaggerUI
4layout: swagger-ui
5swagger_ui:
6 url: 'https://petstore3.swagger.io/api/v3/openapi.json'
7---
You can also embed Swagger UI into your content.
1{{< swagger-ui "https://petstore3.swagger.io/api/v3/openapi.json" >}}