Expand DNDT, add TrackInline, more tracks

This commit is contained in:
2025-08-28 16:03:29 +09:30
parent ba8eec5879
commit ca15fa782d
19 changed files with 179 additions and 24 deletions

View File

@@ -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;
}