Skip to content

Commit 1027068

Browse files
author
committed
Deployed cb2ecec with MkDocs version: 1.6.1
1 parent dfeb278 commit 1027068

2 files changed

Lines changed: 63 additions & 0 deletions

File tree

assets/topbar.css

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,11 @@
155155
display: block;
156156
}
157157

158+
/* Org site links injected into Material's sidebar drawer — desktop: hidden */
159+
#utplsql-drawer-nav {
160+
display: none;
161+
}
162+
158163
@media screen and (max-width: 76.1875em) {
159164
/* Hide nav links on mobile — sidebar drawer handles navigation */
160165
#utplsql-topbar a:not(.utplsql-brand) {
@@ -171,4 +176,33 @@
171176
.md-search__inner {
172177
padding-top: 2rem !important;
173178
}
179+
180+
/* Org site nav section at the top of the drawer */
181+
#utplsql-drawer-nav {
182+
display: block;
183+
padding: 0.6rem 0.8rem 0.4rem;
184+
border-bottom: 1px solid var(--md-default-fg-color--lightest, rgba(0,0,0,.12));
185+
margin-bottom: 0.4rem;
186+
}
187+
188+
#utplsql-drawer-nav .utplsql-drawer-heading {
189+
font-size: 0.65rem;
190+
font-weight: 700;
191+
letter-spacing: 0.08em;
192+
text-transform: uppercase;
193+
color: var(--md-default-fg-color--light);
194+
padding-bottom: 0.3rem;
195+
}
196+
197+
#utplsql-drawer-nav a {
198+
display: block;
199+
padding: 0.25rem 0;
200+
color: var(--md-typeset-a-color);
201+
text-decoration: none;
202+
font-size: 0.75rem;
203+
}
204+
205+
#utplsql-drawer-nav a:hover {
206+
color: var(--md-accent-fg-color);
207+
}
174208
}

assets/topbar.js

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,32 @@
116116
}
117117

118118
/* Updates the active class on nav links based on the current URL. */
119+
function injectDrawerNav() {
120+
/* Already injected and still in the DOM — nothing to do. */
121+
if (document.getElementById('utplsql-drawer-nav')) return;
122+
123+
var inner = document.querySelector('.md-sidebar--primary .md-sidebar__inner');
124+
if (!inner) return;
125+
126+
var section = document.createElement('nav');
127+
section.id = 'utplsql-drawer-nav';
128+
section.setAttribute('aria-label', 'utPLSQL.org site navigation');
129+
130+
var heading = document.createElement('div');
131+
heading.className = 'utplsql-drawer-heading';
132+
heading.textContent = 'utPLSQL.org';
133+
section.appendChild(heading);
134+
135+
NAV.forEach(function (item) {
136+
var a = document.createElement('a');
137+
a.href = item.url;
138+
a.textContent = item.label;
139+
section.appendChild(a);
140+
});
141+
142+
inner.insertBefore(section, inner.firstChild);
143+
}
144+
119145
function updateActiveLink() {
120146
var bar = document.getElementById('utplsql-topbar');
121147
if (!bar) return;
@@ -131,6 +157,7 @@
131157
if (document.getElementById('utplsql-topbar')) {
132158
updateActiveLink();
133159
applyStoredScheme();
160+
injectDrawerNav();
134161
return;
135162
}
136163

@@ -140,6 +167,7 @@
140167
document.body.insertBefore(savedBar, document.body.firstChild);
141168
updateActiveLink();
142169
applyStoredScheme();
170+
injectDrawerNav();
143171
return;
144172
}
145173

@@ -212,6 +240,7 @@
212240
savedBar = bar;
213241
document.body.insertBefore(bar, document.body.firstChild);
214242
updateActiveLink();
243+
injectDrawerNav();
215244

216245
/* When auto mode is active, re-apply if the OS theme changes live. */
217246
window.matchMedia('(prefers-color-scheme: dark)').addEventListener('change', function () {

0 commit comments

Comments
 (0)