1 parent c346095 commit 44764f3Copy full SHA for 44764f3
1 file changed
apps/www/components/docs/example-cards.tsx
@@ -1,5 +1,6 @@
1
import { Card, Cards } from "fumadocs-ui/components/card";
2
import { getGithubRepoUrl } from "~/lib/github-links";
3
+import { breakDownGithubUrl } from "~/lib/utils/github";
4
import registry from "../../../../examples/registry.json";
5
6
type Example = {
@@ -12,11 +13,8 @@ type Example = {
12
13
const examples = (registry as { examples: Example[] }).examples;
14
15
function exampleTreeUrl(id: string): string {
- const ref =
16
- process.env.VERCEL_GIT_COMMIT_REF ??
17
- process.env.NEXT_PUBLIC_VERCEL_GIT_COMMIT_REF ??
18
- "main";
19
- return `${getGithubRepoUrl()}/tree/${encodeURIComponent(ref)}/examples/${id}`;
+ const { defaultBranch } = breakDownGithubUrl();
+ return `${getGithubRepoUrl()}/tree/${encodeURIComponent(defaultBranch)}/examples/${id}`;
20
}
21
22
/**
0 commit comments