]> git.otsuka.systems Git - cotsuka.github.io/commitdiff
cold install faster than cache, svgs skip image processing
authorCameron Otsuka <cameron@otsuka.haus>
Wed, 26 Aug 2026 00:20:42 +0000 (17:20 -0700)
committerCameron Otsuka <cameron@otsuka.haus>
Wed, 26 Aug 2026 00:20:42 +0000 (17:20 -0700)
.github/workflows/deploy-to-ghpages.yml
astro.config.mjs
content/articles/r1-vs-o1-ai-as-commodity-or-moat/index.mdx
src/components/ui/figure.astro

index f33e408285eccf08302c68ec408be1ad5b4d3d99..784fafa8c8b8716476970b1ee3dd5596ec01511f 100644 (file)
@@ -24,10 +24,9 @@ jobs:
       - uses: actions/checkout@v7
       - uses: oven-sh/setup-bun@v2
       - name: Cache dependencies and build artifacts
-        uses: actions/cache@v4
+        uses: actions/cache@v5
         with:
           path: |
-            ~/.bun/install/cache
             node_modules/.astro
           key: ${{ runner.os }}-${{ hashFiles('bun.lock') }}-${{ hashFiles('public/**/*.{jpg,jpeg,png,webp,avif,svg,gif}', 'content/**/*.{jpg,jpeg,png,webp,avif,svg,gif}', 'src/assets/**/*.{jpg,jpeg,png,webp,avif,svg,gif,ico}') }}
           restore-keys: |
index 7131cc0e28654529cbaabcc7a79af27ee30feb44..429b4572522d01ca866357d7d5f1830eb5c3e194 100644 (file)
@@ -72,7 +72,6 @@ export default defineConfig({
         avif: { quality: 50, effort: 2 },
       },
     },
-    dangerouslyProcessSVG: true,
   },
   vite: {
     build: {
index 0af55f45e3427bc3f19421712238b6436695cdcd..4063aa6931e7e7eb8731a285670ac8f70ce72711 100644 (file)
@@ -56,11 +56,7 @@ Despite less capital expenditure, R1 has comparable performance to o1 due to sev
 
 This is incredible for the little guy: run your own model, privately, without the need for massive infrastructure.
 
-<Figure
-  image={r1OniPhone}
-  alt="R1 running locally on an iPhone"
-  formats={['webp']}
->
+<Figure image={r1OniPhone} alt="R1 running locally on an iPhone" plain>
   A distilled version of R1 running locally on an iPhone. Source:
   [@localghost](https://x.com/localghost/status/1882109711732154387).
 </Figure>
index 3b5c6fef0fcb859aac6346f09d44c517cb587c79..3bcb479f9eb8f7c0ffe89209e7eda4fdce687d14 100644 (file)
@@ -7,19 +7,40 @@ interface Props {
   alt: string;
   formats?: string[];
   layout?: 'constrained' | 'full-width' | 'fixed' | 'none';
+  /** Serve the image as-is (no variants). Required for animated images
+   *  and recommended for SVGs, which are already resolution-independent. */
+  plain?: boolean;
 }
 
-const { image, alt, formats = ['webp'], layout } = Astro.props;
+const { image, alt, formats = ['webp'], layout, plain = false } = Astro.props;
+
+// SVGs are vector-based: generating per-breakpoint raster-style copies
+// multiplies the shipped bytes with no visual gain. Animated images
+// cannot be resized by the image service and balloon into huge
+// lossless fallbacks. Both are served as-is.
+const isSvg = image.src?.endsWith('.svg');
+const serveAsIs = plain || isSvg;
 ---
 
 <figure>
-  <Picture
-    src={image}
-    alt={alt}
-    formats={formats}
-    layout={layout}
-    data-pagefind-index-attrs="alt"
-  />
+  {
+    serveAsIs ? (
+      <img
+        src={image.src}
+        alt={alt}
+        data-pagefind-index-attrs="alt"
+        loading="lazy"
+      />
+    ) : (
+      <Picture
+        src={image}
+        alt={alt}
+        formats={formats}
+        layout={layout}
+        data-pagefind-index-attrs="alt"
+      />
+    )
+  }
   <figcaption><slot /></figcaption>
 </figure>