From ec7f19d6a9c49c479afb06d8e22ece494a1b49fd Mon Sep 17 00:00:00 2001 From: thuanbui Date: Tue, 17 Mar 2026 12:44:19 +0900 Subject: [PATCH] fix: use relative path for heroImage --- src/components/widgets/Hero.astro | 12 +++++++----- src/pages/index.astro | 2 +- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/src/components/widgets/Hero.astro b/src/components/widgets/Hero.astro index c22883d..a1effcd 100644 --- a/src/components/widgets/Hero.astro +++ b/src/components/widgets/Hero.astro @@ -4,6 +4,7 @@ import type { HeroProps } from "@/types/types"; import Headline from "@/components/ui/Headline.astro"; import Button from "@/components/ui/Button.astro"; import { Icon } from "astro-icon/components"; +import { toR2Url } from "@/utils/r2"; const { title = await Astro.slots.render("title"), @@ -19,6 +20,7 @@ const { } = Astro.props as HeroProps; const { container: containerClassProp = "" } = classes; +const heroImage = toR2Url(bgImage); --- { - bgImage && ( + heroImage && ( ) } -
+
{ tagline && (
@@ -61,8 +63,8 @@ const { container: containerClassProp = "" } = classes; titleAs="h1" classes={{ container: "mb-0 max-w-none", - title: `text-5xl md:text-7xl font-extrabold tracking-tight mb-6 ${bgImage ? "text-white" : "text-foreground"}`, - subtitle: `max-w-2xl mx-auto text-xl mb-10 ${bgImage ? "text-white/80" : "text-muted-foreground"}`, + title: `text-5xl md:text-7xl font-extrabold tracking-tight mb-6 ${heroImage ? "text-white" : "text-foreground"}`, + subtitle: `max-w-2xl mx-auto text-xl mb-10 ${heroImage ? "text-white/80" : "text-muted-foreground"}`, }} /> ) diff --git a/src/pages/index.astro b/src/pages/index.astro index fd46618..aa60ff2 100644 --- a/src/pages/index.astro +++ b/src/pages/index.astro @@ -27,7 +27,7 @@ const secondRow = latestPosts.slice(2, 5); title={`You Only Live Once`} tagline="" description="" - bgImage="https://images.balodeplao.com/460cc863-81ff-44b4-811f-422558bd2078.jpg" + bgImage="/images/460cc863-81ff-44b4-811f-422558bd2078.jpg" />