diff --git a/src/scripts/github-edit.ts b/src/scripts/github-edit.ts index 583f9c6b0..a73410059 100644 --- a/src/scripts/github-edit.ts +++ b/src/scripts/github-edit.ts @@ -1,13 +1,15 @@ -import type { AstroGlobal } from 'astro'; +import type { AstroGlobal } from "astro"; /** Gets the URL to edit the page on GitHub */ export function getGithubEditUrl(Astro: Readonly) { - const { content = {} } = Astro.props; - let currentPage = Astro.url.pathname; - if(currentPage == "/") { - return `https://github.com/axelarnetwork/axelar-docs/blob/main/src/pages/index.astro`; - } - return `https://github.com/axelarnetwork/axelar-docs/blob/main/src/pages${currentPage.replace(/\/$/, '')}.mdx`; - -} \ No newline at end of file + const { content = {} } = Astro.props; + let currentPage = Astro.url.pathname; + if (currentPage == "/") { + return `https://github.com/axelarnetwork/axelar-docs/blob/main/src/pages/index.astro`; + } + return `https://github.com/axelarnetwork/axelar-docs/edit/main/src/pages${currentPage.replace( + /\/$/, + "" + )}.mdx`; +}