---
import config from "virtual:starlight/user-config";
import VersionSelect from "./VersionSelect.astro";
const { siteTitle, siteTitleHref } = Astro.locals.starlightRoute;
// Resolve the logo src to a public path.
// Starlight's default SiteTitle uses virtual:starlight/user-images which goes through
// Astro's image pipeline, causing re-processing on each page load and logo flicker.
// We render the logo as a plain from the public directory instead.
let logoSrc: string | undefined;
let logoAlt = "";
if (config.logo) {
logoAlt = config.logo.alt || "";
if ("src" in config.logo) {
// Single logo — resolve the public path from the src string
const raw = typeof config.logo.src === "string" ? config.logo.src : "";
logoSrc = raw.replace(/^\.\/public/, "");
}
}
---