2026-03-08 18:55:45 +01:00
|
|
|
import Link from 'next/link';
|
|
|
|
|
import Image from 'next/image';
|
|
|
|
|
import { imageUrl } from '@/lib/urls';
|
2026-03-08 23:52:23 +01:00
|
|
|
import { SubpageSectionConfig } from '@/lib/config';
|
2026-03-08 18:55:45 +01:00
|
|
|
|
|
|
|
|
interface SubpageAlbum {
|
2026-03-12 11:30:45 +00:00
|
|
|
id: string;
|
|
|
|
|
slug: string;
|
|
|
|
|
albumName: string;
|
|
|
|
|
assetCount: number;
|
|
|
|
|
albumThumbnailAssetId: string | null;
|
experimental: portfolio features (justified layout, unlisted pages, captions, per-album grid, focal point, nav links, cover hero) (#431)
## Was ist das?
Sieben neue Portfolio-Features, alle als **experimental** gekennzeichnet
— in YAML-Kommentaren, Admin-Panel-Labels und Commit-Scopes, damit sie
einzeln nachvollziehbar und revertierbar bleiben.
## Features (je ein Commit)
| Commit | Feature |
| --- | --- |
| `justified rows gallery layout` | Neues Grid-Layout `justified`:
zeilenbasiert, gleiche Höhen, volle Breite — Flexbox ohne JS-Messung,
letzte Zeile bleibt natürlich klein |
| `hide subpages from navigation` | `hidden: true`: Seite aus
Nav/Homepage raus, per Direktlink erreichbar — im Gegensatz zu `enabled:
false` (404) |
| `lightbox captions` | Immich-Asset-Description als Bildunterschrift im
Info-Panel; EXIF-Route liefert bei `exifOnHover: false` jetzt nur noch
die Caption statt 403 |
| `per-album grid overrides` | `grid:` pro Album-Eintrag, Präzedenz
global < Subpage < Album |
| `per-album cover focal point` | `coverPosition:` → `object-position`
auf Cover-Karten, strikt validiert |
| `external links in header navigation` | `navLinks:` in settings.yaml,
nur http(s), sanitisiert |
| `cover splash hero style` | `heroStyle: cover`: Fullscreen-Splash mit
Enter-Link ins Portfolio |
Alle Optionen sind im Admin-Panel editierbar (PageBuilder /
SettingsEditor).
## Tests
- 356 Unit-Tests grün (13 neue: deriveGallery hidden/grid/coverPosition,
sanitizeNavLinks, EXIF-Route-Captions, justified-Layout-Validierung)
- `npx tsc --noEmit`: 0 Fehler
- `npm run build`: sauber
- Justified-Zeilenmathematik und Cover-Splash per Browser-Harness
visuell/numerisch verifiziert (volle Zeilen enden exakt an der
Containerkante, letzte Zeile bleibt natürlich)
---------
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: ralksta <ralksta@users.noreply.github.com>
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: lancetm714 <108419425+lancetm714@users.noreply.github.com>
2026-08-14 17:56:22 +02:00
|
|
|
/** EXPERIMENTAL: focal point for the cover crop (CSS object-position) */
|
|
|
|
|
coverPosition?: string;
|
2026-03-08 18:55:45 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
interface Placeholder {
|
2026-03-12 11:30:45 +00:00
|
|
|
blurDataURL?: string;
|
|
|
|
|
dominantColor?: string;
|
2026-03-08 18:55:45 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
interface SubpageGridViewProps {
|
2026-03-12 11:30:45 +00:00
|
|
|
slug: string;
|
|
|
|
|
title?: string;
|
|
|
|
|
subtitle?: string;
|
|
|
|
|
albums: SubpageAlbum[];
|
|
|
|
|
coverPlaceholders: (Placeholder | null)[];
|
|
|
|
|
sections?: SubpageSectionConfig[];
|
chore(release): v0.10.0 (#400)
Photo Essay mode, client proofing, studio-modern preset, admin panel overhaul, watermark, cookieless analytics, subpage toggle, SEO title templates. Analytics API now admin-only, Trivy scan on publish. Album order mirrors the Immich timeline; map theme, admin status panel, lightbox counter and Docker health check fixed.
See CHANGELOG.md for the full list and the health-check upgrade note.
2026-08-10 09:56:20 +02:00
|
|
|
/** 1-based position among all subpages — feeds the "03 — Collection" kicker. */
|
|
|
|
|
index?: number;
|
2026-03-08 18:55:45 +01:00
|
|
|
}
|
|
|
|
|
|
chore(release): v0.10.0 (#400)
Photo Essay mode, client proofing, studio-modern preset, admin panel overhaul, watermark, cookieless analytics, subpage toggle, SEO title templates. Analytics API now admin-only, Trivy scan on publish. Album order mirrors the Immich timeline; map theme, admin status panel, lightbox counter and Docker health check fixed.
See CHANGELOG.md for the full list and the health-check upgrade note.
2026-08-10 09:56:20 +02:00
|
|
|
const pad2 = (n: number) => String(n).padStart(2, '0');
|
|
|
|
|
const photoCount = (n: number) => `${n} ${n === 1 ? 'photo' : 'photos'}`;
|
|
|
|
|
|
2026-03-08 23:52:23 +01:00
|
|
|
function AlbumGrid({
|
2026-03-12 11:30:45 +00:00
|
|
|
albums,
|
|
|
|
|
placeholderMap,
|
|
|
|
|
slug,
|
2026-03-08 23:52:23 +01:00
|
|
|
}: {
|
2026-03-12 11:30:45 +00:00
|
|
|
albums: SubpageAlbum[];
|
|
|
|
|
placeholderMap: Map<string, Placeholder | null>;
|
|
|
|
|
slug: string;
|
2026-03-08 23:52:23 +01:00
|
|
|
}) {
|
2026-03-12 11:30:45 +00:00
|
|
|
return (
|
|
|
|
|
<div className="subpage-grid">
|
chore(release): v0.10.0 (#400)
Photo Essay mode, client proofing, studio-modern preset, admin panel overhaul, watermark, cookieless analytics, subpage toggle, SEO title templates. Analytics API now admin-only, Trivy scan on publish. Album order mirrors the Immich timeline; map theme, admin status panel, lightbox counter and Docker health check fixed.
See CHANGELOG.md for the full list and the health-check upgrade note.
2026-08-10 09:56:20 +02:00
|
|
|
{albums.map((album, i) => {
|
2026-03-12 11:30:45 +00:00
|
|
|
const ph = placeholderMap.get(album.id) ?? null;
|
|
|
|
|
return (
|
|
|
|
|
<Link
|
|
|
|
|
key={album.id}
|
|
|
|
|
href={`/${slug}/${album.slug}`}
|
|
|
|
|
className="subpage-grid__item"
|
|
|
|
|
style={ph?.dominantColor ? { backgroundColor: ph.dominantColor } : undefined}
|
chore(release): v0.10.0 (#400)
Photo Essay mode, client proofing, studio-modern preset, admin panel overhaul, watermark, cookieless analytics, subpage toggle, SEO title templates. Analytics API now admin-only, Trivy scan on publish. Album order mirrors the Immich timeline; map theme, admin status panel, lightbox counter and Docker health check fixed.
See CHANGELOG.md for the full list and the health-check upgrade note.
2026-08-10 09:56:20 +02:00
|
|
|
aria-label={`${album.albumName}, ${photoCount(album.assetCount)}`}
|
2026-03-12 11:30:45 +00:00
|
|
|
>
|
chore(release): v0.10.0 (#400)
Photo Essay mode, client proofing, studio-modern preset, admin panel overhaul, watermark, cookieless analytics, subpage toggle, SEO title templates. Analytics API now admin-only, Trivy scan on publish. Album order mirrors the Immich timeline; map theme, admin status panel, lightbox counter and Docker health check fixed.
See CHANGELOG.md for the full list and the health-check upgrade note.
2026-08-10 09:56:20 +02:00
|
|
|
<span className="subpage-grid__item-media">
|
|
|
|
|
{album.albumThumbnailAssetId ? (
|
|
|
|
|
<Image
|
|
|
|
|
src={imageUrl(album.albumThumbnailAssetId, 'preview')}
|
|
|
|
|
alt=""
|
|
|
|
|
fill
|
|
|
|
|
sizes="(max-width: 600px) 100vw, (max-width: 1000px) 50vw, 33vw"
|
|
|
|
|
loading="lazy"
|
release: v0.11.0 (#459)
Ships `dev` as **v0.11.0**. `main` contains nothing that `dev` does not,
so this is a clean sync.
## Headline changes since v0.10.0
- **Journal & Journal Studio** — photo essays at `/journal`,
split-screen block editor with live preview, drafts, per-entry
passwords, cover images
- **First-run setup wizard at `/install`** — configure a fresh
deployment from the browser; credentials are verified against Immich
before anything is written, and the wizard is gated by a one-time token
- **About page editor and toggle** in the admin panel
- **Per-album photo order** independent of Immich, with a drag & drop
editor
- **Custom favicon upload**
- **Experimental portfolio features** — justified grid, `cover` hero,
unlisted subpages, per-album grid overrides, cover focal points,
external nav links
- **Security** — asset tokens length-capped before decoding (#423),
journal author markdown escaped rather than filtered, journal file paths
contained, admin session key derived with scrypt (#432), Next.js 16.3.0
for CVE-2025-13465
- **Fixed** — client proofing honours its own configuration again
(#454); journal photo rendering (#432)
Full detail in [CHANGELOG.md](CHANGELOG.md#0110--2026-08-15).
## Verified
`npx tsc --noEmit` clean · `npx vitest run` 435 tests pass · `npm run
build` succeeds · lint 0 errors · `prettier --check` clean · local
`docker build` of the release tree.
## After merge
Tag `v0.11.0` on `main` and publish the release — that triggers
`docker-publish.yml`, which pushes the image and moves `latest`.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
---------
Co-authored-by: ralksta <ralksta@users.noreply.github.com>
Co-authored-by: lancetm714 <108419425+lancetm714@users.noreply.github.com>
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
2026-08-15 09:09:18 +02:00
|
|
|
{...(album.coverPosition
|
|
|
|
|
? { style: { objectPosition: album.coverPosition } }
|
|
|
|
|
: {})}
|
chore(release): v0.10.0 (#400)
Photo Essay mode, client proofing, studio-modern preset, admin panel overhaul, watermark, cookieless analytics, subpage toggle, SEO title templates. Analytics API now admin-only, Trivy scan on publish. Album order mirrors the Immich timeline; map theme, admin status panel, lightbox counter and Docker health check fixed.
See CHANGELOG.md for the full list and the health-check upgrade note.
2026-08-10 09:56:20 +02:00
|
|
|
{...(ph ? { placeholder: 'blur' as const, blurDataURL: ph.blurDataURL } : {})}
|
|
|
|
|
/>
|
|
|
|
|
) : (
|
|
|
|
|
<span
|
|
|
|
|
className="skeleton"
|
|
|
|
|
style={{ display: 'block', width: '100%', height: '100%' }}
|
|
|
|
|
aria-hidden="true"
|
|
|
|
|
/>
|
|
|
|
|
)}
|
|
|
|
|
<span className="subpage-grid__item-badge" aria-hidden="true">
|
|
|
|
|
{photoCount(album.assetCount)}
|
|
|
|
|
</span>
|
|
|
|
|
<span className="subpage-grid__item-overlay" aria-hidden="true">
|
|
|
|
|
<span className="subpage-grid__item-title">{album.albumName}</span>
|
|
|
|
|
<span className="subpage-grid__item-count">{photoCount(album.assetCount)}</span>
|
|
|
|
|
</span>
|
2026-03-12 11:30:45 +00:00
|
|
|
</span>
|
chore(release): v0.10.0 (#400)
Photo Essay mode, client proofing, studio-modern preset, admin panel overhaul, watermark, cookieless analytics, subpage toggle, SEO title templates. Analytics API now admin-only, Trivy scan on publish. Album order mirrors the Immich timeline; map theme, admin status panel, lightbox counter and Docker health check fixed.
See CHANGELOG.md for the full list and the health-check upgrade note.
2026-08-10 09:56:20 +02:00
|
|
|
|
|
|
|
|
{/* Always-visible caption bar — shown by presets that use it. */}
|
|
|
|
|
<span className="subpage-grid__item-caption" aria-hidden="true">
|
|
|
|
|
<span className="subpage-grid__item-index">{pad2(i + 1)}</span>
|
|
|
|
|
<span className="subpage-grid__item-caption-title">{album.albumName}</span>
|
|
|
|
|
<span className="subpage-grid__item-caption-count">
|
|
|
|
|
{photoCount(album.assetCount)}
|
2026-03-12 11:30:45 +00:00
|
|
|
</span>
|
chore(release): v0.10.0 (#400)
Photo Essay mode, client proofing, studio-modern preset, admin panel overhaul, watermark, cookieless analytics, subpage toggle, SEO title templates. Analytics API now admin-only, Trivy scan on publish. Album order mirrors the Immich timeline; map theme, admin status panel, lightbox counter and Docker health check fixed.
See CHANGELOG.md for the full list and the health-check upgrade note.
2026-08-10 09:56:20 +02:00
|
|
|
</span>
|
2026-03-12 11:30:45 +00:00
|
|
|
</Link>
|
|
|
|
|
);
|
|
|
|
|
})}
|
|
|
|
|
</div>
|
|
|
|
|
);
|
2026-03-08 23:52:23 +01:00
|
|
|
}
|
|
|
|
|
|
2026-03-12 11:30:45 +00:00
|
|
|
export function SubpageGridView({
|
|
|
|
|
slug,
|
|
|
|
|
title,
|
|
|
|
|
subtitle,
|
|
|
|
|
albums,
|
|
|
|
|
coverPlaceholders,
|
|
|
|
|
sections,
|
chore(release): v0.10.0 (#400)
Photo Essay mode, client proofing, studio-modern preset, admin panel overhaul, watermark, cookieless analytics, subpage toggle, SEO title templates. Analytics API now admin-only, Trivy scan on publish. Album order mirrors the Immich timeline; map theme, admin status panel, lightbox counter and Docker health check fixed.
See CHANGELOG.md for the full list and the health-check upgrade note.
2026-08-10 09:56:20 +02:00
|
|
|
index,
|
2026-03-12 11:30:45 +00:00
|
|
|
}: SubpageGridViewProps) {
|
|
|
|
|
// Build lookup maps once
|
|
|
|
|
const albumMap = new Map(albums.map((a) => [a.id, a]));
|
|
|
|
|
const placeholderMap = new Map(albums.map((a, i) => [a.id, coverPlaceholders[i] ?? null]));
|
2026-03-08 23:52:23 +01:00
|
|
|
|
2026-03-12 11:30:45 +00:00
|
|
|
const hasSections = sections && sections.length > 0;
|
chore(release): v0.10.0 (#400)
Photo Essay mode, client proofing, studio-modern preset, admin panel overhaul, watermark, cookieless analytics, subpage toggle, SEO title templates. Analytics API now admin-only, Trivy scan on publish. Album order mirrors the Immich timeline; map theme, admin status panel, lightbox counter and Docker health check fixed.
See CHANGELOG.md for the full list and the health-check upgrade note.
2026-08-10 09:56:20 +02:00
|
|
|
const totalPhotos = albums.reduce((sum, a) => sum + a.assetCount, 0);
|
2026-03-08 23:52:23 +01:00
|
|
|
|
2026-03-12 11:30:45 +00:00
|
|
|
return (
|
|
|
|
|
<div className="subpage-container">
|
|
|
|
|
{(title || subtitle) && (
|
|
|
|
|
<header className="subpage-header">
|
chore(release): v0.10.0 (#400)
Photo Essay mode, client proofing, studio-modern preset, admin panel overhaul, watermark, cookieless analytics, subpage toggle, SEO title templates. Analytics API now admin-only, Trivy scan on publish. Album order mirrors the Immich timeline; map theme, admin status panel, lightbox counter and Docker health check fixed.
See CHANGELOG.md for the full list and the health-check upgrade note.
2026-08-10 09:56:20 +02:00
|
|
|
<div className="subpage-header__main">
|
|
|
|
|
{index !== undefined && (
|
|
|
|
|
<p className="subpage-header__kicker" aria-hidden="true">
|
|
|
|
|
{pad2(index)} — Collection
|
|
|
|
|
</p>
|
|
|
|
|
)}
|
|
|
|
|
{title && <h1 className="subpage-title">{title}</h1>}
|
|
|
|
|
{subtitle && <p className="subpage-subtitle">{subtitle}</p>}
|
|
|
|
|
</div>
|
|
|
|
|
<p className="subpage-header__meta" aria-hidden="true">
|
|
|
|
|
{albums.length} {albums.length === 1 ? 'album' : 'albums'} · {photoCount(totalPhotos)}
|
|
|
|
|
</p>
|
2026-03-12 11:30:45 +00:00
|
|
|
</header>
|
|
|
|
|
)}
|
2026-03-08 23:52:23 +01:00
|
|
|
|
2026-03-12 11:30:45 +00:00
|
|
|
{/* Typographic Table of Contents */}
|
|
|
|
|
{hasSections && (
|
|
|
|
|
<nav className="subpage-toc" aria-label="Sections">
|
|
|
|
|
{sections.map((sec, i) => (
|
|
|
|
|
<span key={sec.slug} className="subpage-toc__entry">
|
|
|
|
|
<a href={`#${sec.slug}`} className="subpage-toc__link">
|
|
|
|
|
<span className="subpage-toc__num">{String(i + 1).padStart(2, '0')}</span>
|
|
|
|
|
<span className="subpage-toc__label">{sec.title}</span>
|
|
|
|
|
</a>
|
|
|
|
|
</span>
|
|
|
|
|
))}
|
|
|
|
|
</nav>
|
|
|
|
|
)}
|
2026-03-08 23:52:23 +01:00
|
|
|
|
2026-03-12 11:30:45 +00:00
|
|
|
{/* Sectioned layout */}
|
|
|
|
|
{hasSections ? (
|
|
|
|
|
sections.map((sec) => {
|
|
|
|
|
const sectionAlbums = sec.albumIds
|
|
|
|
|
.map((id) => albumMap.get(id))
|
|
|
|
|
.filter(Boolean) as SubpageAlbum[];
|
2026-03-08 23:52:23 +01:00
|
|
|
|
2026-03-12 11:30:45 +00:00
|
|
|
return (
|
|
|
|
|
<section key={sec.slug} id={sec.slug} className="subpage-section">
|
|
|
|
|
<header className="subpage-section__header">
|
|
|
|
|
<h2 className="subpage-section__title">{sec.title}</h2>
|
|
|
|
|
{sec.description && <p className="subpage-section__desc">{sec.description}</p>}
|
|
|
|
|
<div className="subpage-section__rule" aria-hidden="true" />
|
|
|
|
|
</header>
|
2026-04-21 22:51:26 +02:00
|
|
|
<AlbumGrid albums={sectionAlbums} placeholderMap={placeholderMap} slug={slug} />
|
2026-03-12 11:30:45 +00:00
|
|
|
</section>
|
|
|
|
|
);
|
|
|
|
|
})
|
|
|
|
|
) : (
|
|
|
|
|
/* Flat layout (no sections) */
|
2026-04-21 22:51:26 +02:00
|
|
|
<AlbumGrid albums={albums} placeholderMap={placeholderMap} slug={slug} />
|
2026-03-12 11:30:45 +00:00
|
|
|
)}
|
|
|
|
|
</div>
|
|
|
|
|
);
|
2026-03-08 18:55:45 +01:00
|
|
|
}
|