Skip to content
This repository was archived by the owner on Nov 19, 2024. It is now read-only.

Commit 5b9d082

Browse files
committed
Move all redoc logic to the _layouts/redoc.html
1 parent 46f1bb0 commit 5b9d082

File tree

4 files changed

+34
-36
lines changed

4 files changed

+34
-36
lines changed

_layouts/redoc.html

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,35 @@
11
{% include layout/header.html %}
22

33
<div class="content-container">
4-
{{ content }}
4+
<div id="redoc-container"></div>
55
</div>
66

7+
<script src="https://cdn.jsdelivr.net/npm/redoc@2.0.0-alpha.41/bundles/redoc.standalone.js"> </script>
8+
<script>
9+
Redoc.init('{{ page.specUrl }}', {
10+
scrollYOffset: '.site-nav',
11+
hideHostname: true,
12+
sortPropsAlphabetically: true,
13+
pathInMiddlePanel: true,
14+
hideDownloadButton: true,
15+
showExtensions: true,
16+
nativeScrollbars: true,
17+
lazyRendering: true,
18+
theme: {
19+
colors: {
20+
primary: {
21+
main: '#2b2b2c',
22+
}
23+
},
24+
typography: {
25+
fontFamily: '',
26+
headings: {
27+
fontFamily: '',
28+
}
29+
},
30+
}
31+
}, document.getElementById('redoc-container'))
32+
33+
</script>
34+
735
{% include layout/footer.html %}

redoc/2.3/admin-rest-api.html

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,4 @@
11
---
22
layout: redoc
3+
specUrl: admin-schema.json
34
---
4-
<redoc spec-url='admin-schema.json'
5-
hide-hostname=true
6-
sort-props-alphabetically=true
7-
path-in-middle-panel=true
8-
hide-download-button=true
9-
show-extensions=true
10-
scroll-y-offset='.site-nav'
11-
native-scrollbars=true
12-
lazy-rendering=true
13-
></redoc>
14-
<script src="https://rebilly.github.io/ReDoc/releases/v1.22.1/redoc.min.js"> </script>

redoc/2.3/customer-rest-api.html

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,4 @@
11
---
22
layout: redoc
3-
---
4-
<redoc spec-url='customer-schema.json'
5-
hide-hostname=true
6-
sort-props-alphabetically=true
7-
path-in-middle-panel=true
8-
hide-download-button=true
9-
show-extensions=true
10-
scroll-y-offset='.site-nav'
11-
native-scrollbars=true
12-
lazy-rendering=true
13-
></redoc>
14-
<script src="https://rebilly.github.io/ReDoc/releases/v1.22.1/redoc.min.js"> </script>
3+
specUrl: customer-schema.json
4+
---

redoc/2.3/guest-rest-api.html

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,4 @@
11
---
22
layout: redoc
3-
---
4-
<redoc spec-url='guest-schema.json'
5-
hide-hostname=true
6-
sort-props-alphabetically=true
7-
path-in-middle-panel=true
8-
hide-download-button=true
9-
show-extensions=true
10-
scroll-y-offset='.site-nav'
11-
native-scrollbars=true
12-
lazy-rendering=true
13-
></redoc>
14-
<script src="https://rebilly.github.io/ReDoc/releases/v1.22.1/redoc.min.js"> </script>
3+
specUrl: guest-schema.json
4+
---

0 commit comments

Comments
 (0)