Merge claude/reference-seo-content: own meta descriptions, fuller demo content

Reference site: every page has its own meta description, demo archive and service
pages have real-length content; blocksToMarkdown reads section headers.

Conflicts resolved: reference/ipal-doctor.json — both branches removed their own
two live-seo silences, so the merged file keeps only the two permanent rules
(audit:collections-present, i18n-literals); docs/agent/reference-site/INDEX.md
regenerated with pnpm reference:index.
This commit is contained in:
Radosław Smoliński
2026-10-29 16:46:53 +01:00
9 changed files with 215 additions and 34 deletions
+6 -5
View File
@@ -96,20 +96,21 @@ export function post(options?: TemplateOptions): TemplatePage {
}
const LEGAL = {
privacyPolicy: { slug: tx('privacy-policy', 'polityka-prywatnosci'), title: tx('Privacy policy', 'Polityka prywatności') },
termsOfService: { slug: tx('terms', 'regulamin'), title: tx('Terms of service', 'Regulamin') },
privacyPolicy: { slug: tx('privacy-policy', 'polityka-prywatnosci'), text: tx('privacy policy text from the client or their lawyer', 'treść polityki prywatności od klienta lub prawnika'), title: tx('Privacy policy', 'Polityka prywatności') },
termsOfService: { slug: tx('terms', 'regulamin'), text: tx('terms of service text from the client or their lawyer', 'treść regulaminu od klienta lub prawnika'), title: tx('Terms of service', 'Regulamin') },
}
/** A legal page (privacy policy, terms): header and text with a table of contents, `noindex`. Structure only — the wording comes from the client. */
export function legal(role: keyof typeof LEGAL, options?: TemplateOptions): TemplatePage {
const { slug, title } = LEGAL[role]
const { slug, text, title } = LEGAL[role]
return noindex(buildTemplate(role, { slug, title }, [
pageHero(title),
{
blockType: 'richText',
content: sections({
en: [['[TO FILL: section heading]', '[TO FILL: text provided by the client or their lawyer]']],
pl: [['[TO FILL: nagłówek sekcji]', '[TO FILL: treść od klienta lub prawnika]']],
// the placeholder names its page, so an unfilled page still gets its own meta description
en: [['[TO FILL: section heading]', `[TO FILL: ${text.en}]`]],
pl: [['[TO FILL: nagłówek sekcji]', `[TO FILL: ${text.pl}]`]],
}),
tableOfContents: { label: tx('Contents', 'Spis treści'), show: true },
variant: 'narrow',
+19 -1
View File
@@ -33,12 +33,15 @@ const SUBHEADING_KEYS = new Set(['subheading', 'subtitle'])
const QUESTION_KEYS = new Set(['question'])
const TEXT_KEYS = new Set([
'answer',
'bio',
'body',
'caption',
'content',
'description',
'excerpt',
'intro',
'label',
'quote',
'summary',
'text',
])
@@ -72,12 +75,27 @@ function imageMarkdown(v: unknown): string {
return url ? `![${alt}](${url})` : ''
}
/**
* The section header group of buildSectionHeaderField (`header: { eyebrow, heading, intro }`) — every library block
* has one. Heading first, then the intro; the eyebrow is a label, not content.
*/
function headerMarkdown(value: unknown): string {
if (!value || typeof value !== 'object' || Array.isArray(value)) {return ''}
const h = value as Record<string, unknown>
const heading = typeof h.heading === 'string' ? h.heading.trim() : ''
const intro = typeof h.intro === 'string' ? h.intro.trim() : ''
return [heading && `## ${heading}`, intro].filter(Boolean).join('\n\n')
}
/** Extract readable Markdown from one block's known content fields. */
function extractBlock(block: Block, depth: number): string {
const lines: string[] = []
// The section header leads the block, wherever the key sits in the stored object
const header = headerMarkdown(block.header)
if (header) {lines.push(header)}
for (const [key, value] of Object.entries(block)) {
if (value == null) {continue}
if (value == null || key === 'header') {continue}
if (HEADING_KEYS.has(key) && typeof value === 'string' && value.trim()) {
lines.push(`## ${value.trim()}`)