[section].astro (1830B)
1 --- 2 import SignalField from '../../../components/SignalField.astro'; 3 import Base from '../../../layouts/Base.astro'; 4 import RecordRow from '../../../components/RecordRow.astro'; 5 import { hackTricksBySection, hackTricksHref } from '../../../lib/hacktricks'; 6 import { url } from '../../../lib/url'; 7 8 export async function getStaticPaths() { 9 return (await hackTricksBySection()).map((section) => ({ 10 params: { section: section.slug }, 11 props: { section }, 12 })); 13 } 14 15 const { section } = Astro.props; 16 const accents = ['gold', 'love', 'foam', 'pine', 'iris', 'rose']; 17 --- 18 <Base title={`${section.title} — HackTricks — DÆMON//SEC`} description={`${section.count} attributed HackTricks pages for ${section.title}.`}> 19 <div class="wrap" style="padding-bottom:3rem;"> 20 <nav class="breadcrumb" style="margin-top:1.6rem;"> 21 <a href={url('')}>~</a><span class="sep">/</span> 22 <a href={url('hacktricks')} style="color:var(--gold)">hacktricks</a><span class="sep">/</span> 23 <span class="muted">{section.slug}</span> 24 </nav> 25 26 <header class="sheet-head signal-hero"> 27 <SignalField /> 28 <p class="eyebrow" style="color:var(--gold)">// HackTricks · CC BY-NC 4.0</p> 29 <h1 class="sheet-title">{section.title}</h1> 30 <p class="muted">{section.count} pages · adapted from upstream with source attribution on every page.</p> 31 </header> 32 33 <div class="index"> 34 {section.items.map((entry, index) => ( 35 <RecordRow 36 href={url(hackTricksHref(entry))} 37 n={String(index + 1).padStart(3, '0')} 38 title={entry.data.title} 39 kind={section.title} 40 kindIcon="doc" 41 accent={accents[index % accents.length]} 42 meta={entry.data.sourcePath.split('/').slice(-2, -1)[0] ?? 'HackTricks'} 43 /> 44 ))} 45 </div> 46 </div> 47 </Base>