Fixing Edit on GitHub Links (#627)

This commit is contained in:
Brandon Hopkins
2026-02-18 11:55:06 -08:00
committed by GitHub
parent 4dacaaecfb
commit 31a994937c
4 changed files with 50 additions and 3 deletions

View File

@@ -17,6 +17,7 @@ import { faGithub } from '@fortawesome/free-brands-svg-icons';
import {toast} from "react-toastify";
import {AnnouncementBanner} from "@/components/announcement-banner/AnnouncementBanner";
import {useAnnouncements} from "@/components/announcement-banner/AnnouncementBannerProvider";
import { EDIT_ON_GITHUB_INDEX_ROUTES } from '@/lib/edit-on-github-routes'
const navigation = [
{
@@ -228,7 +229,7 @@ export function Layout({ children, title, tableOfContents }) {
</li>
<li key="edit-on-github">
<Link
href={"https://github.com/netbirdio/docs/tree/main/src/pages" + router.pathname + ".mdx"}
href={"https://github.com/netbirdio/docs/tree/main/src/pages" + (EDIT_ON_GITHUB_INDEX_ROUTES.has(router.pathname) ? router.pathname + "/index.mdx" : router.pathname + ".mdx")}
className="dark:hover:text-slate-300 dark:text-slate-400 text-slate-500 hover:text-slate-700 font-normal'"
style={{display: "flex", alignItems: 'center'}}
>