diff options
| author | Ariel Costas Guerrero <ariel@costas.dev> | 2025-04-10 21:42:41 +0200 |
|---|---|---|
| committer | Ariel Costas Guerrero <ariel@costas.dev> | 2025-04-10 21:42:41 +0200 |
| commit | e3141794b95e534656427fadf0354435c62254d6 (patch) | |
| tree | 95788249ac51475aea45ad17d7157dffd1564e47 /src/layouts/HomePageLayout.astro | |
| parent | 3caee506c961ae0e78503164ed6a0f81db3c8c32 (diff) | |
Fix formatting
Diffstat (limited to 'src/layouts/HomePageLayout.astro')
| -rw-r--r-- | src/layouts/HomePageLayout.astro | 81 |
1 files changed, 39 insertions, 42 deletions
diff --git a/src/layouts/HomePageLayout.astro b/src/layouts/HomePageLayout.astro index 146eaec..0906a11 100644 --- a/src/layouts/HomePageLayout.astro +++ b/src/layouts/HomePageLayout.astro @@ -4,59 +4,56 @@ import Layout from "./Layout.astro"; import { useTranslations } from "../i18n"; const blogCollection = (await getCollection("blog")).sort((a, b) => { - return b.data.publishedAt.getTime() - a.data.publishedAt.getTime(); + return b.data.publishedAt.getTime() - a.data.publishedAt.getTime(); }); const t = useTranslations(Astro.currentLocale); const schema = { - "@context": "http://schema.org", - "@type": "WebSite", - id: "https://www.costas.dev/", - url: "https://www.costas.dev/", - headline: t.homePage.title, + "@context": "http://schema.org", + "@type": "WebSite", + id: "https://www.costas.dev/", + url: "https://www.costas.dev/", + headline: t.homePage.title, }; --- <Layout title={t.homePage.title} description={t.homePage.description}> - <script - is:inline - type="application/ld+json" - slot="head-jsonld" - set:html={JSON.stringify(schema)} - /> + <script + is:inline + type="application/ld+json" + slot="head-jsonld" + set:html={JSON.stringify(schema)} + /> - <h1>{t.homePage.title}</h1> - <p>{t.homePage.welcome}</p> + <h1>{t.homePage.title}</h1> + <p>{t.homePage.welcome}</p> - <h2>{t.homePage.whoAmI}</h2> - <p>{t.homePage.whoAmIDesc}</p> - <a href="/trajectory">{t.homePage.moreAboutMe}</a> + <h2>{t.homePage.whoAmI}</h2> + <p>{t.homePage.whoAmIDesc}</p> + <a href="/trajectory">{t.homePage.moreAboutMe}</a> - <h2>{t.homePage.whatIDo}</h2> - <p>{t.homePage.whatIDoDesc}</p> - <a href="/portfolio">{t.homePage.myPortfolio}</a> - - <h2>{t.homePage.latestBlogPosts}</h2> - <ul> - { - blogCollection.slice(0, 5).map((p) => { - const date = Intl.DateTimeFormat(Astro.currentLocale, { - day: "2-digit", - month: "short", - year: "numeric", - }).format(p.data.publishedAt); - return ( - <li> - <time datetime={p.data.publishedAt.toISOString()}> - {date} - </time> - <a href={`/blog/${p.id}`}>{p.data.title}</a> - </li> - ); - }) - } - </ul> - <a href="/blog">{t.homePage.viewAllPosts}</a> + <h2>{t.homePage.whatIDo}</h2> + <p>{t.homePage.whatIDoDesc}</p> + <a href="/portfolio">{t.homePage.myPortfolio}</a> + <h2>{t.homePage.latestBlogPosts}</h2> + <ul> + { + blogCollection.slice(0, 5).map((p) => { + const date = Intl.DateTimeFormat(Astro.currentLocale, { + day: "2-digit", + month: "short", + year: "numeric", + }).format(p.data.publishedAt); + return ( + <li> + <time datetime={p.data.publishedAt.toISOString()}>{date}</time> + <a href={`/blog/${p.id}`}>{p.data.title}</a> + </li> + ); + }) + } + </ul> + <a href="/blog">{t.homePage.viewAllPosts}</a> </Layout> |
