diff --git a/src/pages/blog/index.astro b/src/pages/blog/index.astro index 886af7a..5696566 100644 --- a/src/pages/blog/index.astro +++ b/src/pages/blog/index.astro @@ -2,13 +2,14 @@ import { getCollection } from 'astro:content'; import FormattedDate from '../../components/FormattedDate.astro'; import SectionContainer from '../../components/SectionContainer.astro'; +import BaseHead from '../../components/BaseHead.astro'; const posts = (await getCollection('blog')).sort( (a, b) => b.data.pubDate.valueOf() - a.data.pubDate.valueOf() ); // Group posts by year -const postsByYear = posts.reduce((acc, post) => { +const postsByYear = posts.reduce((acc:any, post) => { const year = new Date(post.data.pubDate).getFullYear(); if (!acc[year]) { acc[year] = []; @@ -18,17 +19,18 @@ const postsByYear = posts.reduce((acc, post) => { }, {}); // Sort the years -const sortedYears = Object.keys(postsByYear).sort((a, b) => b - a); +const sortedYears = Object.keys(postsByYear).sort((a:any, b:any) => b - a); ---

Blog posts

+ 💥 Subscribe via RSS {sortedYears.map(year => (
{year}