Expand DNDT, add TrackInline, more tracks
This commit is contained in:
@@ -1,9 +1,11 @@
|
||||
import type { ImageMetadata } from "astro";
|
||||
import { getImage } from "astro:assets";
|
||||
|
||||
import type { CollectionEntry } from "astro:content";
|
||||
import { getCollection, type CollectionEntry } from "astro:content";
|
||||
type Project = CollectionEntry<"projects">;
|
||||
|
||||
const tracks = await getCollection("tracks");
|
||||
|
||||
const allProjectOtherImages = import.meta.glob<{ default: ImageMetadata }>(
|
||||
"/src/assets/img/projects/**/*",
|
||||
{ eager: true }
|
||||
@@ -137,3 +139,13 @@ export function slugify(input: string): string {
|
||||
slug = slug.replace(/^-+|-+$/g, "");
|
||||
return slug;
|
||||
}
|
||||
|
||||
export function getTrackByID(id: string): CollectionEntry<"tracks"> | null {
|
||||
for (const track of tracks) {
|
||||
if (track.id === id) {
|
||||
return track;
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
Reference in New Issue
Block a user