This commit is contained in:
Morten Olsen
2024-04-19 20:51:52 +02:00
committed by Morten Olsen
parent 98e39a54cc
commit ee37ac9d90
51 changed files with 604 additions and 798 deletions

View File

@@ -1,13 +1,13 @@
import { getCollection } from 'astro:content';
import { getCollection } from 'astro:content'
class References {
public find = () => getCollection('references');
public find = () => getCollection('references')
public get = async (slug: string) => {
const collection = await this.find();
return collection.find((entry) => entry.slug === slug);
};
const collection = await this.find()
return collection.find((entry) => entry.slug === slug)
}
}
type Reference = Exclude<Awaited<ReturnType<References['get']>>, undefined>;
type Reference = Exclude<Awaited<ReturnType<References['get']>>, undefined>
export { References, type Reference };
export { References, type Reference }