website/src/pages/songs/index.astro

15 lines
328 B
Plaintext
Raw Normal View History

2023-04-26 10:33:30 +02:00
---
import List from "../../layouts/List.astro";
import { getCollection } from 'astro:content';
const posts = (await getCollection('songs'))
.sort((a, b) => a.data.date < b.data.date ? 1 : -1)
.map(entry => ({
title: entry.data.title,
slug: `/songs/${entry.slug}/`,
}))
---
<List title="Posts" pages={posts} />