Reference site SEO: own meta descriptions, fuller demo content; blocksToMarkdown reads section headers

- blocksToMarkdown: the library's section header (heading → ##, then intro; eyebrow
  skipped), intro, quote and bio are content. Pages whose text sat only in a hero
  (archive pages, quote, 404) auto-filled no meta description and fell back to the
  site description; /md and llms-full.txt also missed every section heading.
- legal() template: the placeholder names its page, so unfilled privacy/terms pages
  don't share a description.
- reference: every demo page has its own meta description (pl/en), posts and case
  studies use their excerpt; fuller made-up text on services, contact, quote and
  the archives (all pages >= 150 words); no seeding of allowThemeToggle (its default,
  fillGlobal rewrote it on every run). The two content silences are gone.

ipal-doctor --strict --offline --deep --url: 0/0/0 (4 silenced: 2 permanent,
2 entryList follow-ups of the block-library track). Smoke tests 15/15.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
Radosław Smoliński
2026-10-29 16:38:09 +01:00
co-authored by Claude Opus 5.5
parent dd11bc8146
commit 64ee581098
9 changed files with 172 additions and 37 deletions
+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()}`)