diff --git a/app/(landing)/_components/landing-header.tsx b/app/(landing)/_components/landing-header.tsx index 7f643f4..a9aab11 100644 --- a/app/(landing)/_components/landing-header.tsx +++ b/app/(landing)/_components/landing-header.tsx @@ -17,7 +17,7 @@ const monoDisplayClassName = "font-[family-name:var(--font-mono-display)]"; type LandingNavItem = { href: string; - labelKey: "comparison" | "docs" | "github" | "playground" | "pricing"; + labelKey: "comparison" | "docs" | "github" | "playground" | "pricing" | "blog"; external?: boolean; }; @@ -27,6 +27,7 @@ const landingNavItems: LandingNavItem[] = [ { href: "#pricing", labelKey: "pricing" }, { href: "https://docs.knowhereto.ai/", labelKey: "docs", external: true }, { href: "/github", labelKey: "github" }, + { href: "https://blog.knowhereto.ai/", labelKey: "blog", external: true }, ]; const localeLabels = { @@ -35,6 +36,7 @@ const localeLabels = { } as const; const landingNavCtaIds: Record = { + blog: "blog_external", comparison: "comparison", docs: "docs", github: "github", diff --git a/app/(landing)/_components/landing-tracked-link.tsx b/app/(landing)/_components/landing-tracked-link.tsx index 449ec85..abe93d1 100644 --- a/app/(landing)/_components/landing-tracked-link.tsx +++ b/app/(landing)/_components/landing-tracked-link.tsx @@ -36,6 +36,8 @@ type LandingTrackedButtonProps = { const isContactSalesCta = (ctaId: string) => ctaId === "contact_sales" || ctaId === "book_demo"; +const externalLinkRel = "noopener noreferrer"; + const trackCta = (ctaId: string, sourceSection: string, locale: string, href?: string) => { if (isContactSalesCta(ctaId)) { trackContactSalesClicked(sourceSection); @@ -72,7 +74,7 @@ export const LandingTrackedLink = ({ className={className} href={href} onClick={handleClick} - rel={external ? "noreferrer" : undefined} + rel={external ? externalLinkRel : undefined} target={external ? "_blank" : undefined} > {children} @@ -101,7 +103,7 @@ export const LandingTrackedAnchor = ({ className={className} href={href} onClick={handleClick} - rel={external ? "noreferrer" : undefined} + rel={external ? externalLinkRel : undefined} target={external ? "_blank" : undefined} > {children} diff --git a/app/github/page.tsx b/app/github/page.tsx index 080dc96..678fafb 100644 --- a/app/github/page.tsx +++ b/app/github/page.tsx @@ -19,9 +19,9 @@ export default function GithubRedirectPage() { return (
-

Redirecting to GitHub…

+

Taking you to GitHub…

- Taking you to the Knowhere repository. If nothing happens, use the link below. + Knowhere is fully open source. Explore the code, contribute, or build on top of it.

{ '{ href: "https://notebook.knowhereto.ai", labelKey: "playground", external: true }' ); expect(landingHeaderSource).toContain('{ href: "/github", labelKey: "github" }'); + expect(landingHeaderSource).toContain( + '{ href: "https://blog.knowhereto.ai/", labelKey: "blog", external: true }' + ); + expect(landingHeaderSource.indexOf('{ href: "/github", labelKey: "github" }')).toBeLessThan( + landingHeaderSource.indexOf( + '{ href: "https://blog.knowhereto.ai/", labelKey: "blog", external: true }' + ) + ); }); it("keeps the playground sample area annotated with the drag-to-parse cue", () => {