Skip to content

Commit e54e6c0

Browse files
committed
fix: address landing PR feedback
1 parent 9d904e9 commit e54e6c0

9 files changed

Lines changed: 63 additions & 20 deletions

File tree

landing/src/app/agentic-development/opengraph-image.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ export const alt = seo.pages.agenticDevelopment.ogTitle;
99
export const contentType = ogImageContentType;
1010
export const size = ogImageSize;
1111

12-
export default function Image() {
13-
return createOgImage({
12+
export default async function Image() {
13+
return await createOgImage({
1414
eyebrow: "Agentic Development",
1515
title: seo.pages.agenticDevelopment.ogTitle,
1616
description: seo.pages.agenticDevelopment.description,

landing/src/app/agentic-qa/opengraph-image.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ export const alt = seo.pages.agenticQa.ogTitle;
99
export const contentType = ogImageContentType;
1010
export const size = ogImageSize;
1111

12-
export default function Image() {
13-
return createOgImage({
12+
export default async function Image() {
13+
return await createOgImage({
1414
eyebrow: "Agentic QA",
1515
title: seo.pages.agenticQa.ogTitle,
1616
description: seo.pages.agenticQa.description,

landing/src/app/llms-full.txt/route.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { createLlmsFullTxt } from "@/lib/llms";
22

3-
export const dynamic = "force-dynamic";
3+
export const dynamic = "force-static";
44

55
export function GET() {
66
return new Response(createLlmsFullTxt(), {

landing/src/app/llms.txt/route.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { createLlmsTxt } from "@/lib/llms";
22

3-
export const dynamic = "force-dynamic";
3+
export const dynamic = "force-static";
44

55
export function GET() {
66
return new Response(createLlmsTxt(), {

landing/src/app/opengraph-image.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ export const alt = seo.pages.home.ogTitle;
99
export const contentType = ogImageContentType;
1010
export const size = ogImageSize;
1111

12-
export default function Image() {
13-
return createOgImage({
12+
export default async function Image() {
13+
return await createOgImage({
1414
eyebrow: "Agent Device",
1515
title: seo.pages.home.ogTitle,
1616
description: seo.pages.home.description,

landing/src/components/home/footer.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ const footerGroups = [
1212
{
1313
title: "Documentation",
1414
links: [
15-
{ href: "https://github.com/callstackincubator/agent-device", label: "Documentation" },
15+
{ href: "https://oss.callstack.com/agent-device/", label: "Documentation" },
1616
{ href: "https://github.com/callstackincubator/agent-device", label: "GitHub" },
1717
],
1818
},

landing/src/components/prompt-copy-button.tsx

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,26 +11,30 @@ type PromptCopyButtonProps = {
1111
};
1212

1313
async function copyText(text: string) {
14+
if (navigator.clipboard?.writeText) {
15+
try {
16+
await navigator.clipboard.writeText(text);
17+
return;
18+
} catch {
19+
// Fall back to the legacy selection path below.
20+
}
21+
}
22+
1423
const textarea = document.createElement("textarea");
1524
textarea.value = text;
1625
textarea.setAttribute("readonly", "");
1726
textarea.style.position = "fixed";
1827
textarea.style.opacity = "0";
1928
document.body.appendChild(textarea);
2029
textarea.select();
21-
let copied = false;
2230

2331
try {
24-
copied = document.execCommand("copy");
32+
document.execCommand("copy");
2533
} catch {
26-
copied = false;
34+
// The visual confirmation is optimistic; copy failures are non-fatal here.
2735
}
2836

2937
document.body.removeChild(textarea);
30-
31-
if (!copied && navigator.clipboard?.writeText) {
32-
await navigator.clipboard.writeText(text).catch(() => undefined);
33-
}
3438
}
3539

3640
export function PromptCopyButton({ prompt, className }: PromptCopyButtonProps) {

landing/src/components/stack-support-section.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,12 @@ export function StackSupportSection() {
1616
to CI, hosted agents, React Native tooling, device infrastructure,
1717
and release process.
1818
</LeadText>
19-
<ButtonLink href="#demo" size="compact" variant="dark" className="mt-8">
19+
<ButtonLink
20+
href="https://www.callstack.com/contact?message=%22I%20want%20to%20chat%20about%20agent-device%22"
21+
size="compact"
22+
variant="dark"
23+
className="mt-8"
24+
>
2025
Book consultation
2126
</ButtonLink>
2227
</div>

landing/src/lib/og-image.tsx

Lines changed: 37 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
import { readFile } from "node:fs/promises";
2+
import { join } from "node:path";
3+
14
import { ImageResponse } from "next/og";
25

36
type OgImageOptions = {
@@ -13,7 +16,31 @@ export const ogImageSize = {
1316

1417
export const ogImageContentType = "image/png";
1518

16-
export function createOgImage({ eyebrow, title, description }: OgImageOptions) {
19+
const fontsDirectory = join(process.cwd(), "src", "app", "fonts");
20+
21+
async function getOgFonts() {
22+
const [regular, semiBold] = await Promise.all([
23+
readFile(join(fontsDirectory, "AllianceNo2-Regular.ttf")),
24+
readFile(join(fontsDirectory, "AllianceNo2-SemiBold.ttf")),
25+
]);
26+
27+
return [
28+
{
29+
data: regular,
30+
name: "Alliance No.2",
31+
style: "normal" as const,
32+
weight: 400 as const,
33+
},
34+
{
35+
data: semiBold,
36+
name: "Alliance No.2",
37+
style: "normal" as const,
38+
weight: 600 as const,
39+
},
40+
];
41+
}
42+
43+
export async function createOgImage({ eyebrow, title, description }: OgImageOptions) {
1744
return new ImageResponse(
1845
(
1946
<div
@@ -62,7 +89,7 @@ export function createOgImage({ eyebrow, title, description }: OgImageOptions) {
6289
<div
6390
style={{
6491
color: "rgba(255,255,255,0.52)",
65-
fontFamily: "monospace",
92+
fontFamily: "Alliance No.2",
6693
fontSize: 24,
6794
fontWeight: 700,
6895
letterSpacing: 0,
@@ -74,6 +101,7 @@ export function createOgImage({ eyebrow, title, description }: OgImageOptions) {
74101
<div
75102
style={{
76103
fontSize: 84,
104+
fontFamily: "Alliance No.2",
77105
fontWeight: 600,
78106
letterSpacing: 0,
79107
lineHeight: 0.98,
@@ -86,6 +114,7 @@ export function createOgImage({ eyebrow, title, description }: OgImageOptions) {
86114
<div
87115
style={{
88116
color: "rgba(255,255,255,0.72)",
117+
fontFamily: "Alliance No.2",
89118
fontSize: 30,
90119
lineHeight: 1.35,
91120
marginTop: 36,
@@ -107,6 +136,7 @@ export function createOgImage({ eyebrow, title, description }: OgImageOptions) {
107136
background: "#ffffff",
108137
borderRadius: 4,
109138
color: "#000000",
139+
fontFamily: "Alliance No.2",
110140
fontSize: 24,
111141
fontWeight: 700,
112142
padding: "18px 28px",
@@ -119,6 +149,7 @@ export function createOgImage({ eyebrow, title, description }: OgImageOptions) {
119149
border: "1px solid rgba(255,255,255,0.28)",
120150
borderRadius: 4,
121151
color: "rgba(255,255,255,0.84)",
152+
fontFamily: "Alliance No.2",
122153
fontSize: 24,
123154
fontWeight: 600,
124155
padding: "18px 28px",
@@ -130,6 +161,9 @@ export function createOgImage({ eyebrow, title, description }: OgImageOptions) {
130161
</div>
131162
</div>
132163
),
133-
ogImageSize,
164+
{
165+
...ogImageSize,
166+
fonts: await getOgFonts(),
167+
},
134168
);
135169
}

0 commit comments

Comments
 (0)