website/src/pages/songs/index.astro

17 lines
403 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';
2023-04-26 22:48:15 +02:00
import { ALBUMS, getAllCats } from "../../utils/songs";
2023-04-26 10:33:30 +02:00
const pages = [...getAllCats(await getCollection('songs'))]
.sort((a, b) => a < b ? 1 : -1)
2023-04-26 22:48:15 +02:00
.map(catalog => ({
title: `${catalog} - ${ALBUMS[catalog].title}`,
slug: `/songs/${catalog}/`
}));
2023-04-26 10:33:30 +02:00
---
2023-04-26 22:48:15 +02:00
<List title="Albums" pages={pages} />