Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
44 changes: 33 additions & 11 deletions assets/css/v2/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -881,6 +881,26 @@ nav {
[data-grid="half"] {
grid-column: span 6;
}

[data-grid="breakout"] {
grid-column: 1 / -1;
width: calc(100vw - var(--sidebar-width) - 4rem);
position: relative;
left: 50%;
right: 50%;
margin-left: calc(-1 * (50vw - var(--sidebar-width) / 2 - 2rem));
margin-right: calc(-1 * (50vw - var(--sidebar-width) / 2 - 2rem));
max-width: calc(100vw - var(--sidebar-width) - 4rem);
}

@media (max-width: 68rem) {
[data-grid="breakout"] {
width: 100vw;
margin-left: -50vw;
margin-right: -50vw;
max-width: 100vw;
}
}
}

.content {
Expand Down Expand Up @@ -921,18 +941,20 @@ nav {
}
}
}
}
/* Allow redocly to fill the entire container */
.content .content__redocly {
border-top: 1px solid oklch(var(--color-divider));
border-bottom: 1px solid oklch(var(--color-divider));
#api-component {
z-index: 0;
position: relative;
display: block;
max-width: 100%;

/* Allow redocly to fill the entire container */
&.content__redocly {
min-width: 100%;
margin: 0;

#api-component {
z-index: 0;
position: relative;
display: block;
max-width: 100%;
margin-block-start: 1rem;
.redoc-wrap .menu-content {
top: 4rem !important; /* Override redocly's inline top property */
left: 0;
}
}
}
Expand Down
8 changes: 7 additions & 1 deletion exampleSite/content/test-product/redoc/api-reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,11 @@ tags:
- api
doctypes:
- reference
nd-api-reference: "./api/example.json"
---
{{< openapi spec="./api/example.json" >}}

## Introduction

Welcome to the API Reference documentation for the example book API. This documentation provides detailed information about the API endpoints, request/response formats, and other relevant details.

## API Specification
2 changes: 1 addition & 1 deletion exampleSite/content/test-product/redoc/live-example.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@ tags:
- api
doctypes:
- reference
nd-api-reference: "./api/one.json"
---
{{< openapi spec="./api/one.json" >}}
12 changes: 9 additions & 3 deletions layouts/_default/single.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,12 @@ <h1>{{ .Title }}</h1>
{{ if eq .Page.Draft true }}{{ partial "draft-badge.html" . }}{{ end }}
{{ if in .Params.doctypes "beta" }}{{ partial "beta-badge" . }}{{ end }}

{{ with (index .Page.Params "nd-api-reference") }}
<div class="content__redocly" data-grid="breakout">
{{ partial "openapi.html" . }}
</div>
{{ end }}

{{ if .Page.Lastmod }}
<div class="last-modified">
{{ partial "page-meta-links" . }}
Expand All @@ -28,13 +34,13 @@ <h1>{{ .Title }}</h1>

{{ partial "version-list" . }}
{{ partial "qualtrics-feedback.html" }}

</section>
</section>
</article>
</main>





<!-- If there is a script defined in the page metadata, load it -->
{{if .Params.script}}
{{ $script := (delimit (slice "scripts" .Params.script) "/")}}
Expand Down
16 changes: 16 additions & 0 deletions layouts/partials/openapi.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<div>
<div id="api-component">
<api-container>
<redoc
spec-url='{{ . | relURL }}'
menu-toggle
path-in-middle-panel
required-props-first
hide-hostname="true"
show-extensions="x-f5-experimental"
nativeScrollbars
>
</redoc>
</api-container>
</div>
</div>
11 changes: 0 additions & 11 deletions layouts/redoc/single.html

This file was deleted.

4 changes: 0 additions & 4 deletions layouts/shortcodes/openapi.html

This file was deleted.