Twenty-nine commits since v0.12.0. See CHANGELOG.md for the full list and the upgrade notes. Ten additions — the SEO package (site URL, robots.txt, sitemap.xml, JSON-LD), slideshow mode, opt-in original downloads, copy-link, previous/next album navigation, alt text from the Immich description, per-album location precision, the update notice, a Help tab, and a subpage cover grid separate from its photo grid. Two fixes: CJK album slugs, and the lightbox control bar. Photo of the Day (#476) was built on `dev` and reverted as not planned; it never appears in a release. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01DmsHVRL9yQvckUB1ZpVWre --------- 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>
33 lines
1.2 KiB
TypeScript
33 lines
1.2 KiB
TypeScript
import type { MetadataRoute } from 'next';
|
|
import { getConfigOrNull } from '@/lib/config';
|
|
import { buildSiteShape } from '@/lib/siteShape';
|
|
import { publicPaths } from '@/lib/publicPages';
|
|
import { absoluteUrl } from '@/lib/siteUrl';
|
|
|
|
/**
|
|
* sitemap.xml (#472).
|
|
*
|
|
* What goes in is decided by `publicPaths()`, the same function the feed uses,
|
|
* because a sitemap lists exactly what access control otherwise hides and a
|
|
* second implementation of that judgement would eventually disagree with the
|
|
* first.
|
|
*/
|
|
export const dynamic = 'force-dynamic';
|
|
|
|
export default async function sitemap(): Promise<MetadataRoute.Sitemap> {
|
|
const config = getConfigOrNull();
|
|
|
|
// A sitemap needs absolute URLs and this route has no request context to
|
|
// derive a host from. Without a configured site URL there is nothing valid
|
|
// to emit, and an empty sitemap is better than a wrong one.
|
|
if (!config?.siteUrl) return [];
|
|
|
|
const shape = await buildSiteShape().catch(() => null);
|
|
if (!shape) return [];
|
|
|
|
return publicPaths(shape).flatMap((path) => {
|
|
const url = absoluteUrl(config.siteUrl, path);
|
|
return url ? [{ url, changeFrequency: 'weekly' as const }] : [];
|
|
});
|
|
}
|