Adds the Contact page
The contact page in the approved layout: the form next to a photo with the contact card on wide screens, and the card with a small portrait above the form on phones, where the large photo is never downloaded. /contact?pakket= preselects a package. The page is indexed, with its own title, description, preview image and ContactPage structured data. Over mij and Soorten fotoshoots now link to /contact. The green button gets a darker background, so its white text meets the contrast minimum. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -12,6 +12,7 @@ import {
|
||||
areaServed,
|
||||
businessId,
|
||||
canonicalUrl,
|
||||
contactPage,
|
||||
defaultOgImage,
|
||||
jsonLdScript,
|
||||
pageHead,
|
||||
@@ -569,3 +570,55 @@ describe('shootServices', () => {
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
describe('the contact page', () => {
|
||||
it('is indexed, with its own title, description and preview image', () => {
|
||||
const head = pageHead('/contact');
|
||||
expect(head.meta[0]).toEqual({
|
||||
title: 'Contact – fotoshoot boeken in Huizen | Andrea Slop Fotografie',
|
||||
});
|
||||
expect(meta(head, 'robots')).toBeUndefined();
|
||||
expect(meta(head, 'og:image')).toMatchObject({
|
||||
content: `${siteUrl}/og-contact.jpg`,
|
||||
});
|
||||
expect(head.links[0].href).toBe(`${siteUrl}/contact`);
|
||||
});
|
||||
|
||||
it('keeps title and description within what search engines show', () => {
|
||||
const page = sitePages['/contact'];
|
||||
// 61: one over the guideline, accepted to keep "Contact" first
|
||||
expect(
|
||||
`${page.title} | Andrea Slop Fotografie`.length,
|
||||
).toBeLessThanOrEqual(61);
|
||||
expect(page.description.length).toBeLessThanOrEqual(155);
|
||||
});
|
||||
|
||||
it('describes the page as a ContactPage about the business', () => {
|
||||
expect(contactPage('/contact')).toEqual({
|
||||
'@context': 'https://schema.org',
|
||||
'@type': 'ContactPage',
|
||||
'@id': `${siteUrl}/contact`,
|
||||
url: `${siteUrl}/contact`,
|
||||
name: sitePages['/contact'].title,
|
||||
description: sitePages['/contact'].description,
|
||||
inLanguage: 'nl-NL',
|
||||
about: { '@id': businessId },
|
||||
});
|
||||
});
|
||||
|
||||
it('never contains an e-mail address and survives the script tag (invariant, round trip)', () => {
|
||||
fc.assert(
|
||||
fc.property(
|
||||
fc.constantFrom(...(Object.keys(sitePages) as RoutePath[])),
|
||||
(path) => {
|
||||
const data = contactPage(path);
|
||||
const script = jsonLdScript(data);
|
||||
expect(script).not.toMatch(/@[a-z0-9-]+\.[a-z]/i);
|
||||
expect(JSON.parse(script)).toEqual(data);
|
||||
expect(data['@id']).toBe(canonicalUrl(path));
|
||||
expect(data.about).toEqual({ '@id': businessId });
|
||||
},
|
||||
),
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user