Skip to content

A shortcode for Hugo https://gohugo.io/ which allows you to include Open API Spec (formerly Swagger) in a page.

License

Notifications You must be signed in to change notification settings

ryanfang5/hugo-openapispec-shortcode

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 

Repository files navigation

hugo-openapispec-shortcode

============================

This is a Hugo Shortcode to embed the Open API Spec (formerly known as Swagger Spec) in a page.

You can see an example here and the source for the example here.

Installation

==============

This repository has the following files that need to be copied into your Hugo site's directory:

  • ./layouts/shortcodes/oai-spec.html to your ./layouts/shortcodes directory
  • ./static/scripts/* to your ./static directory
  • ./static/swagger-ui/* to your ./static directory

Usage

=======

To embed the API documentation below you just need to include the following shortcode:

{{< oai-spec url="http://petstore.swagger.io/v2/swagger.json" api_key="special-key" >}}

There are just two options:

  • url (required) - the url of the Open API Spec
  • api_key (optional) - the API Key you want embedded in your document

Known Issues

==============

Currently known issues:

Live Reload currently fails when running locally. I'd recommend using the following command line options for Hugo which disables live reload and manually reload your page to see changes:

hugo server --watch --disableLiveReload

About

A shortcode for Hugo https://gohugo.io/ which allows you to include Open API Spec (formerly Swagger) in a page.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 96.0%
  • CSS 3.8%
  • HTML 0.2%