--- import BrandLogo from './BrandLogo.astro'; import PalettePicker from './PalettePicker.astro'; import Icon from './Icon.astro'; import { url } from '../lib/url'; const MAIN_SITE = 'https://daemon-sec.xyz'; // This site's source, on the read-only Git mirror (browse, or `git clone`). const SOURCE = 'https://git.daemon-sec.xyz/daemon-sec-lotl/'; /** * The masthead, in the main site's grammar (daemon-sec.xyz `Masthead`): a * shared brand logo on the left, numbered mono nav in the centre, and the action * cluster on the right. Each nav entry owns a hue and its index wears it, so * the bar reads as the colour legend the rest of the site keys back to. * * The nav entries and the search / theme / mobile wiring are the cheat-sheet * site's own — `[data-search-open]`, `[data-theme-toggle]` and * `[data-mobile-nav-toggle]` are bound in scripts/app.ts and SearchModal. */ const NAV: { n: string; label: string; href: string; acc: string; exact?: boolean }[] = [ { n: '01', label: 'Catalog', href: url('catalog'), acc: 'love' }, { n: '02', label: 'GTFOBins', href: url('gtfobins'), acc: 'foam' }, { n: '03', label: 'LOLBAS', href: url('lolbas'), acc: 'iris' }, { n: '04', label: 'WADComs', href: url('wadcoms'), acc: 'gold' }, { n: '05', label: 'LOOBins', href: url('loobins'), acc: 'rose' }, { n: '06', label: 'DÆMON', href: url('daemon'), acc: 'love' }, { n: '07', label: 'Credits', href: url('credits'), acc: 'pine' }, ]; /* Trailing slashes are `ignore`d by the build, so both spellings of a path reach here and an exact match would leave the bar saying nowhere. */ const here = Astro.url.pathname.replace(/\/+$/, '') || '/'; const isActive = (href: string, exact?: boolean) => { const target = href.replace(/\/+$/, '') || '/'; return exact ? here === target : here === target || here.startsWith(target + '/'); }; ---