diff --git a/astro/src/components/GitHubEdit.astro b/astro/src/components/GitHubEdit.astro index e2d1a09fcd..209a3dfd77 100644 --- a/astro/src/components/GitHubEdit.astro +++ b/astro/src/components/GitHubEdit.astro @@ -20,17 +20,19 @@ export function getGithubEditUrl(Astro: Readonly) { const path = Astro.url.pathname; const splitSlug = slug?.split("/"); + const { id } = Astro.props; // Passed from page level + // Each file layout is unique let appendFile = ""; if (path.includes("/articles/")) { appendFile = splitSlug?.length ? splitSlug?.length > 1 - ? path.replace(`${slug}`, "") + `${slug}.md` + ? path.replace(`${slug}`, "") + id : path + `index.mdx` : path; } else if (path.includes("/dev-tools/")) { - appendFile = splitSlug?.length - ? appendFileSuffix(path) + appendFile = splitSlug?.length + ? appendFileSuffix(path) : path + `index.mdx`; } else if (path.includes("/quickstarts/")) { appendFile = splitSlug?.length diff --git a/astro/src/components/Head.astro b/astro/src/components/Head.astro index f1702cdb05..d438e0bb8c 100644 --- a/astro/src/components/Head.astro +++ b/astro/src/components/Head.astro @@ -1,6 +1,6 @@ --- -const { description, title } = Astro.props; -const openGraphImage = new URL("/img/articles-developers.png", Astro.url); +const { description, title, openGraphImage } = Astro.props; +const openGraphImageUrl = openGraphImage ? new URL(openGraphImage, Astro.url): new URL("/img/articles-developers.png", Astro.url); const normalizedUrl = Astro.url.toString().replace(/.html$/, ''); const isProd = import.meta.env.PROD as boolean; --- @@ -30,7 +30,7 @@ const isProd = import.meta.env.PROD as boolean; - + { isProd &&