Skip to content

Commit 2c4fcab

Browse files
committed
feat: inject Space Platform title into sidebar
1 parent 074ea8b commit 2c4fcab

File tree

1 file changed

+25
-1
lines changed

1 file changed

+25
-1
lines changed

tools/add-try-link.js

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,30 @@ if (!html.includes('fonts.css')) {
4444
// Add favicon
4545
if (!html.includes('favicon.png')) {
4646
html = html.replace('</head>', ' <link rel="icon" type="image/png" href="favicon.png">\n</head>');
47+
// Inject Sidebar Title Script
48+
const sidebarTitleScript = `
49+
<script>
50+
window.addEventListener('load', function() {
51+
const checkLogo = setInterval(function() {
52+
const logo = document.querySelector('img[alt="Reezonly LMS"]');
53+
if (logo && logo.parentNode) {
54+
clearInterval(checkLogo);
55+
// Prevent duplicate injection
56+
if (logo.parentNode.querySelector('.custom-sidebar-title')) return;
57+
58+
const title = document.createElement('div');
59+
title.className = 'custom-sidebar-title';
60+
title.innerText = 'Space Platform';
61+
title.style.cssText = 'font-family: StyreneALC, sans-serif; font-weight: 700; font-size: 16px; color: #1f2430; margin: 8px 0 0 16px; line-height: 1.2; letter-spacing: -0.02em;';
62+
63+
// Insert after logo
64+
logo.parentNode.insertBefore(title, logo.nextSibling);
65+
}
66+
}, 100);
67+
});
68+
</script>`;
69+
html = html.replace('</body>', `${sidebarTitleScript}\n</body>`);
70+
4771
fs.writeFileSync(indexPath, html, 'utf8');
48-
console.log('✅ Added favicon to docs/index.html');
72+
console.log('✅ Added favicon and sidebar title script to docs/index.html');
4973
}

0 commit comments

Comments
 (0)