Skip to content

Collections Reference

lilypondLoader(), imported from astro-lilypond/loader, accepts the following options.

Type: string | URL
Required: yes

The directory pattern resolves from. Relative to the project root.

Type: string | string[]
Default: "**/*.{ly,ily,lilypond}"

Glob pattern(s) matching score files, relative to base.

Type: (options: { entry: string; base: URL; header: Record<string, string> }) => string
Default: the file’s path relative to base, with its extension stripped (e.g. preludes/prelude-1.ly becomes preludes/prelude-1).

Generates each entry’s collection id. header is the file’s parsed \header fields, so you can key ids off metadata instead of the file path if you’d like.

interface LilypondCollectionEntry {
source: string;
alt: string;
sourceName?: string;
includePaths: string[];
assetTitle: string;
meta: LilypondMetadata;
}