--- let path = Astro.url.pathname if (path.startsWith("/")) { path = path.slice(1)} if (path.endsWith("/")) { path = path.slice(0, -1)} const segments = path.split("/").slice(0, -1); const sections: {name: string; link: string;}[] = [] let current = "/" for (const segment of segments) { current += segment + "/"; sections.push({ name: segment, link: current }) } ---