import { SITE } from './data/gong';

/** Nœud WebPage standard pour une page interne. */
export function webPage(path: string, name: string, description: string) {
	const url = SITE.url + path;
	return {
		'@type': 'WebPage',
		'@id': `${url}#webpage`,
		url,
		name,
		description,
		isPartOf: { '@id': `${SITE.url}/#website` },
		about: { '@id': `${SITE.url}/#organization` },
		inLanguage: 'fr-FR'
	};
}

/** Nœud Person (fiche militant). */
export function personNode(path: string, name: string, description: string, extra: Record<string, unknown> = {}) {
	const url = SITE.url + path;
	return {
		'@type': 'Person',
		'@id': `${url}#person`,
		name,
		description,
		url,
		memberOf: { '@id': `${SITE.url}/#organization` },
		...extra
	};
}
