Skip to content

Commit fc7fab1

Browse files
committed
feat(website): syntax-highlighted copy-able code blocks + content pass
- Add a CodeBlock component (Shiki highlighting at build time + a hover copy button) and use it for every code snippet on the homepage (pipeline, embed, dev installs) — replaces the plain <code> tags and the hand-built embed span block. Content pass (factual + onboarding): - Lead the hero with "Download the app" (Agent UI first — the easiest start), with "Start building" as the secondary. New line frames the flow: download → run an agent → build your own or embed one in your app. - Drop the absolute "100% locally" (cloud providers are opt-in) → "locally". - Fix the Run pipeline command: `python my_agent.py` (no `gaia <id>` run path exists for an installed agent — running happens via the app). - Highlight that hub agents are purpose-built + bulletproof (tested, versioned, immutable once published).
1 parent c9bf6a2 commit fc7fab1

2 files changed

Lines changed: 102 additions & 15 deletions

File tree

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
---
2+
// Copyright(C) 2024-2026 Advanced Micro Devices, Inc. All rights reserved.
3+
// SPDX-License-Identifier: MIT
4+
5+
// Syntax-highlighted (Shiki, at build time) code block with a hover copy button.
6+
import { Code } from 'astro:components';
7+
8+
interface Props {
9+
code: string;
10+
lang?: string;
11+
class?: string;
12+
}
13+
const { code, lang = 'bash', class: className = '' } = Astro.props;
14+
---
15+
16+
<div class={`code-block group relative ${className}`}>
17+
<Code code={code} lang={lang as any} theme="github-dark" />
18+
<button type="button" class="code-copy" data-code-copy={code} aria-label="Copy to clipboard">
19+
<svg class="ic ic-copy" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><rect x="9" y="9" width="13" height="13" rx="2"/><path d="M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"/></svg>
20+
<svg class="ic ic-check" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><polyline points="20 6 9 17 4 12"/></svg>
21+
</button>
22+
</div>
23+
24+
<script>
25+
document.querySelectorAll<HTMLButtonElement>('.code-copy').forEach((btn) => {
26+
btn.addEventListener('click', async () => {
27+
try {
28+
await navigator.clipboard.writeText(btn.dataset.codeCopy || '');
29+
} catch {
30+
return;
31+
}
32+
btn.classList.add('copied');
33+
setTimeout(() => btn.classList.remove('copied'), 1500);
34+
});
35+
});
36+
</script>
37+
38+
<style>
39+
/* Shiki renders its own <pre>; frame it on tokens. */
40+
.code-block :global(pre) {
41+
margin: 0;
42+
padding: 0.8rem 2.6rem 0.8rem 1rem; /* right pad leaves room for the copy button */
43+
border-radius: 0.5rem;
44+
border: 1px solid rgb(var(--g-border));
45+
overflow-x: auto;
46+
font-size: 12.5px;
47+
line-height: 1.6;
48+
}
49+
.code-copy {
50+
position: absolute;
51+
top: 0.45rem;
52+
right: 0.45rem;
53+
display: inline-flex;
54+
align-items: center;
55+
justify-content: center;
56+
padding: 0.3rem;
57+
border-radius: 0.375rem;
58+
border: 1px solid rgb(var(--g-border));
59+
background: rgb(var(--g-surface));
60+
color: rgb(var(--g-muted));
61+
opacity: 0;
62+
transition: opacity 0.15s ease, color 0.15s ease;
63+
}
64+
.code-block:hover .code-copy,
65+
.code-copy:focus-visible {
66+
opacity: 1;
67+
}
68+
.code-copy:hover {
69+
color: rgb(var(--g-text));
70+
}
71+
.ic-check {
72+
display: none;
73+
}
74+
.code-copy.copied .ic-copy {
75+
display: none;
76+
}
77+
.code-copy.copied .ic-check {
78+
display: inline;
79+
color: rgb(var(--g-gold-text));
80+
}
81+
</style>

website/src/pages/index.astro

Lines changed: 21 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import AuroraBg from '../components/AuroraBg.astro';
1010
import AgentIcon from '../components/AgentIcon.astro';
1111
import FeaturedCard from '../components/FeaturedCard.astro';
1212
import DownloadButton from '../components/DownloadButton.astro';
13+
import CodeBlock from '../components/CodeBlock.astro';
1314
import { getCatalog } from '../data/catalog';
1415
1516
const agents = await getCatalog();
@@ -29,8 +30,8 @@ const pipeline = [
2930
{
3031
step: 'Run',
3132
icon: 'cpu',
32-
body: 'It runs 100% locally on AI PCs — AMD Ryzen AI first-class, via Lemonade. Private by default, no API keys required. Cloud models are opt-in.',
33-
code: 'gaia my-agent "..."',
33+
body: 'It runs locally on AI PCs — AMD Ryzen AI first-class, via Lemonade. Private by default, no API keys required; cloud models are opt-in.',
34+
code: 'python my_agent.py',
3435
},
3536
{
3637
step: 'Distribute',
@@ -54,6 +55,12 @@ const devInstalls = [
5455
{ label: 'pip', cmd: 'uv pip install amd-gaia', note: 'The Python SDK + CLI framework.' },
5556
{ label: 'script', cmd: 'curl -fsSL https://amd-gaia.ai/install.sh | sh', note: 'One-line install (Windows: irm …install.ps1 | iex).' },
5657
];
58+
59+
const embedSnippet = `// embed the email agent as a local sidecar
60+
import { fetchBinary, startSidecar } from "@amd-gaia/agent-email";
61+
62+
const { binaryPath } = await fetchBinary({ outDir: "resources" });
63+
const sidecar = await startSidecar({ binaryPath, port: 8131 });`;
5764
---
5865

5966
<Layout title="GAIA — The Agent Factory" description="Build, run, and distribute AI agents that run locally on AI PCs.">
@@ -69,17 +76,17 @@ const devInstalls = [
6976
GAIA — The Agent&nbsp;Factory.
7077
</h1>
7178
<p class="mt-5 text-lg text-g-muted max-w-2xl mx-auto">
72-
Build, run, and distribute AI agents that run <strong class="text-g-text font-semibold">100% locally on AI PCs</strong> —
79+
Build, run, and distribute AI agents that run <strong class="text-g-text font-semibold">locally on AI PCs</strong> —
7380
private by default, no API keys required. Write one in minutes; publish to the Agent Hub and anyone can install it in one click.
7481
</p>
7582
<div class="mt-9 flex flex-wrap items-center justify-center gap-3">
76-
<a href={QUICKSTART} class="rounded-md bg-g-gold px-6 py-3 text-sm font-semibold text-black hover:brightness-110 transition">
83+
<DownloadButton variant="primary" size="lg" />
84+
<a href={QUICKSTART} class="rounded-md border border-g-border px-6 py-3 text-sm font-semibold text-g-text hover:border-g-gold/50 transition-colors">
7785
Start building
7886
</a>
79-
<DownloadButton variant="secondary" size="lg" />
8087
</div>
8188
<p class="mt-3 text-xs text-g-muted">
82-
Free · Windows, macOS, Linux · or <a href="#developers" class="text-g-gold-text hover:underline">install via CLI →</a>
89+
Fastest start: download, browse the hub, run an agent — then build your own or embed one in your app. Free · Windows, macOS, Linux · or <a href="#developers" class="text-g-gold-text hover:underline">install via CLI →</a>
8390
</p>
8491
<!-- Trust strip -->
8592
<div class="mt-8 flex flex-wrap items-center justify-center gap-x-5 gap-y-2 text-[12px] text-g-muted">
@@ -106,7 +113,7 @@ const devInstalls = [
106113
</span>
107114
<h3 class="mt-4 text-lg font-semibold text-g-text">{p.step}</h3>
108115
<p class="mt-2 text-[14px] text-g-muted leading-relaxed">{p.body}</p>
109-
<code class="mt-4 block rounded-md border border-g-border bg-g-bg px-3 py-2 font-mono text-[12.5px] text-g-gold-text overflow-x-auto">$ {p.code}</code>
116+
<CodeBlock code={p.code} lang="bash" class="mt-4" />
110117
</div>
111118
))}
112119
</div>
@@ -147,12 +154,7 @@ const devInstalls = [
147154
<span>· Signed &amp; checksummed artifacts</span>
148155
</div>
149156
</div>
150-
<div class="rounded-xl border border-g-border bg-g-bg p-5 font-mono text-[12.5px] text-g-text overflow-x-auto">
151-
<span class="text-g-muted">// embed the email agent as a local sidecar</span><br />
152-
<span class="text-g-gold-text">import</span> {'{ fetchBinary, startSidecar }'} <span class="text-g-gold-text">from</span> "@amd-gaia/agent-email";<br /><br />
153-
<span class="text-g-gold-text">const</span> {'{ binaryPath }'} = <span class="text-g-gold-text">await</span> fetchBinary({'{ outDir: "resources" }'});<br />
154-
<span class="text-g-gold-text">const</span> sidecar = <span class="text-g-gold-text">await</span> startSidecar({'{ binaryPath, port: 8131 }'});
155-
</div>
157+
<CodeBlock code={embedSnippet} lang="ts" />
156158
</div>
157159
</section>
158160

@@ -162,8 +164,12 @@ const devInstalls = [
162164
<div>
163165
<Eyebrow class="mb-2">Agent Hub</Eyebrow>
164166
<h2 class="text-2xl font-bold tracking-tight">There's an agent for that.</h2>
167+
<p class="mt-2 max-w-lg text-[14px] text-g-muted">
168+
Each one is <strong class="font-semibold text-g-text">purpose-built</strong> for a single job and
169+
<strong class="font-semibold text-g-text">bulletproof</strong> — tested, versioned, and immutable once published.
170+
</p>
165171
</div>
166-
<a href="/hub" class="text-sm text-g-gold-text hover:underline">All agents →</a>
172+
<a href="/hub" class="whitespace-nowrap text-sm text-g-gold-text hover:underline">All agents →</a>
167173
</div>
168174
{featured.length > 0 && (
169175
<div class="grid sm:grid-cols-3 gap-5">
@@ -182,7 +188,7 @@ const devInstalls = [
182188
{devInstalls.map((d) => (
183189
<div class="rounded-xl border border-g-border bg-g-surface p-5">
184190
<div class="text-[11px] font-bold uppercase tracking-wide text-g-gold-text">{d.label}</div>
185-
<code class="mt-2 block rounded-md border border-g-border bg-g-bg px-3 py-2 font-mono text-[12px] text-g-text overflow-x-auto">{d.cmd}</code>
191+
<CodeBlock code={d.cmd} lang="bash" class="mt-2" />
186192
<p class="mt-2 text-[12.5px] text-g-muted">{d.note}</p>
187193
</div>
188194
))}

0 commit comments

Comments
 (0)