redoc
redoc 短代码采用开源工具 Redoc,能够基于 OpenAPI YAML 或 JSON 文件生成参考性 API 文档。该文件可存放于任意位置(例如您站点的根目录 /static, 静态文件夹中),也可直接使用 URL 地址进行引用,例如:
---
title: 'Pet Store API'
type: docs
weight: 1
description: Reference for the Pet Store API
---
{
{
</* redoc
"https://raw.githubusercontent.com/OAI/OpenAPI-Specification/main/examples/v2.0/yaml/petstore.yaml"
*/>,
},
}