(function() {
const SITE = 'https://processing-cpp.github.io';
const path = window.location.pathname;
const parts = path.replace(/\/$/, '').split('/').filter(Boolean);
const isRoot = parts.length === 0 || (parts.length === 1 && parts[0] === 'index.html');
// Depth = number of directory levels below site root. A trailing
// "index.html" or "
Errors
`;
}
const sidebar = document.getElementById('site-sidebar') || document.querySelector('.sidebar');
if (sidebar) {
sidebar.innerHTML = `
${link('whats-new', "What's New", 'color:#e8b400;font-weight:700;')}
${link('libraries', 'Libraries')}
${link('downloads', 'Downloads')}
${link('tutorials', 'Tutorials')}
${link('reference', 'Reference')}
${link('examples', 'Examples')}
${link('about', 'About')}
`;
}
if (!document.getElementById('nav-shared-style')) {
const style = document.createElement('style');
style.id = 'nav-shared-style';
style.textContent = `
#site-nav {
border-bottom: 1px solid #e0e0e0;
padding: 0 2rem;
display: flex;
align-items: center;
justify-content: space-between;
height: 60px;
position: sticky;
top: 0;
background: #fff;
z-index: 100;
}
.nav-logo { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.nav-logo img { width: 28px; height: 28px; }
.nav-title { display: flex; flex-direction: column; line-height: 1.15; }
.nav-title-top { font-size: 14px; font-weight: 700; color: #e8b400; }
.nav-title-bottom { font-size: 14px; font-weight: 700; color: #e8b400; }
#nav-errors-link { margin-left: auto; font-size: 14px; font-weight: 700; color: #e8b400; text-decoration: none; }
#nav-errors-link:hover { color: #c99700; }
.hamburger { background: none; border: none; cursor: pointer; font-size: 22px; padding: 4px 8px; display: none; margin-left: 0.5rem; }
@media (max-width: 768px) { .hamburger { display: block; } }
`;
document.head.appendChild(style);
}
if (!document.getElementById('search-wrap')) {
const s = document.createElement('script');
s.src = SITE + '/assets/search.js';
document.head.appendChild(s);
}
})();