<%– LOTUSGUILD TERMINAL DESIGN SYSTEM — Node.js / Express EJS Base Layout Extend this in every page template via res.render('page', { ... }). Required Express setup (server.js / app.js): const { requireAuth, cspNonce, injectLocals } = require('./middleware'); app.use(cspNonce); app.use(requireAuth); app.use(injectLocals); app.set('view engine', 'ejs'); Locals injected automatically by middleware.js: user { username, name, email, groups, isAdmin } nonce CSP nonce string appName process.env.APP_NAME appSubtitle process.env.APP_SUBTITLE Locals to set per-route (or via a second res.locals middleware): pageTitle string — page suffix activeNav string — must match a navLinks[].key navLinks array — navigation items: [{ href: '/path', key: 'mykey', label: 'My Page' }, ...] Dropdown: { label: 'Admin', key: 'admin', adminOnly: true, children: [ { href: '/admin/users', label: 'Users' } ]} pageStyles array — optional extra CSS hrefs pageScripts array — optional extra <script src> paths –%> <!DOCTYPE html> <html lang="en" data-theme="dark"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0, viewport-fit=cover"> <meta name="theme-color" content="#030508"> <meta name="robots" content="noindex, nofollow"> <title><%= pageTitle ? pageTitle + ' — ' : '' %><%= appName || 'LotusGuild' %> <% if (typeof pageStyles !== 'undefined') { pageStyles.forEach(href => { %> <% }); } %>
<%= (appName || 'APP').toUpperCase() %> <%= appSubtitle || 'LotusGuild Infrastructure' %>
<% if (user && (user.name || user.username)) { %> <%= user.name || user.username %> <% } %> <% if (user && user.isAdmin) { %> admin <% } %>
<%- body %>
<% if (typeof pageScripts !== 'undefined') { pageScripts.forEach(src => { %> <% }); } %>