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>
35 lines
1.0 KiB
TypeScript
35 lines
1.0 KiB
TypeScript
/**
|
|
* A JSON-LD block (#472).
|
|
*
|
|
* `proxy.ts` sets a CSP with a per-request nonce and no `unsafe-inline`
|
|
* fallback, so an inline script without the nonce is blocked — silently, which
|
|
* is the failure mode worth guarding against: the markup looks right in the
|
|
* source and the crawler never sees it.
|
|
*/
|
|
|
|
import { headers } from 'next/headers';
|
|
|
|
/**
|
|
* Serialise for embedding in a <script> element.
|
|
*
|
|
* `</script>` inside a string value would end the element early and let the
|
|
* rest be parsed as markup, so the angle brackets are escaped. JSON parsers
|
|
* read `\u003c` as `<`, which leaves the data unchanged.
|
|
*/
|
|
function serialise(data: unknown): string {
|
|
return JSON.stringify(data).replace(/</g, '\\u003c').replace(/>/g, '\\u003e');
|
|
}
|
|
|
|
export async function StructuredData({ data }: { data: unknown }) {
|
|
if (!data) return null;
|
|
const nonce = (await headers()).get('x-nonce') ?? undefined;
|
|
|
|
return (
|
|
<script
|
|
type="application/ld+json"
|
|
nonce={nonce}
|
|
dangerouslySetInnerHTML={{ __html: serialise(data) }}
|
|
/>
|
|
);
|
|
}
|