--- import { Breadcrumbs } from "astro-breadcrumbs"; import "astro-breadcrumbs/breadcrumbs.css"; import CreateCopyButtons from "@components/hooks/CreateCopyButtons.astro"; import PreTheme from "@config/PreTheme.astro"; import Header from "@components/Header.astro"; import Head from "@config/Head.astro"; import Nav from "@components/navigation/sidebars/nav/index.astro"; import type { ConfigHeading } from "@src/components/navigation/sidebars/types"; import Footer from "@src/components/Footer.astro"; import type { TypeData } from "@config/io/types"; interface Props { title: string; description: string; headings?: ConfigHeading[]; type?: TypeData } const { title, description, headings, type } = Astro.props; let url = Astro.url.pathname.split("/").filter(s => s !== ""); const breadcrumbs = [{ text: "custom", href: "/", }]; let linkPath = ""; if (url[0] === "docs") { const { version } = Astro.params; linkPath = `/docs/${version}`; breadcrumbs.push({ text: `Docs (${version})`, href: linkPath, }); url = url.slice(2); } for (const segment of url) { linkPath += `/${segment}`; breadcrumbs.push({ text: segment[0].toUpperCase() + segment.slice(1), href: linkPath, }); } ---