diff --git a/src/components/blog/Hero.astro b/src/components/blog/Hero.astro index 7152e58..d51093d 100644 --- a/src/components/blog/Hero.astro +++ b/src/components/blog/Hero.astro @@ -4,17 +4,14 @@ import LastPost from "../blog/LastPost.astro"; import Languages from "../blog/Languages.astro"; import { Icon } from "astro-icon/components"; import Heading from "../ui/Heading.astro"; +import { AstroError } from "astro/errors"; +import { getCollection} from "astro:content"; -const { - profileImage = "/images/efeeleprofile.webp", - profileAlt = "Photo of Fernando Aldair L贸pez Ponce (EFEELE) for the blog", - profileLink = "/about-me", - profileTitle = "FrontEnd Developer", - profileName = "Fernando Aldair L贸pez Ponce", - githubLink = "https://github.com/EFEELE/NeonMint", - githubText = "Do you like this blog's design?", - techsTitle = "TECHS" -} = Astro.props; +const [staticData] = await getCollection('staticData'); + +if (!staticData) { + throw new AstroError("JSON data not found"); +} ---
@@ -24,7 +21,7 @@ const {
- +
@@ -39,13 +36,13 @@ const {
- +
@@ -83,15 +80,15 @@ const { class="font-extrabold text-lg max-xl:text-base max-lg:text-sm max-lg:flex max-lg:flex-col-reverse max-md:flex-row leading-normal max-sm:leading-none" >{profileTitle}{staticData.data.profileTitle} 馃殌
diff --git a/src/components/portfolio/HeroIndex.astro b/src/components/portfolio/HeroIndex.astro index 90f07a9..d7ee1dd 100644 --- a/src/components/portfolio/HeroIndex.astro +++ b/src/components/portfolio/HeroIndex.astro @@ -4,18 +4,14 @@ import Heading from "../ui/Heading.astro"; import Tools from "../portfolio/Tools.astro"; import { Icon } from "astro-icon/components"; import Hobbies from "../portfolio/Hobbies.astro"; +import { AstroError } from "astro/errors"; +import { getCollection} from "astro:content"; -const { - profileImage = "/images/efeeleprofile.webp", - profileAlt = "Photo of Fernando Aldair L贸pez Ponce (EFEELE) for the blog", - profileLink = "/about-me", - profileTitle = "FrontEnd Developer", - profileName = "Fernando L贸pez", - githubLink = "https://github.com/EFEELE/NeonMint", - githubText = "Do you like this blog's design?", - portfolioImage = "/images/portfolio.webp", - email = "hello@efeele.dev", -} = Astro.props;; +const [staticData] = await getCollection('staticData'); + +if (!staticData) { + throw new AstroError("JSON data not found"); +} ---
@@ -67,14 +63,14 @@ const {

- {profileName} 馃憢 + {staticData.data.profileName} 馃憢

{profileTitle}{staticData.data.profileTitle} with 8 years of experience