diff --git a/personal/src/components/BlogEntryList.astro b/personal/src/components/BlogEntryList.astro new file mode 100644 index 0000000..21afd24 --- /dev/null +++ b/personal/src/components/BlogEntryList.astro @@ -0,0 +1,46 @@ +--- +import { getCollection } from "astro:content"; +import { Image } from "astro:assets"; +const allPosts = await getCollection("blog"); + +const dateOptions: object = { + year: "numeric", + month: "long", + day: "numeric", +}; + +const { limit } = Astro.props; +--- + +
+ { + allPosts + .sort((a, b) => { + return a.data.pubDate > b.data.pubDate ? -1 : 1; + }) + .slice(0, limit) + .map((post) => ( + + {post.data.image ? ( + {post.data.image.alt} + ) : null} +

+ {post.data.title}
+ +

+

{post.data.description}

+
+ )) + } +
diff --git a/personal/src/components/MatomoTracking.astro b/personal/src/components/MatomoTracking.astro new file mode 100644 index 0000000..ca212ac --- /dev/null +++ b/personal/src/components/MatomoTracking.astro @@ -0,0 +1,20 @@ +--- + +--- + + diff --git a/personal/src/layouts/Layout.astro b/personal/src/layouts/Layout.astro index f5c64a4..e34b502 100644 --- a/personal/src/layouts/Layout.astro +++ b/personal/src/layouts/Layout.astro @@ -10,6 +10,7 @@ import "../styles/fonts/mona-sans.css"; import Nav from "../components/Nav.astro"; import ColorSchemeToggle from "../components/ColorSchemeToggle.astro"; +import MatomoTracking from "../components/MatomoTracking.astro"; --- @@ -45,21 +46,6 @@ import ColorSchemeToggle from "../components/ColorSchemeToggle.astro";