Release v0.19.0. See the `## [0.19.0] — 2026-09-29` section of [CHANGELOG.md](https://github.com/ralksta/immich-folio/blob/dev/CHANGELOG.md) for the full list. Highlights: client proofing links (#683), custom content pages (#738), asset picker search (#740), concurrent-edit detection (#742), env-locked settings (#739), an accessibility baseline (#741), three security fixes with advisories (#737, #755, #759), and a pre-release quality pass (#780–#797). --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: ralksta <ralksta@users.noreply.github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Claude Opus 5 <noreply@anthropic.com> Co-authored-by: Ralf <rohlenbo79@gmail.com> Co-authored-by: Paul Thies <110185070+ImScheinox@users.noreply.github.com> Co-authored-by: lancetm714 <108419425+lancetm714@users.noreply.github.com> Co-authored-by: Lance Martin <lancetaylor95@gmail.com>
59 lines
2.2 KiB
TypeScript
59 lines
2.2 KiB
TypeScript
/**
|
|
* Build the description of the site that `publicPaths()` reasons about (#472).
|
|
*
|
|
* Kept apart from the pure rules so the exclusions stay testable without a
|
|
* running Immich, and so the sitemap and the feed cannot answer the visibility
|
|
* question differently.
|
|
*/
|
|
|
|
import { getConfig } from './config';
|
|
import { immich } from './immich';
|
|
import { isProtected, isSiteLocked } from './auth';
|
|
import { listJournalEntries } from './admin/journal-service';
|
|
import { listPages } from './admin/pages-service';
|
|
import type { SiteShape, PublicAlbum } from './publicPages';
|
|
|
|
export async function buildSiteShape(): Promise<SiteShape> {
|
|
const config = getConfig();
|
|
|
|
// Allowlisted albums only — getAlbums() already drops everything else, so an
|
|
// album that was never published cannot reach a listing through here.
|
|
const albums = await immich.getAlbums();
|
|
const byId = new Map(albums.map((album) => [album.id, album]));
|
|
const resolve = (ids: string[]): PublicAlbum[] =>
|
|
ids
|
|
.map((id) => byId.get(id))
|
|
.filter((album): album is NonNullable<typeof album> => Boolean(album))
|
|
.map((album) => ({ id: album.id, slug: album.slug }));
|
|
|
|
const journal = await listJournalEntries().catch(() => []);
|
|
const pages = await listPages().catch(() => []);
|
|
|
|
return {
|
|
siteLocked: isSiteLocked(),
|
|
subpages: config.subpages.map((subpage) => ({
|
|
slug: subpage.slug,
|
|
enabled: subpage.enabled !== false,
|
|
hidden: subpage.hidden === true,
|
|
isProtected: isProtected(subpage.slug, 'subpage'),
|
|
albums: resolve(subpage.albumIds),
|
|
})),
|
|
standaloneAlbums: resolve(config.standaloneAlbums),
|
|
journal: journal.map((entry) => ({
|
|
slug: entry.slug,
|
|
draft: entry.frontmatter.draft === true,
|
|
isProtected: !!entry.frontmatter.password,
|
|
})),
|
|
pages: pages.map((page) => ({
|
|
slug: page.slug,
|
|
draft: page.frontmatter.draft === true,
|
|
isProtected: !!page.frontmatter.password,
|
|
})),
|
|
isAlbumProtected: (albumId) => isProtected(albumId, 'album'),
|
|
aboutEnabled: config.aboutEnabled,
|
|
mapEnabled: config.map,
|
|
// There is no switch for the journal; it exists when it has entries.
|
|
journalEnabled: journal.length > 0,
|
|
};
|
|
}
|