diff --git a/.gitignore b/.gitignore index 40ea020..2b7f3bd 100644 --- a/.gitignore +++ b/.gitignore @@ -31,6 +31,7 @@ npm-debug.log* yarn-debug.log* yarn-error.log* .pnpm-debug.log* +server.log # env files (can opt-in for committing if needed) .env* diff --git a/app/[...path]/SubpageGridView.tsx b/app/[...path]/SubpageGridView.tsx index 7b8d4eb..3de1d4d 100644 --- a/app/[...path]/SubpageGridView.tsx +++ b/app/[...path]/SubpageGridView.tsx @@ -17,46 +17,56 @@ interface Placeholder { interface SubpageGridViewProps { slug: string; + title?: string; + subtitle?: string; albums: SubpageAlbum[]; coverPlaceholders: (Placeholder | null)[]; } -export function SubpageGridView({ slug, albums, coverPlaceholders }: SubpageGridViewProps) { +export function SubpageGridView({ slug, title, subtitle, albums, coverPlaceholders }: SubpageGridViewProps) { return ( -
- {albums.map((album, i) => { - const ph = coverPlaceholders[i]; - return ( - - {album.albumThumbnailAssetId ? ( - {album.albumName} - ) : ( -
- )} - - {album.assetCount} {album.assetCount === 1 ? 'photo' : 'photos'} - -
- {album.albumName} - +
+ {(title || subtitle) && ( +
+ {title &&

{title}

} + {subtitle &&

{subtitle}

} +
+ )} +
+ {albums.map((album, i) => { + const ph = coverPlaceholders[i]; + return ( + + {album.albumThumbnailAssetId ? ( + {album.albumName} + ) : ( +
+ )} + {album.assetCount} {album.assetCount === 1 ? 'photo' : 'photos'} -
- - ); - })} +
+ {album.albumName} + + {album.assetCount} {album.assetCount === 1 ? 'photo' : 'photos'} + +
+ + ); + })} +
); } diff --git a/app/[...path]/page.tsx b/app/[...path]/page.tsx index 0ab8190..27c4456 100644 --- a/app/[...path]/page.tsx +++ b/app/[...path]/page.tsx @@ -222,6 +222,8 @@ export default async function PathPage({ params }: PathPageProps) { return ( diff --git a/content/gallery.yaml.example b/content/gallery.yaml.example index de0d89c..fca957a 100644 --- a/content/gallery.yaml.example +++ b/content/gallery.yaml.example @@ -18,6 +18,8 @@ subpages: - "album-uuid-3" - "album-uuid-4" "Projects": + title: "My Creative Projects" # Optional: Header title, defaults to Navigation key ("Projects") + subtitle: "A collection of 2026 highlights in 35mm film." # Optional: Sub-text for headers password: "your-password" # Optional protection albums: - "album-uuid-5" diff --git a/lib/config/index.ts b/lib/config/index.ts index 2f6b330..4a7d5d3 100644 --- a/lib/config/index.ts +++ b/lib/config/index.ts @@ -78,6 +78,8 @@ export function getConfig(): AppConfig { return { name: sp.name, slug: slugify(sp.name), + title: sp.title, + subtitle: sp.subtitle, albumIds: sp.albums.map((entry) => processAlbumEntry(entry, `subpage "${sp.name}"`)), password: sp.password, ...(sp.grid ? { @@ -95,12 +97,14 @@ export function getConfig(): AppConfig { if (Array.isArray(value)) { return { name, slug: slugify(name), albumIds: value.map((entry) => processAlbumEntry(entry, `subpage "${name}"`)) }; } - interface SubpageObjectValue { albums?: Array>; password?: string; grid?: { columns?: number; gap?: number; aspectRatio?: string; layout?: string; }; } + interface SubpageObjectValue { title?: string; subtitle?: string; albums?: Array>; password?: string; grid?: { columns?: number; gap?: number; aspectRatio?: string; layout?: string; }; } const sp = value as SubpageObjectValue; const albumEntries = sp.albums || []; return { name, slug: slugify(name), + title: sp.title, + subtitle: sp.subtitle, albumIds: albumEntries.map((entry) => processAlbumEntry(entry, `subpage "${name}"`)), password: sp.password, ...(sp.grid ? { diff --git a/lib/config/schema.ts b/lib/config/schema.ts index 327c82e..0888ea3 100644 --- a/lib/config/schema.ts +++ b/lib/config/schema.ts @@ -1,6 +1,8 @@ export interface SubpageConfig { name: string; slug: string; + title?: string; + subtitle?: string; albumIds: string[]; password?: string; grid?: Partial; @@ -79,6 +81,8 @@ export interface GalleryYaml { | Record>> | Array<{ name: string; + title?: string; + subtitle?: string; albums: Array>; password?: string; grid?: {