Adds the Over mij page
Replaces the placeholder with the page from the design and the texts from the live site: Andrea's introduction with her portrait, how it started, two photos, life outside photography and a booking button. The page is now indexed, with its own title, description, preview image and AboutPage data about Andrea. The portrait loads straight away instead of after the page, since on phones it is the largest paint. Lighthouse no longer lets every indexed page use the homepage's lower mobile performance target; it now only applies to the homepage itself. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
+69
-12
@@ -1,6 +1,7 @@
|
||||
// SEO: head-tags per pagina en voor de hele site, plus gestructureerde data.
|
||||
// Titels en beschrijvingen staan in het pagina-register (sitePages.ts).
|
||||
import type { SiteContent } from './content/types.ts';
|
||||
import type { AboutPageContent, SiteContent } from './content/types.ts';
|
||||
import { knowsAboutList } from './lib/knowsAboutList.ts';
|
||||
import { visibleSocials } from './lib/visibleSocials.ts';
|
||||
import type { RoutePath } from './navigation.ts';
|
||||
import sitePages from './sitePages.ts';
|
||||
@@ -61,24 +62,85 @@ export function jsonLdScript(data: unknown): string {
|
||||
.replace(/&/g, '\\u0026');
|
||||
}
|
||||
|
||||
// Stable ids, so the business on every page and Andrea on the about page
|
||||
// refer to each other (BR-SD-03)
|
||||
export const businessId = `${siteUrl}/#business`;
|
||||
export const personId = `${siteUrl}/over-mij#andrea`;
|
||||
|
||||
const huizen = {
|
||||
'@type': 'PostalAddress',
|
||||
addressLocality: 'Huizen',
|
||||
addressCountry: 'NL',
|
||||
} as const;
|
||||
|
||||
// Gestructureerde data: een lokale fotograaf in Huizen. Bewust zonder
|
||||
// e-mailadres, anders staat het alsnog leesbaar in de pagina.
|
||||
export function professionalService(content: SiteContent) {
|
||||
return {
|
||||
'@context': 'https://schema.org',
|
||||
'@type': 'ProfessionalService',
|
||||
'@id': businessId,
|
||||
name: siteName,
|
||||
url: `${siteUrl}/`,
|
||||
logo: `${siteUrl}/logo.png`,
|
||||
image: siteUrl + defaultOgImage.path,
|
||||
description: sitePages['/'].description,
|
||||
address: {
|
||||
'@type': 'PostalAddress',
|
||||
addressLocality: 'Huizen',
|
||||
addressCountry: 'NL',
|
||||
},
|
||||
address: huizen,
|
||||
areaServed: { '@type': 'Place', name: 'Huizen' },
|
||||
sameAs: visibleSocials(content.socials).map((social) => social.href),
|
||||
founder: { '@id': personId },
|
||||
};
|
||||
}
|
||||
|
||||
// Andrea as a person (BR-SD-01..05). Optional lists are left out when empty;
|
||||
// no e-mail address, for the same reason as above.
|
||||
export function person(
|
||||
content: AboutPageContent['person'],
|
||||
site: SiteContent,
|
||||
image: string,
|
||||
) {
|
||||
const sameAs = visibleSocials(site.socials).map((social) => social.href);
|
||||
const knowsAbout = knowsAboutList(content.knowsAbout);
|
||||
return {
|
||||
'@type': 'Person',
|
||||
'@id': personId,
|
||||
name: content.name,
|
||||
jobTitle: content.jobTitle,
|
||||
image,
|
||||
address: huizen,
|
||||
url: canonicalUrl('/over-mij'),
|
||||
worksFor: { '@id': businessId },
|
||||
...(knowsAbout.length > 0 ? { knowsAbout } : {}),
|
||||
...(sameAs.length > 0 ? { sameAs } : {}),
|
||||
};
|
||||
}
|
||||
|
||||
// The about page with Andrea as its subject (BR-SD-06); name, description
|
||||
// and preview image come from the page registry
|
||||
export function aboutPage(
|
||||
path: RoutePath,
|
||||
content: AboutPageContent['person'],
|
||||
site: SiteContent,
|
||||
) {
|
||||
const page = sitePages[path];
|
||||
const image = siteUrl + (page.ogImage ?? defaultOgImage).path;
|
||||
return {
|
||||
'@context': 'https://schema.org',
|
||||
'@type': 'AboutPage',
|
||||
'@id': canonicalUrl(path),
|
||||
url: canonicalUrl(path),
|
||||
name: page.title,
|
||||
description: page.description,
|
||||
inLanguage: 'nl-NL',
|
||||
mainEntity: person(content, site, image),
|
||||
};
|
||||
}
|
||||
|
||||
// A head script tag with structured data, escaped by jsonLdScript (BR-SD-07)
|
||||
export function structuredDataScript(data: unknown) {
|
||||
return {
|
||||
type: 'application/ld+json',
|
||||
children: jsonLdScript(data),
|
||||
};
|
||||
}
|
||||
|
||||
@@ -91,11 +153,6 @@ export function siteHead(content: SiteContent) {
|
||||
{ property: 'og:type', content: 'website' },
|
||||
{ name: 'twitter:card', content: 'summary_large_image' },
|
||||
],
|
||||
scripts: [
|
||||
{
|
||||
type: 'application/ld+json',
|
||||
children: jsonLdScript(professionalService(content)),
|
||||
},
|
||||
],
|
||||
scripts: [structuredDataScript(professionalService(content))],
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user