Skip to content

Commit 6a68871

Browse files
lionelcLei Jiang
andauthored
Optimize landing page (#272)
* disambiguation article * tag edit * Update download_packages.sh permission change * revert the permission change * add agent-kit link * Misc changes for website optimization Throughout the repo in agent-friendly efforts. Not actual content update for now (that needs more deliberation). * Fix pipeline errors * Why document db article * Campaign landing page and anchor article * Finalize landing page --------- Co-authored-by: Lei Jiang <jianglei@microsoft.com>
1 parent 593e53a commit 6a68871

5 files changed

Lines changed: 41 additions & 13 deletions

File tree

‎app/campaigns/landing/page.tsx‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ import CampaignFilm from "../../components/campaign/CampaignFilm";
33
import { getMetadata } from "../../services/metadataService";
44
import { withBasePath } from "../../services/sitePath";
55

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

99
export const metadata = {
1010
...getMetadata({ title, description, path: "/campaigns/landing/" }),
@@ -18,8 +18,8 @@ export default function LandingPage() {
1818
return (
1919
<main className="relative overflow-x-clip bg-neutral-950">
2020
<CampaignFilm
21-
tagline="Open source. Agent ready. Yours to run."
22-
heading="One prompt. A working app."
21+
tagline="DocumentDB. Built on PostgreSQL. MIT licensed."
22+
heading="The Open-Source Document Database built on PostgreSQL"
2323
description={description}
2424
primary={primary}
2525
secondary={secondary}

‎app/components/Navbar.tsx‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,7 @@ function fitToViewport(menu: HTMLDivElement | null) {
110110

111111
export default function Navbar() {
112112
const pathname = usePathname();
113+
const isLandingPage = pathname === "/campaigns/landing" || pathname === "/campaigns/landing/";
113114
const [isMenuOpen, setIsMenuOpen] = useState(false);
114115
const [menuPathname, setMenuPathname] = useState(pathname);
115116
const [openGroup, setOpenGroup] = useState<string | null>(null);
@@ -123,6 +124,7 @@ export default function Navbar() {
123124
if (menuPathname !== pathname) {
124125
setMenuPathname(pathname);
125126
setIsMenuOpen(false);
127+
if (isLandingPage) setOpenGroup(null);
126128
}
127129

128130
useEffect(() => {
@@ -155,6 +157,8 @@ export default function Navbar() {
155157
};
156158
}, [openGroup]);
157159

160+
if (isLandingPage) return null;
161+
158162
return (
159163
<nav className="sticky top-0 z-50 border-b border-neutral-700 bg-neutral-900/95 shadow-sm backdrop-blur">
160164
<div className="mx-auto max-w-7xl px-4 sm:px-6 lg:px-8">

‎app/components/campaign/AgentPrompts.module.css‎

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
margin: 0.35rem 0;
1414
font-size: clamp(1.5rem, 3vw, 2.5rem);
1515
font-weight: 600;
16+
font-style: italic;
17+
color: #f2cc75;
1618
line-height: 1.1;
1719
letter-spacing: -0.045em;
1820
}
@@ -29,6 +31,12 @@
2931
color: #cbd5e1;
3032
}
3133

34+
.description a {
35+
color: #7dd3fc;
36+
text-decoration: underline;
37+
text-underline-offset: 0.15em;
38+
}
39+
3240
.tabs {
3341
display: flex;
3442
flex-shrink: 0;
@@ -325,10 +333,6 @@
325333
min-height: 2.3125rem;
326334
}
327335

328-
.description {
329-
display: none;
330-
}
331-
332336
.links {
333337
padding: 0.5rem;
334338
gap: 0.35rem;
@@ -354,7 +358,6 @@
354358
font-size: 1.4rem;
355359
}
356360

357-
.description,
358361
.intro p {
359362
display: none;
360363
}
@@ -394,7 +397,6 @@
394397
gap: 0.25rem;
395398
}
396399

397-
.eyebrow,
398400
.resources > span {
399401
display: none;
400402
}

‎app/components/campaign/AgentPrompts.tsx‎

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,9 +70,11 @@ export default function AgentPrompts({ primary, secondary }: { primary: Link; se
7070
if (!event.currentTarget.contains(event.relatedTarget)) setFocused(false);
7171
}}>
7272
<div className={styles.heading}>
73-
<p className={styles.eyebrow}>Open source. Agent ready. Yours to run.</p>
74-
<h1 id="hero-heading">One prompt. A working app.</h1>
75-
<p className={styles.description}>Start with the basics, or let your agent build a sample.</p>
73+
<p className={styles.eyebrow}>DocumentDB. Built on PostgreSQL. MIT licensed.</p>
74+
<h1 id="hero-heading">The Open-Source Document Database built on PostgreSQL</h1>
75+
<p className={styles.description}>
76+
<a href={agentKitUrl} target="_blank" rel="noopener noreferrer">Try Agent-Kit</a> with a prompt. Build a working app.
77+
</p>
7678
</div>
7779

7880
<div hidden={!expanded} className={styles.carouselNav}>

‎tests/campaignLanding.test.tsx‎

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@ import { renderToStaticMarkup } from 'react-dom/server';
33
import { afterEach, describe, expect, it, vi } from 'vitest';
44
import { agentKitRevision, agentKitUrl, galleryRevision, samplePrompts } from '../app/components/campaign/promptContent';
55

6+
const { pathnameMock } = vi.hoisted(() => ({ pathnameMock: vi.fn() }));
7+
vi.mock('next/navigation', () => ({ usePathname: pathnameMock }));
8+
69
afterEach(() => {
710
vi.unstubAllEnvs();
811
vi.resetModules();
@@ -63,6 +66,23 @@ describe('agent landing page', () => {
6366
});
6467
});
6568

69+
describe('landing navigation', () => {
70+
it.each(['/campaigns/landing', '/campaigns/landing/'])('omits the navbar on %s', async (pathname) => {
71+
pathnameMock.mockReturnValue(pathname);
72+
const { default: Navbar } = await import('../app/components/Navbar');
73+
expect(renderToStaticMarkup(createElement(Navbar))).toBe('');
74+
});
75+
76+
it.each(['/', '/why-document-databases/', '/campaigns/landing-extra/'])('keeps the navbar on %s', async (pathname) => {
77+
pathnameMock.mockReturnValue(pathname);
78+
const { default: Navbar } = await import('../app/components/Navbar');
79+
const html = renderToStaticMarkup(createElement(Navbar));
80+
expect(html).toContain('<nav');
81+
expect(html).toContain('DocumentDB Logo');
82+
expect(html).toContain('Install &amp; Download');
83+
});
84+
});
85+
6686
describe('local document database article', () => {
6787
it('renders the polished article and its website tutorial link', async () => {
6888
const article = await import('../app/why-document-databases/page');

0 commit comments

Comments
 (0)