Skip to content

Commit 0957c30

Browse files
authored
Merge pull request #2173 from assafelovic/docs/homepage-restore-hero
docs(homepage): restore the two-column hero
2 parents cccfa85 + 7d88874 commit 0957c30

2 files changed

Lines changed: 105 additions & 11 deletions

File tree

‎docs/src/pages/index.js‎

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,14 +89,37 @@ function CopyInstall() {
8989
);
9090
}
9191

92+
function CodeCard() {
93+
return (
94+
<div className={styles.codeCard} aria-label="Example usage">
95+
<div className={styles.codeBar}>
96+
<span className={styles.dot} /><span className={styles.dot} /><span className={styles.dot} />
97+
<span className={styles.fileName}>research.py</span>
98+
</div>
99+
<pre className={styles.code}><code>
100+
<span className={styles.kw}>from</span> gpt_researcher <span className={styles.kw}>import</span> GPTResearcher{'\n\n'}
101+
researcher = GPTResearcher({'\n'}
102+
{' '}query=<span className={styles.str}>"Are solid-state batteries ready for EVs?"</span>,{'\n'}
103+
{' '}report_type=<span className={styles.str}>"research_report"</span>,{'\n'}
104+
){'\n\n'}
105+
<span className={styles.kw}>await</span> researcher.conduct_research(){'\n'}
106+
report = <span className={styles.kw}>await</span> researcher.write_report()
107+
</code></pre>
108+
<div className={styles.codeFoot}>
109+
<span className={styles.ok} /> Report ready · 18 sources · 57 citations
110+
</div>
111+
</div>
112+
);
113+
}
114+
92115
export default function Home() {
93116
return (
94117
<Layout
95118
title="Documentation"
96119
description="GPT Researcher is an open-source deep research agent that turns any question into a detailed, cited report from the web or your own documents.">
97120
<main className={styles.page}>
98121
<section className={styles.hero}>
99-
<div className={styles.heroInner}>
122+
<div className={styles.heroGrid}>
100123
<div>
101124
<h1 className={styles.title}>The #1 deep research agent</h1>
102125
<p className={styles.lede}>
@@ -112,6 +135,7 @@ export default function Home() {
112135
</div>
113136
<CopyInstall />
114137
</div>
138+
<CodeCard />
115139
</div>
116140
</section>
117141

‎docs/src/pages/index.module.css‎

Lines changed: 80 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
/* Hero */
3636
.hero {
3737
position: relative;
38-
padding: 128px 24px 24px;
38+
padding: 104px 24px 24px;
3939
overflow: hidden;
4040
}
4141
.hero::before {
@@ -48,15 +48,18 @@
4848
-webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 30%, #000 30%, transparent 75%);
4949
pointer-events: none;
5050
}
51-
.heroInner {
51+
.heroGrid {
5252
position: relative;
53-
max-width: 820px;
53+
max-width: 1180px;
5454
margin: 0 auto;
5555
padding: 0 24px;
56-
text-align: center;
56+
display: grid;
57+
grid-template-columns: 1.2fr 1fr;
58+
gap: 56px;
59+
align-items: center;
5760
}
5861
.title {
59-
font-size: clamp(40px, 5.6vw, 72px);
62+
font-size: clamp(40px, 5.2vw, 64px);
6063
line-height: 1.04;
6164
letter-spacing: -0.035em;
6265
font-weight: 650;
@@ -67,13 +70,12 @@
6770
font-size: 19px;
6871
line-height: 1.6;
6972
color: var(--ink-2);
70-
max-width: 620px;
71-
margin: 0 auto 32px;
73+
max-width: 540px;
74+
margin: 0 0 32px;
7275
}
7376
.ctas {
7477
display: flex;
7578
flex-wrap: wrap;
76-
justify-content: center;
7779
gap: 12px;
7880
margin-bottom: 24px;
7981
}
@@ -149,10 +151,73 @@
149151
}
150152

151153
/* Grid children may not grow past their track (long code lines, titles). */
154+
.heroGrid > *,
152155
.highlight > * {
153156
min-width: 0;
154157
}
155158

159+
/* Code card */
160+
.codeCard {
161+
background: var(--code-bg);
162+
border: 1px solid #2a2a28;
163+
border-radius: 14px;
164+
box-shadow: 0 30px 60px -30px rgba(0, 0, 0, 0.45);
165+
overflow: hidden;
166+
}
167+
.codeBar {
168+
display: flex;
169+
align-items: center;
170+
gap: 7px;
171+
padding: 12px 16px;
172+
border-bottom: 1px solid #242422;
173+
}
174+
.dot {
175+
width: 10px;
176+
height: 10px;
177+
border-radius: 50%;
178+
background: #3a3a37;
179+
}
180+
.fileName {
181+
margin-left: 10px;
182+
font-family: var(--ifm-font-family-monospace);
183+
font-size: 12.5px;
184+
color: var(--code-muted);
185+
}
186+
.code {
187+
margin: 0;
188+
background: transparent !important;
189+
color: var(--code-ink);
190+
font-size: 14px;
191+
line-height: 1.75;
192+
padding: 20px 22px;
193+
white-space: pre;
194+
overflow-x: auto;
195+
border-radius: 0;
196+
}
197+
.code code {
198+
background: none;
199+
border: none;
200+
padding: 0;
201+
color: inherit;
202+
}
203+
.kw { color: var(--code-kw); }
204+
.str { color: var(--code-str); }
205+
.codeFoot {
206+
display: flex;
207+
align-items: center;
208+
gap: 8px;
209+
padding: 12px 22px;
210+
border-top: 1px solid #242422;
211+
font-size: 13px;
212+
color: var(--code-muted);
213+
}
214+
.ok {
215+
width: 7px;
216+
height: 7px;
217+
border-radius: 50%;
218+
background: #3fb950;
219+
}
220+
156221
/* Sections */
157222
.section {
158223
max-width: 1180px;
@@ -395,11 +460,12 @@
395460
/* Responsive */
396461
@media (max-width: 996px) {
397462
.hero {
398-
padding: 80px 0 8px;
463+
padding: 72px 0 8px;
399464
}
400-
.heroInner {
465+
.heroGrid {
401466
padding: 0 20px;
402467
}
468+
.heroGrid,
403469
.highlight {
404470
grid-template-columns: 1fr;
405471
gap: 40px;
@@ -428,4 +494,8 @@
428494
.install code {
429495
font-size: 13px;
430496
}
497+
.code {
498+
font-size: 12.5px;
499+
padding: 16px;
500+
}
431501
}

0 commit comments

Comments
 (0)