History

Marketing: serve as build asssets (#1088)

The deploy pipeline does not pick up newly added /public files, so the svgl brand logos and the Backed by Y Combinator badge 404'd in production while the page HTML and _astro chunks served fine. Move the SVGs into src/assets and import them through Vite: the small logos inline as data URIs in the HTML/JS, and the larger badge emits as a hashed /_astro asset. Both serve.

Rhys Sullivan committed 4 months ago

Commit 395ba971 parent ae3a16215 files · +47 −18Browse files

Unified · Split

15 files
  1. apps/marketing/src/assets/logos/claude.svg +0 −0
  2. apps/marketing/src/assets/logos/codex.svg +0 −0
  3. apps/marketing/src/assets/logos/cursor.svg +0 −0
  4. apps/marketing/src/assets/logos/github.svg +0 −0
  5. apps/marketing/src/assets/logos/gmail.svg +0 −0
  6. apps/marketing/src/assets/logos/jira.svg +0 −0
  7. apps/marketing/src/assets/logos/linear.svg +0 −0
  8. apps/marketing/src/assets/logos/notion.svg +0 −0
  9. apps/marketing/src/assets/logos/sentry.svg +0 −0
  10. apps/marketing/src/assets/logos/slack.svg +0 −0
  11. apps/marketing/src/assets/logos/stripe.svg +0 −0
  12. apps/marketing/src/assets/yc-backed-by.svg +0 −0
  13. apps/marketing/src/components/animated-beam-demo.tsx +15 −6
  14. apps/marketing/src/components/context-bloat-demo.tsx +28 −11
  15. apps/marketing/src/pages/index.astro +4 −1
apps/marketing/src/assets/logos/claude.svgrenamed from apps/marketing/public/logos/claude.svg+0−0

File renamed without changes.

apps/marketing/src/assets/logos/codex.svgrenamed from apps/marketing/public/logos/codex.svg+0−0

File renamed without changes.

apps/marketing/src/assets/logos/cursor.svgrenamed from apps/marketing/public/logos/cursor.svg+0−0

File renamed without changes.

apps/marketing/src/assets/logos/github.svgrenamed from apps/marketing/public/logos/github.svg+0−0

File renamed without changes.

apps/marketing/src/assets/logos/gmail.svgrenamed from apps/marketing/public/logos/gmail.svg+0−0

File renamed without changes.

apps/marketing/src/assets/logos/jira.svgrenamed from apps/marketing/public/logos/jira.svg+0−0

File renamed without changes.

apps/marketing/src/assets/logos/linear.svgrenamed from apps/marketing/public/logos/linear.svg+0−0

File renamed without changes.

apps/marketing/src/assets/logos/notion.svgrenamed from apps/marketing/public/logos/notion.svg+0−0

File renamed without changes.

apps/marketing/src/assets/logos/sentry.svgrenamed from apps/marketing/public/logos/sentry.svg+0−0

File renamed without changes.

apps/marketing/src/assets/logos/slack.svgrenamed from apps/marketing/public/logos/slack.svg+0−0

File renamed without changes.

apps/marketing/src/assets/logos/stripe.svgrenamed from apps/marketing/public/logos/stripe.svg+0−0

File renamed without changes.

apps/marketing/src/assets/yc-backed-by.svgrenamed from apps/marketing/public/yc-backed-by.svg+0−0

File renamed without changes.

apps/marketing/src/components/animated-beam-demo.tsx+15−6
@@ -5,6 +5,15 @@ import React, { forwardRef, useRef } from "react"; · 4 unmodified lines
55 import { cn } from "../lib/utils";
66 import { AnimatedBeam } from "./ui/animated-beam";
77
8+// Imported so Vite emits them as hashed build assets (served from /_astro/...);
9+// the deploy pipeline does not pick up newly added /public files.
10+import sentryLogo from "../assets/logos/sentry.svg?url";
11+import githubLogo from "../assets/logos/github.svg?url";
12+import linearLogo from "../assets/logos/linear.svg?url";
13+import claudeLogo from "../assets/logos/claude.svg?url";
14+import cursorLogo from "../assets/logos/cursor.svg?url";
15+import codexLogo from "../assets/logos/codex.svg?url";
16+
817 type Variant = "blueprint" | "brutalist" | "pastel" | "cyber" | "editorial" | "stripe";
918
1019 const variantStyles: Record<
@@ -342,10 +351,10 @@ const logoIcon = (src: string) => () => ( · 331 unmodified lines
342351 );
343352
344353 const Icons = {
345− sentry: logoIcon("/logos/sentry.svg"),
346− github: logoIcon("/logos/github.svg"),
347− linear: logoIcon("/logos/linear.svg"),
348− claude: logoIcon("/logos/claude.svg"),
349− cursor: logoIcon("/logos/cursor.svg"),
350− codex: logoIcon("/logos/codex.svg"),
354+ sentry: logoIcon(sentryLogo),
355+ github: logoIcon(githubLogo),
356+ linear: logoIcon(linearLogo),
357+ claude: logoIcon(claudeLogo),
358+ cursor: logoIcon(cursorLogo),
359+ codex: logoIcon(codexLogo),
351360 };
apps/marketing/src/components/context-bloat-demo.tsx+28−11
@@ -6,6 +6,29 @@ · 5 unmodified lines
66
77 import React, { useEffect, useRef, useState } from "react";
88
9+// Brand logos are imported so Vite emits them as hashed build assets (served
10+// from /_astro/...) instead of relying on /public, which the deploy pipeline
11+// does not pick up for newly added files.
12+import githubLogo from "../assets/logos/github.svg?url";
13+import stripeLogo from "../assets/logos/stripe.svg?url";
14+import jiraLogo from "../assets/logos/jira.svg?url";
15+import sentryLogo from "../assets/logos/sentry.svg?url";
16+import linearLogo from "../assets/logos/linear.svg?url";
17+import gmailLogo from "../assets/logos/gmail.svg?url";
18+import notionLogo from "../assets/logos/notion.svg?url";
19+import slackLogo from "../assets/logos/slack.svg?url";
20+
21+const LOGOS: Record<string, string> = {
22+ github: githubLogo,
23+ stripe: stripeLogo,
24+ jira: jiraLogo,
25+ sentry: sentryLogo,
26+ linear: linearLogo,
27+ gmail: gmailLogo,
28+ notion: notionLogo,
29+ slack: slackLogo,
30+};
31+
932 /**
1033 * Interactive "no context bloat" demo, laid out like Effect's "Production-grade
1134 * TypeScript" section: a complexity gauge + service checklist on top, then two
@@ -216,19 +239,13 @@ function useAnimatedNumber(target: number): number { · 204 unmodified lines
216239 return display;
217240 }
218241
219−// Brand logos live in /public/logos as full-color svgl.app assets, rendered as
220−// <img> so each keeps its own colors. svgl has no Jira icon, so /logos/jira.svg
221−// is the Jira mark in Jira blue.
242+// Full-color svgl.app brand marks, rendered as <img> so each keeps its own
243+// colors. svgl has no Jira icon, so jira.svg is the Jira mark in Jira blue.
222244 function IntegrationIcon({ slug }: { readonly slug: string }) {
245+ const src = LOGOS[slug];
246+ if (!src) return null;
223247 return (
224− <img
225− src={`/logos/${slug}.svg`}
226− alt=""
227− width={15}
228− height={15}
229− loading="lazy"
230− style={{ objectFit: "contain" }}
231− />
248+ <img src={src} alt="" width={15} height={15} loading="lazy" style={{ objectFit: "contain" }} />
232249 );
233250 }
234251
apps/marketing/src/pages/index.astro+4−1
@@ -3,6 +3,9 @@ import Layout from "../layouts/Layout.astro"; · 2 unmodified lines
33 import { AnimatedBeamDemo } from "../components/animated-beam-demo";
44 import { ContextBloatDemo } from "../components/context-bloat-demo";
55 import { SelfHostContactModal } from "../components/self-host-contact-modal";
6+// Imported so Vite emits it as a hashed build asset (served from /_astro/...);
7+// the deploy pipeline does not pick up newly added /public files.
8+import ycBackedBy from "../assets/yc-backed-by.svg?url";
69
710 const GH = "https://github.com/RhysSullivan/executor";
811
@@ -162,7 +165,7 @@ Source (and the place to start if something breaks): https://github.com/RhysSull · 153 unmodified lines
162165 aria-label="Backed by Y Combinator"
163166 >
164167 <img
165− src="/yc-backed-by.svg"
168+ src={ycBackedBy}
166169 alt="Backed by Y Combinator"
167170 width="140"
168171 height="52"