Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: next -> main #367

Merged
merged 20 commits into from
Sep 9, 2024
Prev Previous commit
Next Next commit
fix: vanity domain href
  • Loading branch information
Ehesp committed Sep 3, 2024
commit 465da645c9bd0b8b3b5cb863bca059b2dfc52db5
1 change: 0 additions & 1 deletion website/app/components/Tabs.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ export function Tabs(props: Props) {
<li key={href}>
<NavLink
to={href}
target={isExternalLink(href) ? "_blank" : undefined}
className={cn(
"relative top-px flex items-center h-12 border-b-[1.5px] border-transparent",
{
Expand Down
10 changes: 5 additions & 5 deletions website/app/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -203,14 +203,14 @@ export function getHref(ctx: Context, path: string) {
// Define the base href for the current request.
let href = "";

// If it's a vanity domain, we need to prefix the path with the owner and repository.
if (ctx.vanity) {
href += `/${ctx.repository}`;
}
// Ensure all links start with the custom domain if it's set.
if (ctx.domain) {
else if (ctx.domain) {
href += `https://${ctx.domain}`;
}
// If it's a vanity domain, we need to prefix the path with the owner and repository.
else if (ctx.vanity) {
href += `https://${ctx.owner}.docs.page/${ctx.repository}`;
}
// Prefix the path with the owner and repository, e.g. `/invertase/docs.page`.
else {
href = `/${ctx.owner}/${ctx.repository}`;
Expand Down