MCPcopy Create free account
hub / github.com/github/awesome-copilot / getBasePath

Function getBasePath

website/src/scripts/utils.ts:38–45  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

36 * Get the base path for the site
37 */
38export function getBasePath(): string {
39 // In Astro, import.meta.env.BASE_URL is available at build time
40 // At runtime, we use a data attribute on the body
41 if (typeof document !== "undefined") {
42 return document.body.dataset.basePath || "/";
43 }
44 return "/";
45}
46
47/**
48 * Fetch JSON data from the data directory

Callers 1

fetchDataFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected