chore: remove junk

This commit is contained in:
enscribe 2024-09-10 10:36:58 -07:00
parent f6dcc302d4
commit 8f6872f739
No known key found for this signature in database
GPG key ID: 9BBD5C4114E25322
96 changed files with 1002 additions and 2485 deletions

View file

@ -1,28 +1,28 @@
---
import { type CollectionEntry, getCollection } from "astro:content";
import Layout from "@layouts/Layout.astro";
import Container from "@components/Container.astro";
import ArrowCard from "@components/ArrowCard.astro";
import { BLOG } from "@consts";
import { type CollectionEntry, getCollection } from 'astro:content'
import Layout from '@layouts/Layout.astro'
import Container from '@components/Container.astro'
import ArrowCard from '@components/ArrowCard.astro'
import { BLOG } from '@consts'
const data = (await getCollection("blog"))
const data = (await getCollection('blog'))
.filter((post) => !post.data.draft)
.sort((a, b) => b.data.date.valueOf() - a.data.date.valueOf());
.sort((a, b) => b.data.date.valueOf() - a.data.date.valueOf())
type Acc = {
[year: string]: CollectionEntry<"blog">[];
};
[year: string]: CollectionEntry<'blog'>[]
}
const posts = data.reduce((acc: Acc, post) => {
const year = post.data.date.getFullYear().toString();
const year = post.data.date.getFullYear().toString()
if (!acc[year]) {
acc[year] = [];
acc[year] = []
}
acc[year].push(post);
return acc;
}, {});
acc[year].push(post)
return acc
}, {})
const years = Object.keys(posts).sort((a, b) => parseInt(b) - parseInt(a));
const years = Object.keys(posts).sort((a, b) => parseInt(b) - parseInt(a))
---
<Layout title={BLOG.TITLE} description={BLOG.DESCRIPTION}>