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:
co-authored by
Claude Opus 5.5
parent
dd11bc8146
commit
64ee581098
@@ -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',
|
||||
|
||||
@@ -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 ? `` : ''
|
||||
}
|
||||
|
||||
/**
|
||||
* 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()}`)
|
||||
|
||||
Reference in New Issue
Block a user