Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
Title: RDI API Reference
layout: rdiapireference
linkTitle: RDI API Reference
Title: Redis Data Integration API
layout: apireference
type: page
---
3 changes: 2 additions & 1 deletion content/operate/rc/api/api-reference.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
Title: API Reference
Title: Redis Cloud API
linkTitle: API reference
layout: apireference
type: page
---
47 changes: 44 additions & 3 deletions layouts/_default/apireference.html
Original file line number Diff line number Diff line change
@@ -1,11 +1,52 @@
<!DOCTYPE html>
<html>
<!--
This layout can be used to generate API docs from an OpenAPI specification.

When creating a new API reference page, you can specify these optional params in the front matter:
- sourcefile: The path to the OpenAPI specification file (YAML or JSON) relative to the page. Default: ./openapi.json
- backLink: The path to the page to link to in the top left corner. Default: Parent page

Here's what the file structure should look like to use this template:
<containing-folder>/
├---------api-reference/
| └------<spec-file-name> (default openapi.json)
|
├---------api-reference.md
|
└---------<other files>

Here's what the api-reference.md front matter should look like:
---
Title: <API Name>
linkTitle: API reference
layout: apireference
type: page
params:
sourcefile: ./<spec-file-name> (optional - only specify if not using ./openapi.json)
backLink: <path-to-page> (optional - only specify if not using the parent page)
---

Example usage for the Redis Cloud API with all params set:
---
Title: Redis Cloud API
linkTitle: API reference
layout: apireference
type: page
params:
sourcefile: ./openapi.json
backLink: operate/rc/api
---
-->

<head>
<title>Redis Cloud API</title>
<title>{{ .Title }}</title>
{{ partial "scss.html" (dict "path" "scss/style.scss") }}
{{ partial "css.html" (dict "path" "css/index.css") }}
{{ $relref := printf "%s%s" .Site.BaseURL "operate/rc/api/" }}
{{ $relref := .Parent.Permalink }}
{{ if .Params.backLink}}
{{ $relref = printf "%s%s" .Site.BaseURL .Params.backLink }}
{{ end }}
<!-- needed for adaptive design -->
<!-- <link rel="preload" href="/public/scss/style.min.65324e4de191c292ee8b6f4f0ebf01320e8c4bc8623b04e9dfad322ebb490b31.css" as="style">
<link href="/public/scss/style.min.65324e4de191c292ee8b6f4f0ebf01320e8c4bc8623b04e9dfad322ebb490b31.css" rel="stylesheet" integrity="">
Expand Down Expand Up @@ -62,7 +103,7 @@
<body>
<div>
<redoc
spec-url='./openapi.json'
spec-url='{{ .Params.sourcefile | default "./openapi.json" }}'
scroll-y-offset='#apiReferenceHeader'
json-sample-expand-level=all
sort-operations-alphabetically="true"
Expand Down