Add Blog link to landing header navigation - #81
Conversation
Surface the WordPress blog at blog.knowhereto.ai next to GitHub in the main site nav. Co-authored-by: Cursor <cursoragent@cursor.com>
There was a problem hiding this comment.
Pull request overview
Adds a new external “Blog” entry to the landing header navigation (desktop + mobile) with i18n labels and PostHog CTA tracking, extending the existing nav/link tracking pattern used for Docs/Playground.
Changes:
- Add
blogto the landing header nav model and render it as an external link. - Register PostHog CTA id mapping for the new nav item (
blog_external). - Add
Landing.header.nav.blogtranslations for English and Chinese, plus a landing header contract test assertion.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
app/(landing)/_components/landing-header.tsx |
Adds the Blog nav item, extends labelKey union, and maps blog to blog_external CTA tracking. |
i18n/locales/en.json |
Adds English translation for the new Landing.header.nav.blog label. |
i18n/locales/zh.json |
Adds Chinese translation for the new Landing.header.nav.blog label. |
lib/landing-figma-design.test.ts |
Extends landing header contract test to assert the Blog nav item is present. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| { 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 }, | ||
| ]; |
There was a problem hiding this comment.
Good catch. Updated LandingTrackedLink and LandingTrackedAnchor to use rel="noopener noreferrer" for all external links via a shared externalLinkRel constant, so Blog (and Docs/Playground) no longer expose window.opener.
| expect(landingHeaderSource).toContain( | ||
| '{ 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 }' | ||
| ); |
There was a problem hiding this comment.
Added an ordering assertion in landing-figma-design.test.ts to verify the GitHub nav item appears before Blog in landingNavItems, so future refactors cannot silently reorder them while still passing existence checks.
Use noopener noreferrer on external tracked links and assert Blog appears after GitHub in the landing header contract test. Co-authored-by: Cursor <cursoragent@cursor.com>
Summary
blog_externalVerification
npm test— landing contract tests passScreenshots or Recordings
Deployment Notes
Checklist
Made with Cursor