2026-02-14 00:59:57 +01:00
|
|
|
/**
|
|
|
|
|
* Root layout — site header with portfolio-style navigation.
|
|
|
|
|
* Shows all subpages + standalone albums as nav links.
|
feat: theming system, documentation, and photo grid regression tests
- Add configurable theme system with 4 presets (studio, minimal, editorial, classic)
- Theme controls fonts, colors, accent, photo frames, grain, and header dot
- Resolve themes from gallery.yaml: string shorthand or full object override
- Inject theme as CSS custom properties on <html> element
- Dynamic Google Fonts loading based on theme config
- OG image route reads accent/background from theme
- Refactor Studio overrides into conditional CSS via data-attributes
Documentation:
- Add docs/gallery-config.md with comprehensive configuration reference
- Add docs/theming.md with preset reference and custom theme guide
- Slim README to link to detailed docs
Fix CSS regression:
- Fix passepartout frame overflow:visible breaking next/image fill rendering
- Remove duplicate .photo-grid__item block that stripped overflow:hidden
Testing:
- Add e2e/photo-grid.spec.ts with 3 regression tests:
- Grid items render with real dimensions
- overflow:hidden CSS guard (catches the exact bug fixed)
- Images load with real pixel data (not blurhash)
Tooling:
- Add scripts/screenshots.ts for automated theme screenshot generation
- Handles dev server lifecycle, theme cycling, FadeIn + lazy image handling
2026-02-15 12:21:02 +01:00
|
|
|
* Injects theme CSS custom properties from gallery.yaml config.
|
2026-02-14 00:59:57 +01:00
|
|
|
*/
|
2026-02-13 23:26:37 +01:00
|
|
|
|
2026-02-14 00:59:57 +01:00
|
|
|
import type { Metadata } from 'next';
|
|
|
|
|
import Link from 'next/link';
|
|
|
|
|
import './globals.css';
|
|
|
|
|
import { SubpageNav } from '@/components/SubpageNav';
|
2026-02-14 11:47:26 +01:00
|
|
|
import { ThemeToggle } from '@/components/ThemeToggle';
|
|
|
|
|
import { ScrollToTop } from '@/components/ScrollToTop';
|
|
|
|
|
import { Footer } from '@/components/Footer';
|
2026-02-15 22:27:10 +01:00
|
|
|
import { DevToolbar } from '@/components/DevToolbar';
|
2026-03-08 21:04:41 +01:00
|
|
|
import { getConfig, getGoogleFontsUrl, AppConfig } from '@/lib/config';
|
2026-02-13 23:26:37 +01:00
|
|
|
|
2026-03-08 16:19:41 +01:00
|
|
|
export async function generateMetadata(): Promise<Metadata> {
|
|
|
|
|
const config = getConfig();
|
|
|
|
|
const siteTitle = config.seo.title;
|
|
|
|
|
const siteDescription = config.seo.description;
|
|
|
|
|
const robots = {
|
|
|
|
|
index: !config.seo.noIndex,
|
|
|
|
|
follow: !config.seo.noFollow,
|
|
|
|
|
};
|
2026-02-14 10:30:27 +01:00
|
|
|
|
2026-03-08 16:19:41 +01:00
|
|
|
return {
|
2026-02-14 10:30:27 +01:00
|
|
|
title: siteTitle,
|
|
|
|
|
description: siteDescription,
|
2026-03-08 16:19:41 +01:00
|
|
|
robots,
|
|
|
|
|
icons: {
|
|
|
|
|
apple: '/apple-touch-icon.png',
|
|
|
|
|
},
|
|
|
|
|
openGraph: {
|
|
|
|
|
title: siteTitle,
|
|
|
|
|
description: siteDescription,
|
|
|
|
|
type: 'website',
|
|
|
|
|
images: [`/api/og?title=${encodeURIComponent(siteTitle)}`],
|
|
|
|
|
},
|
|
|
|
|
twitter: {
|
|
|
|
|
card: 'summary_large_image',
|
|
|
|
|
title: siteTitle,
|
|
|
|
|
description: siteDescription,
|
|
|
|
|
images: [`/api/og?title=${encodeURIComponent(siteTitle)}`],
|
|
|
|
|
},
|
|
|
|
|
};
|
|
|
|
|
}
|
2026-02-13 23:26:37 +01:00
|
|
|
|
2026-02-14 11:47:26 +01:00
|
|
|
export default function RootLayout({ children }: { children: React.ReactNode }) {
|
2026-02-15 23:07:04 +01:00
|
|
|
const config = getConfig();
|
|
|
|
|
const { theme } = config;
|
feat: theming system, documentation, and photo grid regression tests
- Add configurable theme system with 4 presets (studio, minimal, editorial, classic)
- Theme controls fonts, colors, accent, photo frames, grain, and header dot
- Resolve themes from gallery.yaml: string shorthand or full object override
- Inject theme as CSS custom properties on <html> element
- Dynamic Google Fonts loading based on theme config
- OG image route reads accent/background from theme
- Refactor Studio overrides into conditional CSS via data-attributes
Documentation:
- Add docs/gallery-config.md with comprehensive configuration reference
- Add docs/theming.md with preset reference and custom theme guide
- Slim README to link to detailed docs
Fix CSS regression:
- Fix passepartout frame overflow:visible breaking next/image fill rendering
- Remove duplicate .photo-grid__item block that stripped overflow:hidden
Testing:
- Add e2e/photo-grid.spec.ts with 3 regression tests:
- Grid items render with real dimensions
- overflow:hidden CSS guard (catches the exact bug fixed)
- Images load with real pixel data (not blurhash)
Tooling:
- Add scripts/screenshots.ts for automated theme screenshot generation
- Handles dev server lifecycle, theme cycling, FadeIn + lazy image handling
2026-02-15 12:21:02 +01:00
|
|
|
const fontsUrl = getGoogleFontsUrl(theme);
|
|
|
|
|
|
|
|
|
|
const themeVars: Record<string, string> = {
|
|
|
|
|
'--accent': theme.accent,
|
|
|
|
|
'--accent-dim': `${theme.accent}1f`,
|
|
|
|
|
'--font-serif': `'${theme.fonts.heading}', Georgia, 'Times New Roman', serif`,
|
|
|
|
|
'--font-sans': `'${theme.fonts.body}', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif`,
|
|
|
|
|
'--font-caption': `'${theme.fonts.caption}', Georgia, serif`,
|
|
|
|
|
'--radius-sm': `${theme.radius}px`,
|
|
|
|
|
'--radius-md': `${Math.round(theme.radius * 1.5)}px`,
|
|
|
|
|
'--radius-lg': `${theme.radius * 2}px`,
|
|
|
|
|
};
|
|
|
|
|
|
2026-03-08 21:04:41 +01:00
|
|
|
if ((config as AppConfig & { needsSetup?: boolean }).needsSetup) {
|
|
|
|
|
return (
|
|
|
|
|
<html lang="en" suppressHydrationWarning>
|
|
|
|
|
<body>
|
|
|
|
|
<div style={{
|
|
|
|
|
display: 'flex', alignItems: 'center', justifyContent: 'center',
|
|
|
|
|
minHeight: '100dvh', padding: '2rem', backgroundColor: '#ffffff',
|
|
|
|
|
color: '#111111', fontFamily: 'system-ui, sans-serif'
|
|
|
|
|
}}>
|
|
|
|
|
<div style={{ maxWidth: '600px', width: '100%' }}>
|
|
|
|
|
<h1 style={{ fontSize: 'clamp(2rem, 5vw, 3rem)', fontWeight: 500, marginBottom: '0.5rem', letterSpacing: '-0.02em' }}>
|
|
|
|
|
Setup Required
|
|
|
|
|
</h1>
|
|
|
|
|
<p style={{ fontSize: '1.125rem', opacity: 0.7, marginBottom: '2rem', lineHeight: 1.5 }}>
|
2026-03-08 21:43:26 +01:00
|
|
|
Immich Folio is running, but it looks like your configuration files or environment variables are missing.
|
2026-03-08 21:04:41 +01:00
|
|
|
</p>
|
|
|
|
|
<div style={{ backgroundColor: 'rgba(0, 0, 0, 0.03)', padding: '1.5rem', borderRadius: '8px', fontSize: '0.95rem', lineHeight: 1.6 }}>
|
|
|
|
|
<p style={{ marginBottom: '1rem' }}>To get started, follow these steps in your repository or mounted <code>content/</code> volume:</p>
|
|
|
|
|
<ol style={{ margin: 0, paddingLeft: '1.25rem' }}>
|
2026-03-08 21:43:26 +01:00
|
|
|
<li style={{ marginBottom: '0.5rem' }}>Copy <code>.env.example</code> to <code>.env.local</code> and fill in your Immich API URL and Key</li>
|
2026-03-08 21:04:41 +01:00
|
|
|
<li style={{ marginBottom: '0.5rem' }}>Copy <code>settings.yaml.example</code> to <code>settings.yaml</code></li>
|
|
|
|
|
<li style={{ marginBottom: '0.5rem' }}>Copy <code>gallery.yaml.example</code> to <code>gallery.yaml</code></li>
|
|
|
|
|
<li style={{ marginBottom: '0.5rem' }}>Copy <code>about.md.example</code> to <code>about.md</code> (optional)</li>
|
|
|
|
|
</ol>
|
|
|
|
|
<p style={{ marginTop: '1.5rem', marginBottom: 0 }}>
|
|
|
|
|
Open <code>gallery.yaml</code> and add the album IDs you want to display, then <strong>restart your server</strong>.
|
|
|
|
|
</p>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</body>
|
|
|
|
|
</html>
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
2026-02-13 23:26:37 +01:00
|
|
|
return (
|
feat: theming system, documentation, and photo grid regression tests
- Add configurable theme system with 4 presets (studio, minimal, editorial, classic)
- Theme controls fonts, colors, accent, photo frames, grain, and header dot
- Resolve themes from gallery.yaml: string shorthand or full object override
- Inject theme as CSS custom properties on <html> element
- Dynamic Google Fonts loading based on theme config
- OG image route reads accent/background from theme
- Refactor Studio overrides into conditional CSS via data-attributes
Documentation:
- Add docs/gallery-config.md with comprehensive configuration reference
- Add docs/theming.md with preset reference and custom theme guide
- Slim README to link to detailed docs
Fix CSS regression:
- Fix passepartout frame overflow:visible breaking next/image fill rendering
- Remove duplicate .photo-grid__item block that stripped overflow:hidden
Testing:
- Add e2e/photo-grid.spec.ts with 3 regression tests:
- Grid items render with real dimensions
- overflow:hidden CSS guard (catches the exact bug fixed)
- Images load with real pixel data (not blurhash)
Tooling:
- Add scripts/screenshots.ts for automated theme screenshot generation
- Handles dev server lifecycle, theme cycling, FadeIn + lazy image handling
2026-02-15 12:21:02 +01:00
|
|
|
<html
|
|
|
|
|
lang="en"
|
|
|
|
|
suppressHydrationWarning
|
|
|
|
|
style={themeVars as React.CSSProperties}
|
feat: restyle themes to be visually distinct
- Minimal: Swiss Brutalist — fullbleed hero, true B&W, zero-gap grid, Geist font
- Editorial: Cinematic Magazine — warm charcoal, Bodoni Moda serif, slow transitions
- Classic: Gilded Gallery — gold accents, Cinzel headings, passepartout, ornamental dividers
Updated config presets, per-theme color palettes, ~550 lines of scoped CSS overrides,
data-preset attribute on html element, responsive breakpoints, screenshots, and docs.
2026-02-15 17:17:25 +01:00
|
|
|
data-preset={theme.preset}
|
2026-03-07 09:50:05 +01:00
|
|
|
data-grain={String(theme.grain)}
|
|
|
|
|
data-header-dot={String(theme.headerDot)}
|
feat: theming system, documentation, and photo grid regression tests
- Add configurable theme system with 4 presets (studio, minimal, editorial, classic)
- Theme controls fonts, colors, accent, photo frames, grain, and header dot
- Resolve themes from gallery.yaml: string shorthand or full object override
- Inject theme as CSS custom properties on <html> element
- Dynamic Google Fonts loading based on theme config
- OG image route reads accent/background from theme
- Refactor Studio overrides into conditional CSS via data-attributes
Documentation:
- Add docs/gallery-config.md with comprehensive configuration reference
- Add docs/theming.md with preset reference and custom theme guide
- Slim README to link to detailed docs
Fix CSS regression:
- Fix passepartout frame overflow:visible breaking next/image fill rendering
- Remove duplicate .photo-grid__item block that stripped overflow:hidden
Testing:
- Add e2e/photo-grid.spec.ts with 3 regression tests:
- Grid items render with real dimensions
- overflow:hidden CSS guard (catches the exact bug fixed)
- Images load with real pixel data (not blurhash)
Tooling:
- Add scripts/screenshots.ts for automated theme screenshot generation
- Handles dev server lifecycle, theme cycling, FadeIn + lazy image handling
2026-02-15 12:21:02 +01:00
|
|
|
data-photo-frame={theme.photoFrame}
|
2026-03-07 09:50:05 +01:00
|
|
|
data-transitions={String(config.transitions)}
|
feat: theming system, documentation, and photo grid regression tests
- Add configurable theme system with 4 presets (studio, minimal, editorial, classic)
- Theme controls fonts, colors, accent, photo frames, grain, and header dot
- Resolve themes from gallery.yaml: string shorthand or full object override
- Inject theme as CSS custom properties on <html> element
- Dynamic Google Fonts loading based on theme config
- OG image route reads accent/background from theme
- Refactor Studio overrides into conditional CSS via data-attributes
Documentation:
- Add docs/gallery-config.md with comprehensive configuration reference
- Add docs/theming.md with preset reference and custom theme guide
- Slim README to link to detailed docs
Fix CSS regression:
- Fix passepartout frame overflow:visible breaking next/image fill rendering
- Remove duplicate .photo-grid__item block that stripped overflow:hidden
Testing:
- Add e2e/photo-grid.spec.ts with 3 regression tests:
- Grid items render with real dimensions
- overflow:hidden CSS guard (catches the exact bug fixed)
- Images load with real pixel data (not blurhash)
Tooling:
- Add scripts/screenshots.ts for automated theme screenshot generation
- Handles dev server lifecycle, theme cycling, FadeIn + lazy image handling
2026-02-15 12:21:02 +01:00
|
|
|
>
|
|
|
|
|
<head>
|
|
|
|
|
<link rel="preconnect" href="https://fonts.googleapis.com" />
|
|
|
|
|
<link rel="preconnect" href="https://fonts.gstatic.com" crossOrigin="anonymous" />
|
|
|
|
|
<link rel="stylesheet" href={fontsUrl} />
|
|
|
|
|
</head>
|
2026-02-14 00:59:57 +01:00
|
|
|
<body>
|
|
|
|
|
<header className="header">
|
|
|
|
|
<nav className="header__nav">
|
|
|
|
|
<Link href="/" className="header__nav-link">
|
|
|
|
|
Home
|
|
|
|
|
</Link>
|
|
|
|
|
<SubpageNav />
|
2026-02-14 10:30:27 +01:00
|
|
|
<Link href="/about" className="header__nav-link">
|
|
|
|
|
About
|
|
|
|
|
</Link>
|
2026-02-15 23:07:04 +01:00
|
|
|
{config.map && (
|
|
|
|
|
<Link href="/map" className="header__nav-link">
|
|
|
|
|
Map
|
|
|
|
|
</Link>
|
|
|
|
|
)}
|
2026-02-14 11:47:26 +01:00
|
|
|
<ThemeToggle />
|
2026-02-14 00:59:57 +01:00
|
|
|
</nav>
|
|
|
|
|
</header>
|
2026-03-07 09:11:40 +01:00
|
|
|
<main className="main">{children}</main>
|
2026-02-14 11:47:26 +01:00
|
|
|
<Footer />
|
|
|
|
|
<ScrollToTop />
|
2026-02-15 22:27:10 +01:00
|
|
|
{process.env.NODE_ENV === 'development' && <DevToolbar />}
|
2026-02-13 23:26:37 +01:00
|
|
|
</body>
|
|
|
|
|
</html>
|
|
|
|
|
);
|
|
|
|
|
}
|