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/i18n/locales/en.json b/i18n/locales/en.json index 50d0925..c14bf3b 100644 --- a/i18n/locales/en.json +++ b/i18n/locales/en.json @@ -520,7 +520,8 @@ "playground": "Playground", "pricing": "Pricing", "docs": "Docs", - "github": "GitHub" + "github": "GitHub", + "blog": "Blog" }, "cta": "GET API KEY", "openNavigationMenu": "Open navigation menu" diff --git a/i18n/locales/zh.json b/i18n/locales/zh.json index 99c2e39..ed7526c 100644 --- a/i18n/locales/zh.json +++ b/i18n/locales/zh.json @@ -521,7 +521,8 @@ "playground": "在线体验", "pricing": "价格", "docs": "文档", - "github": "GitHub" + "github": "GitHub", + "blog": "博客" }, "cta": "获取 API Key", "openNavigationMenu": "打开导航菜单" diff --git a/lib/landing-figma-design.test.ts b/lib/landing-figma-design.test.ts index 2444afa..4fe6493 100644 --- a/lib/landing-figma-design.test.ts +++ b/lib/landing-figma-design.test.ts @@ -23,6 +23,14 @@ describe("landing contracts", () => { '{ 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", () => {