--- 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-cheatsheet/'; /** * 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: '01', label: 'Vault', href: url(''), acc: 'love', exact: true }, // Every sheet in one filterable index; also lit on the sheets themselves. { n: '02', label: 'Sheets', href: url('sheets'), acc: 'foam' }, { n: '03', label: 'Payloads', href: url('payloads'), acc: 'iris' }, { n: '04', label: 'Internal', href: url('internal'), acc: 'pine' }, { n: '05', label: 'HackTricks', href: url('hacktricks'), acc: 'gold' }, { n: '06', label: 'Tags', href: url('tags'), acc: 'foam' }, { n: '07', label: 'Credits', href: url('credits'), acc: 'rose' }, ]; /* 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 + '/'); }; ---