|
1 | | -<!DOCTYPE html> |
| 1 | +<!doctype html> |
2 | 2 | <html lang="en"> |
3 | | -<head> |
4 | | - {{ $specURL := urls.Parse (printf "/%s%s.yaml" .File.Dir .File.ContentBaseName) }} |
5 | | - <title>{{ .Title }}</title> |
6 | | - <!-- needed for adaptive design --> |
7 | | - <meta name="viewport" content="width=device-width, initial-scale=1" /> |
8 | | - <meta name="description" content="{{ .Description }}" /> |
9 | | - <meta charset="utf-8" /> |
10 | | - <!-- favicon --> |
11 | | - <link rel="icon" href="/assets/images/favicon-32x32.png" sizes="32x32" /> |
12 | | - <link rel="icon" href="/assets/images/favicon-192x192.png" sizes="192x192" /> |
13 | | - <link rel="apple-touch-icon" href="/apple-touch-icon.png" /> |
14 | | - <link rel="shortcut icon" href="/favicon.ico"> |
15 | | - <!-- |
| 3 | + <head> |
| 4 | + {{ $specURL := urls.Parse (printf "/%s%s.yaml" .File.Dir .File.ContentBaseName) }} |
| 5 | + <title>{{ printf "%s | %s" .Title site.Title }}</title> |
| 6 | + <!-- needed for adaptive design --> |
| 7 | + <meta name="viewport" content="width=device-width, initial-scale=1" /> |
| 8 | + <meta name="description" content="{{ .Description }}" /> |
| 9 | + <meta charset="utf-8" /> |
| 10 | + <link rel="canonical" href="{{ .Permalink }}" /> |
| 11 | + <link |
| 12 | + rel="alternate" |
| 13 | + href="{{ partial "utils/markdown-url.html" . }}" |
| 14 | + type="text/markdown" |
| 15 | + title="{{ .Title }} (Markdown)" |
| 16 | + /> |
| 17 | + <!-- favicon --> |
| 18 | + <link rel="icon" href="/assets/images/favicon-32x32.png" sizes="32x32" /> |
| 19 | + <link |
| 20 | + rel="icon" |
| 21 | + href="/assets/images/favicon-192x192.png" |
| 22 | + sizes="192x192" |
| 23 | + /> |
| 24 | + <link rel="apple-touch-icon" href="/apple-touch-icon.png" /> |
| 25 | + <link rel="shortcut icon" href="/favicon.ico" /> |
| 26 | + <!-- |
16 | 27 | Provide a link to the swagger / OpenAPI spec itself. We're currently using |
17 | 28 | Swagger (OpenAPI v2) for some, so use a more generic "application/yaml" type. |
18 | 29 |
|
19 | 30 | Once all our specs are updated to OpenAPI v3, we can change this to "application/vnd.oai.openapi" |
20 | 31 | --> |
21 | | - <link rel="alternate" href="{{ $specURL.String | absURL }}" type="application/yaml" title="{{ .Title }} (Swagger/OpenAPI)" /> |
22 | | - <style> |
23 | | - body { |
24 | | - margin: 0; |
25 | | - padding: 0; |
26 | | - } |
27 | | - |
28 | | - .menu-content>div:first-child { |
29 | | - background-color: #086dd7; |
30 | | - padding: 16px; |
31 | | - } |
32 | | - |
33 | | - .auth-tag,.pat,.oat { |
34 | | - border-radius: 4px; |
35 | | - color: #fff; |
36 | | - padding: 5px; |
37 | | - } |
38 | | - |
39 | | - .pat { |
40 | | - background-color: rgb(149, 80, 124); |
41 | | - } |
42 | | - |
43 | | - .pat::after { |
44 | | - content: "personal access token"; |
45 | | - } |
46 | | - |
47 | | - .oat::after { |
48 | | - content: "org access token"; |
49 | | - } |
50 | | - |
51 | | - .oat { |
52 | | - background-color: rgb(24, 111, 175); |
53 | | - } |
54 | | - |
55 | | - .auth-tag:not(:last-child) { |
56 | | - margin-right: 5px; |
57 | | - } |
58 | | - </style> |
59 | | -</head> |
60 | | - |
61 | | -<body> |
62 | | - <noscript> |
63 | | - <p> |
64 | | - This page is rendered with JavaScript.<br> |
65 | | - <a target="_blank" href="{{ $specURL.String | absURL }}" rel="noreferrer">Download {{ .Title }} Swagger/OpenAPI specification</a> |
66 | | - </p> |
67 | | - </noscript> |
68 | | - {{ if or (strings.HasPrefix .RelPermalink "/reference/api/hub/") (strings.HasPrefix .RelPermalink "/reference/api/registry/") }} |
69 | | - <redoc spec-url="{{ $specURL.String }}" suppress-warnings="true" lazy-rendering></redoc> |
70 | | - {{ else }} |
71 | | - <redoc spec-url="{{ $specURL.String }}" hide-hostname="true" suppress-warnings="true" lazy-rendering></redoc> |
72 | | - {{ end }} |
73 | | - <script src="https://cdn.redoc.ly/redoc/latest/bundles/redoc.standalone.js"></script> |
74 | | -</body> |
| 32 | + <link |
| 33 | + rel="alternate" |
| 34 | + href="{{ $specURL.String | absURL }}" |
| 35 | + type="application/yaml" |
| 36 | + title="{{ .Title }} (Swagger/OpenAPI)" |
| 37 | + /> |
| 38 | + {{ partial "schema.html" . }} |
| 39 | + <style> |
| 40 | + body { |
| 41 | + margin: 0; |
| 42 | + color: #1f2933; |
| 43 | + font-family: |
| 44 | + Roboto Flex, |
| 45 | + Roboto, |
| 46 | + sans-serif; |
| 47 | + line-height: 1.5; |
| 48 | + } |
75 | 49 |
|
| 50 | + .menu-content > div:first-child { |
| 51 | + background-color: #086dd7; |
| 52 | + padding: 16px; |
| 53 | + } |
| 54 | + |
| 55 | + .auth-tag, |
| 56 | + .pat, |
| 57 | + .oat { |
| 58 | + border-radius: 4px; |
| 59 | + color: #fff; |
| 60 | + padding: 5px; |
| 61 | + } |
| 62 | + |
| 63 | + .pat { |
| 64 | + background-color: rgb(149, 80, 124); |
| 65 | + } |
| 66 | + |
| 67 | + .pat::after { |
| 68 | + content: "personal access token"; |
| 69 | + } |
| 70 | + |
| 71 | + .oat::after { |
| 72 | + content: "org access token"; |
| 73 | + } |
| 74 | + |
| 75 | + .oat { |
| 76 | + background-color: rgb(24, 111, 175); |
| 77 | + } |
| 78 | + |
| 79 | + .auth-tag:not(:last-child) { |
| 80 | + margin-right: 5px; |
| 81 | + } |
| 82 | + |
| 83 | + .api-shell { |
| 84 | + border-bottom: 1px solid #d9e2ec; |
| 85 | + padding: 32px 24px; |
| 86 | + } |
| 87 | + |
| 88 | + .api-shell article { |
| 89 | + margin: 0 auto; |
| 90 | + max-width: 960px; |
| 91 | + } |
| 92 | + |
| 93 | + .api-shell h1 { |
| 94 | + font-size: 2rem; |
| 95 | + line-height: 1.2; |
| 96 | + margin: 0 0 12px; |
| 97 | + } |
| 98 | + |
| 99 | + .api-shell p { |
| 100 | + margin: 0 0 16px; |
| 101 | + max-width: 72ch; |
| 102 | + } |
| 103 | + |
| 104 | + .api-links { |
| 105 | + display: flex; |
| 106 | + flex-wrap: wrap; |
| 107 | + gap: 12px; |
| 108 | + list-style: none; |
| 109 | + margin: 0; |
| 110 | + padding: 0; |
| 111 | + } |
| 112 | + |
| 113 | + .api-links a { |
| 114 | + color: #086dd7; |
| 115 | + text-decoration: none; |
| 116 | + } |
| 117 | + |
| 118 | + .api-links a:hover { |
| 119 | + text-decoration: underline; |
| 120 | + } |
| 121 | + |
| 122 | + .redoc-container { |
| 123 | + min-height: calc(100vh - 220px); |
| 124 | + } |
| 125 | + </style> |
| 126 | + </head> |
| 127 | + |
| 128 | + <body> |
| 129 | + <main> |
| 130 | + <section class="api-shell"> |
| 131 | + <article> |
| 132 | + <h1>{{ .Title }}</h1> |
| 133 | + <p>{{ .Description }}</p> |
| 134 | + <ul class="api-links"> |
| 135 | + <li> |
| 136 | + <a href="{{ partial "utils/markdown-url.html" . }}" |
| 137 | + >Open Markdown</a |
| 138 | + > |
| 139 | + </li> |
| 140 | + <li> |
| 141 | + <a href="{{ $specURL.String | absURL }}" |
| 142 | + >Download OpenAPI specification</a |
| 143 | + > |
| 144 | + </li> |
| 145 | + </ul> |
| 146 | + <noscript> |
| 147 | + <p> |
| 148 | + This reference uses JavaScript for the interactive explorer. Use |
| 149 | + the Markdown page or download the OpenAPI specification if |
| 150 | + JavaScript is unavailable. |
| 151 | + </p> |
| 152 | + </noscript> |
| 153 | + </article> |
| 154 | + </section> |
| 155 | + <article class="redoc-container"> |
| 156 | + {{ if or (strings.HasPrefix .RelPermalink "/reference/api/hub/") (strings.HasPrefix .RelPermalink "/reference/api/registry/") }} |
| 157 | + <redoc |
| 158 | + spec-url="{{ $specURL.String }}" |
| 159 | + suppress-warnings="true" |
| 160 | + lazy-rendering |
| 161 | + ></redoc> |
| 162 | + {{ else }} |
| 163 | + <redoc |
| 164 | + spec-url="{{ $specURL.String }}" |
| 165 | + hide-hostname="true" |
| 166 | + suppress-warnings="true" |
| 167 | + lazy-rendering |
| 168 | + ></redoc> |
| 169 | + {{ end }} |
| 170 | + </article> |
| 171 | + </main> |
| 172 | + <script src="https://cdn.redoc.ly/redoc/latest/bundles/redoc.standalone.js"></script> |
| 173 | + </body> |
76 | 174 | </html> |
0 commit comments