// src/lib/url.ts // Gör om en byggsökväg till kanonisk form: "/", "/about", "/portfolio". // Klarar både build.format "file" (/about.html) och "directory" (/about/). export function normalizePath(p: string): string { let out = p.replace(/\/index\.html$/, '/').replace(/\.html$/, ''); if (out.length > 1) out = out.replace(/\/+$/, ''); return out || '/'; }