Base.astro (4059B)
1 --- 2 import "../styles/global.css"; 3 import { execSync } from "node:child_process"; 4 5 interface Props { 6 title: string; 7 } 8 9 const { title } = Astro.props; 10 11 let gitCommit = "unknown"; 12 try { 13 gitCommit = execSync("git rev-parse --short HEAD", { encoding: "utf-8" }).trim(); 14 } catch { 15 // Not in a git repo during build 16 } 17 --- 18 19 <!doctype html> 20 <html lang="en" data-theme="dark"> 21 <head> 22 <meta charset="UTF-8" /> 23 <meta name="viewport" content="width=device-width, initial-scale=1.0" /> 24 <link rel="preload" href="/fonts/jetbrains-mono-latin.woff2" as="font" type="font/woff2" crossorigin /> 25 <link rel="preload" href="/fonts/jetbrains-mono-latin-ext.woff2" as="font" type="font/woff2" crossorigin /> 26 <title>{title} | Loop Benchmarking</title> 27 <script is:inline> 28 (function() { 29 var saved = localStorage.getItem('theme'); 30 if (saved === 'light' || saved === 'dark') { 31 document.documentElement.setAttribute('data-theme', saved); 32 } else if (window.matchMedia('(prefers-color-scheme: light)').matches) { 33 document.documentElement.setAttribute('data-theme', 'light'); 34 } else { 35 document.documentElement.setAttribute('data-theme', 'dark'); 36 } 37 })(); 38 </script> 39 </head> 40 <body> 41 <header style="border-bottom: 1px solid hsl(var(--border)); padding: 16px 0; margin-bottom: 32px;"> 42 <div class="container" style="display: flex; align-items: center; gap: 24px;"> 43 <a href="/" style="font-weight: 700; font-size: 1.1rem; color: hsl(var(--foreground));"> 44 Loop Benchmarking 45 </a> 46 <nav style="display: flex; gap: 16px; font-size: 0.875rem; align-items: center;"> 47 <a href="/">Grid</a> 48 <a href="/insights">Insights</a> 49 <a href="/surprises">Surprises</a> 50 <a href="/explore">Explore</a> 51 <a href="/compare">Compare</a> 52 <a href="/pca">PCA</a> 53 <span style="border-left: 1px solid hsl(var(--border)); height: 16px;"></span> 54 <a href="/methodology">Methodology</a> 55 </nav> 56 <button 57 id="theme-toggle" 58 class="theme-toggle" 59 type="button" 60 aria-label="Toggle theme" 61 style="margin-left: auto;" 62 > 63 <svg class="icon-sun" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="5"/><line x1="12" y1="1" x2="12" y2="3"/><line x1="12" y1="21" x2="12" y2="23"/><line x1="4.22" y1="4.22" x2="5.64" y2="5.64"/><line x1="18.36" y1="18.36" x2="19.78" y2="19.78"/><line x1="1" y1="12" x2="3" y2="12"/><line x1="21" y1="12" x2="23" y2="12"/><line x1="4.22" y1="19.78" x2="5.64" y2="18.36"/><line x1="18.36" y1="5.64" x2="19.78" y2="4.22"/></svg> 64 <svg class="icon-moon" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z"/></svg> 65 </button> 66 </div> 67 </header> 68 <main class="container"> 69 <slot /> 70 </main> 71 <footer style="border-top: 1px solid hsl(var(--border)); padding: 24px 0; margin-top: 48px;"> 72 <div class="container" style="text-align: center; color: hsl(var(--muted-foreground)); font-size: 0.75rem;"> 73 Loop Benchmarking - Open agentic loop benchmark data 74 <span style="margin-left: 12px; font-family: var(--font-mono);">{gitCommit}</span> 75 </div> 76 </footer> 77 <script is:inline> 78 (function() { 79 var btn = document.getElementById('theme-toggle'); 80 if (!btn) return; 81 btn.addEventListener('click', function() { 82 var current = document.documentElement.getAttribute('data-theme'); 83 var next = current === 'dark' ? 'light' : 'dark'; 84 document.documentElement.setAttribute('data-theme', next); 85 localStorage.setItem('theme', next); 86 }); 87 })(); 88 </script> 89 </body> 90 </html>