Skip to content

Conversation

@cmilesb
Copy link
Contributor

@cmilesb cmilesb commented Jun 16, 2025

Was playing around with the Langcache OpenAPI spec to see if it could work with the apireference layout, and I was able to make a few changes to the layout to make it generic. Now, all you need is an OpenAPI spec (YAML or JSON) to get the same layout as the Redis Cloud API docs.

Here's what the filestructure should look like to use the apireference layout:

<containing-folder>/
├---------api-reference/
|                  └------<spec-file-name>
|
├---------api-reference.md
|
└---------<other files>

Here's what api-reference.md 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)
---

@cmilesb cmilesb requested review from a team and paoloredis June 16, 2025 17:33
@cmilesb cmilesb self-assigned this Jun 16, 2025
@github-actions
Copy link
Contributor

github-actions bot commented Jun 16, 2025

Copy link
Collaborator

@dwdougherty dwdougherty left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

<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/" }}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We'll have to inject the baseurl dynamically as well

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I fixed that in fbaecdb, let me know what you think.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good.

@paoloredis
Copy link
Collaborator

I think it would make sense to remove layouts/_default/rdiapireference.html as part of this PR.

Copy link
Contributor

@andy-stark-redis andy-stark-redis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. J'approve!

@cmilesb cmilesb merged commit ceeef51 into main Jun 20, 2025
5 checks passed
@cmilesb cmilesb deleted the generic-api-reference branch June 20, 2025 13:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants