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
Binary file modified docs/favicon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
35 changes: 35 additions & 0 deletions docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,45 @@
margin: 0;
padding: 0;
}
/* GBA Logo injected into Redocly sidebar */
#gba-logo-container {
position: fixed;
top: 20px;
left: 20px;
z-index: 10000;
background: white;
padding: 10px;
border-radius: 8px;
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
max-width: 200px;
}
#gba-logo-container img {
width: 100%;
height: auto;
display: block;
}
/* Adjust menu to avoid logo overlap */
div[role="navigation"] {
padding-top: 80px !important;
}
@media screen and (max-width: 50rem) {
#gba-logo-container {
position: static;
margin: 10px;
max-width: 150px;
}
div[role="navigation"] {
padding-top: 20px !important;
}
}
</style>
{{{redocHead}}}
</head>
<body>
<!-- GBA Logo -->
<div id="gba-logo-container">
<img src="logo.png" alt="Green Button Alliance" />
</div>
{{{redocHTML}}}
</body>
</html>
Binary file added docs/logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
26 changes: 25 additions & 1 deletion scripts/build-swagger.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,26 @@ fs.copyFileSync(
path.join(swaggerDir, 'openapi.json')
);

// Copy GBA logo to swagger directory
const docsDir = path.join(__dirname, '..', 'docs');
const logoPath = path.join(docsDir, 'logo.png');
if (fs.existsSync(logoPath)) {
fs.copyFileSync(logoPath, path.join(swaggerDir, 'logo.png'));
}

// Copy logo to root dist for easier reference
if (fs.existsSync(logoPath)) {
fs.copyFileSync(logoPath, path.join(__dirname, '..', 'dist', 'logo.png'));
}

// Create custom Swagger UI HTML with Green Button branding
const html = `<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Green Button ESPI API - Swagger UI</title>
<link rel="stylesheet" type="text/css" href="./swagger-ui.css" />
<link rel="icon" type="image/png" href="../../logo.png" />
<link rel="icon" type="image/png" href="./logo.png" />
<style>
html {
box-sizing: border-box;
Expand All @@ -48,9 +60,21 @@ const html = `<!DOCTYPE html>
margin: 0;
padding: 0;
}
/* GBA Logo in Swagger UI topbar */
.topbar {
background-color: #10a54a !important;
}
.topbar::before {
content: '';
background-image: url('./logo.png');
background-size: contain;
background-repeat: no-repeat;
background-position: center;
width: 180px;
height: 50px;
display: inline-block;
margin: 10px 20px;
}
.topbar .link {
display: flex;
align-items: center;
Expand Down