Adds the shoot-type pages content and SEO foundation

Five pages under /soorten-fotoshoots/<id> with draft copy awaiting
Andrea's approval (DRAFT markers), structured data (Service,
BreadcrumbList, FAQPage), sitemap and Lighthouse entries. The overview
route moves to soorten-fotoshoots/index.tsx.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-30 13:31:46 +01:00
co-authored by Claude Opus 5.5
parent 14164971f3
commit e5f4348178
78 changed files with 8729 additions and 110 deletions
@@ -0,0 +1,40 @@
import { render } from '@testing-library/react';
import { describe, expect, it } from 'vitest';
import StructuredData from './StructuredData';
const scripts = (container: HTMLElement) =>
container.querySelectorAll('script[type="application/ld+json"]');
describe('StructuredData', () => {
it('renders the data as one ld+json script that parses back to it', () => {
const data = {
'@type': 'FAQPage',
name: 'Vragen & antwoorden',
items: [1, 'twee'],
};
const { container } = render(<StructuredData data={data} />);
expect(scripts(container)).toHaveLength(1);
expect(JSON.parse(scripts(container)[0].textContent ?? '')).toEqual(
data,
);
});
it('does not let </script> in the data end the element', () => {
const data = {
name: '</script><img src=x onerror="alert(1)">',
text: '<!-- & -->',
};
const { container } = render(<StructuredData data={data} />);
const text = scripts(container)[0].textContent ?? '';
expect(text).not.toMatch(/[<>&]/);
expect(JSON.parse(text)).toEqual(data);
// The serialised page parsed again as HTML: still one script, and
// nothing from the data became an element
const page = new DOMParser().parseFromString(
container.innerHTML,
'text/html',
);
expect(page.querySelectorAll('script')).toHaveLength(1);
expect(page.querySelector('img')).toBeNull();
});
});
@@ -0,0 +1,18 @@
import { jsonLdScript } from '@/seo';
type StructuredDataProps = {
data: unknown;
};
// One object of structured data as an ld+json script in the page. This is
// the only place the shoot pages use dangerouslySetInnerHTML, and only with
// jsonLdScript's output: it escapes <, > and &, so content can never close
// the script element (SECURITY-04, SECURITY-11).
export default function StructuredData({ data }: StructuredDataProps) {
return (
<script
type="application/ld+json"
dangerouslySetInnerHTML={{ __html: jsonLdScript(data) }}
/>
);
}
@@ -0,0 +1,35 @@
import { screen } from '@testing-library/react';
import { describe, expect, it } from 'vitest';
import newbornPage from '@/content/shootPages/newborn';
import shootPageShared from '@/content/shootPageShared';
import packages from '@/content/packages';
import shootTypes from '@/content/shootTypes';
import siteContent from '@/content/siteContent';
import { shootPageView } from '@/lib/shootPageView';
import { axeResults } from '@/test/axe';
import { renderWithProviders } from '@/test/renderWithProviders';
import ShootPage from './ShootPage';
const view = shootPageView('newborn', newbornPage, {
shootTypes,
packages,
shared: shootPageShared,
site: siteContent,
portfolioShoots: [],
});
describe('ShootPage', () => {
it('toont label, de enige h1 en de intro', async () => {
if (view === undefined) throw new Error('no view for newborn');
const { container } = await renderWithProviders(
<ShootPage view={view} />,
);
expect(screen.getAllByRole('heading', { level: 1 })).toHaveLength(1);
expect(screen.getByRole('heading', { level: 1 })).toHaveTextContent(
view.intro.title,
);
expect(screen.getByText(view.intro.eyebrow)).toBeInTheDocument();
expect(screen.getByText(view.intro.text)).toBeInTheDocument();
expect(await axeResults(container)).toHaveNoViolations();
});
});
@@ -0,0 +1,17 @@
import PageIntro from '@/components/PageIntro/PageIntro';
import type { ShootPageView } from '@/lib/shootPageView';
type ShootPageProps = {
view: ShootPageView;
};
// One shoot page. For now only the page head with the h1; unit 2 adds the
// sections in the order of the page structure.
export default function ShootPage({ view }: ShootPageProps) {
const { intro } = view;
return (
<PageIntro eyebrow={intro.eyebrow} title={intro.title}>
{intro.text}
</PageIntro>
);
}