diff --git a/src/components/DocsHeader.tsx b/src/components/DocsHeader.tsx index 461f62d1..7d2f8f10 100644 --- a/src/components/DocsHeader.tsx +++ b/src/components/DocsHeader.tsx @@ -17,6 +17,7 @@ type MegaMenuData = { columns: MegaColumn[]; variant?: 'columns' | 'vertical' } type MenuItem = { label: string; href: string; mega?: MegaMenuData } const DOCS_BASE_PATH = '/docs' +const DEVELOPERS_BASE_PATH = '/developers' const TEMPO_AI_GUIDE_URL = `${DOCS_BASE_PATH}/guide/using-tempo-with-ai` const TEMPO_DOCS_SKILL_URL = `${TEMPO_AI_GUIDE_URL}#docs-skill` const TEMPO_PLUGIN_URL = `${TEMPO_AI_GUIDE_URL}#install-tempo-plugins` @@ -25,10 +26,10 @@ const TEMPO_SDK_DOCS_URL = `${DOCS_BASE_PATH}/sdk` function featurePath(slug: string) { const featurePaths: Record = { - transactions: '/build/tempo-transactions', - tokens: '/build/tip20-tokens', + transactions: `${DEVELOPERS_BASE_PATH}/build/tempo-transactions`, + tokens: `${DEVELOPERS_BASE_PATH}/build/tip20-tokens`, } - return featurePaths[slug] ?? '/build' + return featurePaths[slug] ?? DEVELOPERS_BASE_PATH } function isExternal(href: string) { @@ -358,10 +359,10 @@ const developersMenu: MegaMenuData = { } const menu: MenuItem[] = [ - { label: 'Build', href: '/#protocol', mega: protocolMenu }, + { label: 'Build', href: `${DEVELOPERS_BASE_PATH}#protocol`, mega: protocolMenu }, { label: 'Resources', href: `${DOCS_BASE_PATH}/guide`, mega: developersMenu }, - { label: 'Performance', href: '/performance' }, - { label: 'Blog', href: '/blog' }, + { label: 'Performance', href: `${DEVELOPERS_BASE_PATH}/performance` }, + { label: 'Blog', href: `${DEVELOPERS_BASE_PATH}/blog` }, { label: 'Docs', href: DOCS_BASE_PATH }, ] diff --git a/src/marketing/app/_components/BlogSection.tsx b/src/marketing/app/_components/BlogSection.tsx index c3325288..90df3150 100644 --- a/src/marketing/app/_components/BlogSection.tsx +++ b/src/marketing/app/_components/BlogSection.tsx @@ -1,4 +1,5 @@ import Link from 'next/link' +import { developersPath } from '../_lib/developersPaths' import FeaturedVisual from '../blog/_components/FeaturedVisual' import { formatDate } from '../blog/_lib/categories' import { getAllPosts, getFeaturedPost } from '../blog/_lib/posts' @@ -24,7 +25,7 @@ export default function BlogSection() {
@@ -51,7 +52,7 @@ export default function BlogSection() {
  • @@ -69,7 +70,7 @@ export default function BlogSection() { View all blogs diff --git a/src/marketing/app/_components/Footer.tsx b/src/marketing/app/_components/Footer.tsx index d2e637cc..9d60a060 100644 --- a/src/marketing/app/_components/Footer.tsx +++ b/src/marketing/app/_components/Footer.tsx @@ -1,6 +1,7 @@ import Link from 'next/link' import SimpleIconsGithub from '~icons/simple-icons/github' import SimpleIconsX from '~icons/simple-icons/x' +import { developersPath } from '../_lib/developersPaths' import { featurePath } from '../_lib/featurePaths' import { TEMPO_SDK_DOCS_URL } from '../_lib/links' import EdgeMarkers from './EdgeMarkers' @@ -72,21 +73,21 @@ const columns: FooterColumn[] = [ links: [ { label: 'Tempo Docs skill', - href: '/docs/guide/using-tempo-with-ai#docs-skill', + href: `${developersPath('/docs/guide/using-tempo-with-ai')}#docs-skill`, }, - { label: 'Tempo MCP server', href: 'https://mcp.tempo.xyz' }, + { label: 'Tempo MCP server', href: developersPath('/docs/guide/using-tempo-with-ai') }, { label: 'Setup docs', - href: '/docs/guide/using-tempo-with-ai', + href: developersPath('/docs/guide/using-tempo-with-ai'), }, ], }, { header: 'Resources', links: [ - { label: 'Blog', href: '/blog' }, - { label: 'Performance', href: '/performance' }, - { label: 'Open source', href: '/#open-source' }, + { label: 'Blog', href: developersPath('/blog') }, + { label: 'Performance', href: developersPath('/performance') }, + { label: 'Open source', href: `${developersPath('/')}#open-source` }, { label: 'Contact', href: CONTACT_URL }, ], }, diff --git a/src/marketing/app/_components/Header.tsx b/src/marketing/app/_components/Header.tsx index 9464340c..7831b41a 100644 --- a/src/marketing/app/_components/Header.tsx +++ b/src/marketing/app/_components/Header.tsx @@ -7,6 +7,7 @@ import Link from 'next/link' import { usePathname } from 'next/navigation' import { type ReactNode, useEffect, useLayoutEffect, useRef, useState } from 'react' import { AmpLogo, ClaudeLogo, CodexLogo } from '../../../components/AgentLogos' +import { developersPath } from '../_lib/developersPaths' import { featurePath } from '../_lib/featurePaths' import { TEMPO_SDK_DOCS_URL } from '../_lib/links' import ArrowUpRight from './ArrowUpRight' @@ -123,7 +124,7 @@ const developersMenu: MegaMenuData = { ], } -const TEMPO_AI_GUIDE_URL = '/docs/guide/using-tempo-with-ai' +const TEMPO_AI_GUIDE_URL = developersPath('/docs/guide/using-tempo-with-ai') const TEMPO_DOCS_SKILL_URL = `${TEMPO_AI_GUIDE_URL}#docs-skill` const TEMPO_PLUGIN_URL = `${TEMPO_AI_GUIDE_URL}#install-tempo-plugins` const TEMPO_MCP_URL = 'https://mcp.tempo.xyz' @@ -169,10 +170,10 @@ function ActiveSquare({ activeKey }: { activeKey: string }) { } const menu: MenuItem[] = [ - { label: 'Build', href: '/#protocol', mega: protocolMenu }, - { label: 'Resources', href: '/docs', mega: developersMenu }, - { label: 'Performance', href: '/performance' }, - { label: 'Blog', href: '/blog' }, + { label: 'Build', href: `${developersPath('/')}#protocol`, mega: protocolMenu }, + { label: 'Resources', href: developersPath('/docs'), mega: developersMenu }, + { label: 'Performance', href: developersPath('/performance') }, + { label: 'Blog', href: developersPath('/blog') }, { label: 'Docs', href: TEMPO_DOCS_URL }, ] diff --git a/src/marketing/app/_components/Hero.tsx b/src/marketing/app/_components/Hero.tsx index 8e92e93a..da34d8d1 100644 --- a/src/marketing/app/_components/Hero.tsx +++ b/src/marketing/app/_components/Hero.tsx @@ -1,4 +1,5 @@ import Link from 'next/link' +import { developersPath } from '../_lib/developersPaths' import { featurePath } from '../_lib/featurePaths' import ArrowUpRight from './ArrowUpRight' import Button from './Button' @@ -41,7 +42,7 @@ const HERO_PATHS = [ { title: 'Performance at scale', desc: 'Throughput that pushes the frontier, with predictably low fees at scale.', - href: '/performance', + href: developersPath('/performance'), }, ] as const diff --git a/src/marketing/app/_components/PerfSection.tsx b/src/marketing/app/_components/PerfSection.tsx index 816cfcc5..a842457d 100644 --- a/src/marketing/app/_components/PerfSection.tsx +++ b/src/marketing/app/_components/PerfSection.tsx @@ -3,6 +3,7 @@ import Link from 'next/link' import type { ReactNode } from 'react' +import { developersPath } from '../_lib/developersPaths' import { linePath } from '../performance/_lib/chart' import type { PerfRun } from '../performance/_lib/runs' import ArrowUpRight from './ArrowUpRight' @@ -12,7 +13,7 @@ import { PALETTE } from './palette' import Reveal from './Reveal' import type { Stat } from './stats' -const PERFORMANCE_PAGE = '/performance' +const PERFORMANCE_PAGE = developersPath('/performance') // Sparkline points in a fixed 0–100 viewBox (8% vertical padding). Rendered // with preserveAspectRatio="none" + non-scaling strokes, so the same path diff --git a/src/marketing/app/_lib/developersPaths.ts b/src/marketing/app/_lib/developersPaths.ts new file mode 100644 index 00000000..1e488bbb --- /dev/null +++ b/src/marketing/app/_lib/developersPaths.ts @@ -0,0 +1,6 @@ +export const DEVELOPERS_BASE_PATH = '/developers' + +export function developersPath(path: string): string { + if (path === '/') return DEVELOPERS_BASE_PATH + return `${DEVELOPERS_BASE_PATH}${path.startsWith('/') ? path : `/${path}`}` +} diff --git a/src/marketing/app/_lib/featurePaths.ts b/src/marketing/app/_lib/featurePaths.ts index b21d2a36..83418e7a 100644 --- a/src/marketing/app/_lib/featurePaths.ts +++ b/src/marketing/app/_lib/featurePaths.ts @@ -1,8 +1,10 @@ +import { developersPath } from './developersPaths' + const featurePaths: Record = { - transactions: '/build/tempo-transactions', - tokens: '/build/tip20-tokens', + transactions: developersPath('/build/tempo-transactions'), + tokens: developersPath('/build/tip20-tokens'), } export function featurePath(slug: string): string { - return featurePaths[slug] ?? '/build' + return featurePaths[slug] ?? developersPath('/build') } diff --git a/src/marketing/app/blog/[slug]/page.tsx b/src/marketing/app/blog/[slug]/page.tsx index de4b3675..cfc1e4d1 100644 --- a/src/marketing/app/blog/[slug]/page.tsx +++ b/src/marketing/app/blog/[slug]/page.tsx @@ -2,6 +2,7 @@ import Link from 'next/link' import Footer from '../../_components/Footer' import Header from '../../_components/Header' import Reveal from '../../_components/Reveal' +import { developersPath } from '../../_lib/developersPaths' import { categoryBySlug, formatDate, isNew } from '../_lib/categories' import { getPost } from '../_lib/posts' @@ -18,7 +19,7 @@ export default function BlogPostPage({ params }: { params: { slug: string } }) { Post not found ← Blog @@ -38,7 +39,7 @@ export default function BlogPostPage({ params }: { params: { slug: string } }) {
    ← Blog diff --git a/src/marketing/app/blog/_components/PostExplorer.tsx b/src/marketing/app/blog/_components/PostExplorer.tsx index f0ebaad1..160794d4 100644 --- a/src/marketing/app/blog/_components/PostExplorer.tsx +++ b/src/marketing/app/blog/_components/PostExplorer.tsx @@ -3,6 +3,7 @@ import Link from 'next/link' import { useState } from 'react' import Reveal from '../../_components/Reveal' +import { developersPath } from '../../_lib/developersPaths' import { categories, categoryBySlug, isNew, type PostMeta } from '../_lib/categories' const filters = [{ slug: 'all' as const, label: 'All' }, ...categories] @@ -43,7 +44,7 @@ export default function PostExplorer({ posts }: { posts: PostMeta[] }) {
  • diff --git a/src/marketing/app/blog/page.tsx b/src/marketing/app/blog/page.tsx index f126acc7..6bd0b96f 100644 --- a/src/marketing/app/blog/page.tsx +++ b/src/marketing/app/blog/page.tsx @@ -2,6 +2,7 @@ import Link from 'next/link' import Footer from '../_components/Footer' import Header from '../_components/Header' import Reveal from '../_components/Reveal' +import { developersPath } from '../_lib/developersPaths' import FeaturedVisual from './_components/FeaturedVisual' import PostExplorer from './_components/PostExplorer' import { formatDate, isNew } from './_lib/categories' @@ -26,7 +27,7 @@ export default function BlogPage() {