From 2e3a27a26d3799c04eaf12cbaed21cc213663c8e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gast=C3=B3n=20Fournier?= Date: Tue, 3 Jun 2025 17:59:25 +0200 Subject: [PATCH] fix: docs generation due to openapi static images (#10078) New openapi docs need to have the static images for openapi. I just duplicated them because they're expected in a different path. Now this is what they look like: ![image](https://github.com/user-attachments/assets/a99b70a9-b708-47b9-9c02-3c9d84ac178f) --- website/prepare-generated-docs.mjs | 9 ++++++++- website/src/css/api-docs.css | 4 ++++ website/static/openapi-static/Beta.svg | 1 + website/static/openapi-static/Enterprise.svg | 7 +++++++ 4 files changed, 20 insertions(+), 1 deletion(-) create mode 100644 website/static/openapi-static/Beta.svg create mode 100644 website/static/openapi-static/Enterprise.svg diff --git a/website/prepare-generated-docs.mjs b/website/prepare-generated-docs.mjs index c7e461b895..a3dd5e7c57 100644 --- a/website/prepare-generated-docs.mjs +++ b/website/prepare-generated-docs.mjs @@ -43,6 +43,13 @@ const outputPath = path.join(outputDir, 'openapi.json'); // Ensure directory exists await fs.mkdir(outputDir, { recursive: true }); -await fs.writeFile(outputPath, JSON.stringify(data, null, 2), 'utf8'); +await fs.writeFile( + outputPath, + JSON.stringify(data, null, 2).replace( + /\/ushosted\/openapi-static/g, + '/openapi-static', + ), + 'utf8', +); console.log(`OpenAPI spec saved to ${outputPath}`); diff --git a/website/src/css/api-docs.css b/website/src/css/api-docs.css index bba733a695..12e3ad6d72 100644 --- a/website/src/css/api-docs.css +++ b/website/src/css/api-docs.css @@ -70,3 +70,7 @@ https://github.com/PaloAltoNetworks/docusaurus-openapi-docs/issues/177 color: var(--ifm-color-secondary-contrast-foreground); border-color: var(--ifm-color-secondary-dark); } + +main .theme-api-markdown > .openapi-left-panel__container p > img { + display: inline !important; +} diff --git a/website/static/openapi-static/Beta.svg b/website/static/openapi-static/Beta.svg new file mode 100644 index 0000000000..262731ef3d --- /dev/null +++ b/website/static/openapi-static/Beta.svg @@ -0,0 +1 @@ +BetaBeta \ No newline at end of file diff --git a/website/static/openapi-static/Enterprise.svg b/website/static/openapi-static/Enterprise.svg new file mode 100644 index 0000000000..46d73998ba --- /dev/null +++ b/website/static/openapi-static/Enterprise.svg @@ -0,0 +1,7 @@ + + + + +