Skip to content

Commit e275b5f

Browse files
committed
fix edit page links
1 parent 1435225 commit e275b5f

4 files changed

Lines changed: 5 additions & 5 deletions

File tree

docs/app/docs/comparison/page.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -469,7 +469,7 @@ export default function ComparisonPage() {
469469
</div>
470470
</div>
471471

472-
<EditPageLink path="app/docs/comparison/page.tsx" />
472+
<EditPageLink />
473473
</div>
474474
);
475475
}

docs/app/docs/guides/postmark-error-handling/page.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ end`}</CodeBlock>
129129
<li>You send custom notifications based on error type</li>
130130
</ol>
131131

132-
<EditPageLink path="docs/app/docs/guides/postmark-error-handling/page.tsx" />
132+
<EditPageLink />
133133
</div>
134134
);
135135
}

docs/app/docs/terraform/page.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ variable "namespace" { type = string }`}
158158
</ul>
159159
</section>
160160

161-
<EditPageLink path="app/docs/terraform/page.tsx" />
161+
<EditPageLink />
162162
</div>
163163
);
164164
}

docs/components/edit-page-link.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ export function EditPageLink({ path }: EditPageLinkProps) {
1818
// Handle special case for root paths to avoid double slashes
1919
(pathname === '/' ? '/docs/app/page.tsx' : `/docs/app${pathname}/page.tsx`);
2020

21-
// Ensure there are no double slashes in the path
22-
const normalizedPath = derivedPath.replace(/\/\//g, '/');
21+
// Ensure there are no double slashes in the path and path starts with /
22+
const normalizedPath = derivedPath.replace(/\/\//g, '/').replace(/^(?!\/)/, '/');
2323

2424
const githubEditUrl = `https://github.com/DocSpring/logstruct/edit/main${normalizedPath}`;
2525

0 commit comments

Comments
 (0)