mirror of
https://github.com/morten-olsen/morten-olsen.github.io.git
synced 2026-02-08 01:46:28 +01:00
init
This commit is contained in:
committed by
Morten Olsen
parent
98e39a54cc
commit
ee37ac9d90
@@ -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 }
|
||||
|
||||
Reference in New Issue
Block a user