website/src/pages/songs/index.astro

14 lines
352 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';
import { 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)
.map(catalog => ({ title: catalog, slug: `/songs/${catalog}/` }));
2023-04-26 10:33:30 +02:00
---
<List title="Songs" pages={pages} />