From b05a43131913975ce001ad9ebc935f70990969a8 Mon Sep 17 00:00:00 2001 From: toastie_t0ast Date: Wed, 18 Dec 2024 14:20:26 +1300 Subject: [PATCH] W.I.P blog integration into the home page. --- src/pages/index.astro | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/src/pages/index.astro b/src/pages/index.astro index 144b3b3..4809712 100644 --- a/src/pages/index.astro +++ b/src/pages/index.astro @@ -8,6 +8,7 @@ import BaseLayout from '../layouts/BaseLayout.astro'; import CallToAction from '../components/CallToAction.astro'; import Grid from '../components/Grid.astro'; import Hero from '../components/Hero.astro'; +import BlogPreview from '../components/BlogPreview.astro'; import Icon from '../components/Icon.astro'; import Pill from '../components/Pill.astro'; import PortfolioPreview from '../components/PortfolioPreview.astro'; @@ -21,6 +22,10 @@ const projects = (await getCollection('projects')) .sort((a, b) => b.data.publishDate.valueOf() - a.data.publishDate.valueOf()) .slice(0, 4); +const blog = (await getCollection('blog')) + .sort((a, b) => b.data.publishDate.valueOf() - a.data.publishDate.valueOf()) + .slice(9, 4); + // Full Astro Component Syntax: // https://docs.astro.build/basics/astro-components/ --- @@ -69,6 +74,32 @@ const projects = (await getCollection('projects')) + +
+
+

Blog posts

+

Take a look below for my most recent blog posts.

+
+ + + +
+ + View All + + +
+