Files
vercel__workflow/docs/components/geistdocs/edit-source.tsx
Mitul Shah c1405fbf08 Fix "Edit this page on GitHub" link path (#1750)
* feat: add redirect rule to strip.md extension from routes

Added a new redirect to remove.md extension from any route.

Slack-Thread: https://vercel.slack.com/archives/C09125LC4AX/p1776281595825439?thread_ts=1776281595.825439&cid=C09125LC4AX
Co-authored-by: Mitul Shah <19615826+mitul-s@users.noreply.github.com>

* feat: update GitHub edit URL path for Geistdocs component

Updated GitHub edit URL to correct directory structure for documentation files.

Slack-Thread: https://vercel.slack.com/archives/C09125LC4AX/p1776281595825439?thread_ts=1776281595.825439&cid=C09125LC4AX
Co-authored-by: Mitul Shah <19615826+mitul-s@users.noreply.github.com>

* Update next.config.ts

* Fix URL path in EditSource component

Signed-off-by: Mitul Shah <mitulxshah@gmail.com>

---------

Signed-off-by: Mitul Shah <mitulxshah@gmail.com>
Co-authored-by: v0 <v0[bot]@users.noreply.github.com>
Co-authored-by: Mitul Shah <19615826+mitul-s@users.noreply.github.com>
2026-04-15 20:49:06 +00:00

31 lines
741 B
TypeScript

import { SiGithub } from '@icons-pack/react-simple-icons';
import { github } from '@/geistdocs';
type EditSourceProps = {
path: string | undefined;
};
export const EditSource = ({ path }: EditSourceProps) => {
let url: string | undefined;
if (github.owner && github.repo && path) {
url = `https://github.com/${github.owner}/${github.repo}/edit/main/docs/content/docs/${path}`;
}
if (!url) {
return null;
}
return (
<a
className="flex items-center gap-1.5 text-muted-foreground text-sm transition-colors hover:text-foreground"
href={url}
rel="noopener noreferrer"
target="_blank"
>
<SiGithub className="size-3.5" />
<span>Edit this page on GitHub</span>
</a>
);
};