Skip to content
Merged
8 changes: 4 additions & 4 deletions app/campaigns/landing/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ import CampaignFilm from "../../components/campaign/CampaignFilm";
import { getMetadata } from "../../services/metadataService";
import { withBasePath } from "../../services/sitePath";

const title = "DocumentDB for coding agents - Build with one prompt";
const description = "Give your coding agent one prompt and get a working app on an open-source document database built on PostgreSQL.";
const title = "DocumentDB - The Open-Source Document Database built on PostgreSQL";
const description = "Try Agent-Kit with a prompt. Build a working app on DocumentDB, the MIT-licensed document database built on PostgreSQL.";

export const metadata = {
...getMetadata({ title, description, path: "/campaigns/landing/" }),
Expand All @@ -18,8 +18,8 @@ export default function LandingPage() {
return (
<main className="relative overflow-x-clip bg-neutral-950">
<CampaignFilm
tagline="Open source. Agent ready. Yours to run."
heading="One prompt. A working app."
tagline="DocumentDB. Built on PostgreSQL. MIT licensed."
heading="The Open-Source Document Database built on PostgreSQL"
description={description}
primary={primary}
secondary={secondary}
Expand Down
4 changes: 4 additions & 0 deletions app/components/Navbar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ function fitToViewport(menu: HTMLDivElement | null) {

export default function Navbar() {
const pathname = usePathname();
const isLandingPage = pathname === "/campaigns/landing" || pathname === "/campaigns/landing/";
const [isMenuOpen, setIsMenuOpen] = useState(false);
const [menuPathname, setMenuPathname] = useState(pathname);
const [openGroup, setOpenGroup] = useState<string | null>(null);
Expand All @@ -123,6 +124,7 @@ export default function Navbar() {
if (menuPathname !== pathname) {
setMenuPathname(pathname);
setIsMenuOpen(false);
if (isLandingPage) setOpenGroup(null);
}

useEffect(() => {
Expand Down Expand Up @@ -155,6 +157,8 @@ export default function Navbar() {
};
}, [openGroup]);

if (isLandingPage) return null;

return (
<nav className="sticky top-0 z-50 border-b border-neutral-700 bg-neutral-900/95 shadow-sm backdrop-blur">
<div className="mx-auto max-w-7xl px-4 sm:px-6 lg:px-8">
Expand Down
14 changes: 8 additions & 6 deletions app/components/campaign/AgentPrompts.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
margin: 0.35rem 0;
font-size: clamp(1.5rem, 3vw, 2.5rem);
font-weight: 600;
font-style: italic;
color: #f2cc75;
line-height: 1.1;
letter-spacing: -0.045em;
}
Expand All @@ -29,6 +31,12 @@
color: #cbd5e1;
}

.description a {
color: #7dd3fc;
text-decoration: underline;
text-underline-offset: 0.15em;
}

.tabs {
display: flex;
flex-shrink: 0;
Expand Down Expand Up @@ -325,10 +333,6 @@
min-height: 2.3125rem;
}

.description {
display: none;
}

.links {
padding: 0.5rem;
gap: 0.35rem;
Expand All @@ -354,7 +358,6 @@
font-size: 1.4rem;
}

.description,
.intro p {
display: none;
}
Expand Down Expand Up @@ -394,7 +397,6 @@
gap: 0.25rem;
}

.eyebrow,
.resources > span {
display: none;
}
Expand Down
8 changes: 5 additions & 3 deletions app/components/campaign/AgentPrompts.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,11 @@ export default function AgentPrompts({ primary, secondary }: { primary: Link; se
if (!event.currentTarget.contains(event.relatedTarget)) setFocused(false);
}}>
<div className={styles.heading}>
<p className={styles.eyebrow}>Open source. Agent ready. Yours to run.</p>
<h1 id="hero-heading">One prompt. A working app.</h1>
<p className={styles.description}>Start with the basics, or let your agent build a sample.</p>
<p className={styles.eyebrow}>DocumentDB. Built on PostgreSQL. MIT licensed.</p>
<h1 id="hero-heading">The Open-Source Document Database built on PostgreSQL</h1>
<p className={styles.description}>
<a href={agentKitUrl} target="_blank" rel="noopener noreferrer">Try Agent-Kit</a> with a prompt. Build a working app.
</p>
</div>

<div hidden={!expanded} className={styles.carouselNav}>
Expand Down
20 changes: 20 additions & 0 deletions tests/campaignLanding.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ import { renderToStaticMarkup } from 'react-dom/server';
import { afterEach, describe, expect, it, vi } from 'vitest';
import { agentKitRevision, agentKitUrl, galleryRevision, samplePrompts } from '../app/components/campaign/promptContent';

const { pathnameMock } = vi.hoisted(() => ({ pathnameMock: vi.fn() }));
vi.mock('next/navigation', () => ({ usePathname: pathnameMock }));

afterEach(() => {
vi.unstubAllEnvs();
vi.resetModules();
Expand Down Expand Up @@ -63,6 +66,23 @@ describe('agent landing page', () => {
});
});

describe('landing navigation', () => {
it.each(['/campaigns/landing', '/campaigns/landing/'])('omits the navbar on %s', async (pathname) => {
pathnameMock.mockReturnValue(pathname);
const { default: Navbar } = await import('../app/components/Navbar');
expect(renderToStaticMarkup(createElement(Navbar))).toBe('');
});

it.each(['/', '/why-document-databases/', '/campaigns/landing-extra/'])('keeps the navbar on %s', async (pathname) => {
pathnameMock.mockReturnValue(pathname);
const { default: Navbar } = await import('../app/components/Navbar');
const html = renderToStaticMarkup(createElement(Navbar));
expect(html).toContain('<nav');
expect(html).toContain('DocumentDB Logo');
expect(html).toContain('Install &amp; Download');
});
});

describe('local document database article', () => {
it('renders the polished article and its website tutorial link', async () => {
const article = await import('../app/why-document-databases/page');
Expand Down