diff --git a/dashboard/seo/render.js b/dashboard/seo/render.js index b3da93e..a3a3155 100644 --- a/dashboard/seo/render.js +++ b/dashboard/seo/render.js @@ -156,7 +156,21 @@ const articleNode = (page) => ({ }) const buildGraph = (page) => { - const graph = [orgNode(), breadcrumbNode(page), articleNode(page)] + // Error pages are described as a plain WebPage. Emitting an Article for one + // would assert an author and a publication date for content nobody wrote. + const main = page.noindex + ? { + '@type': 'WebPage', + '@id': `${SITE.url}${page.path}#webpage`, + name: page.h1, + description: page.description, + url: `${SITE.url}${page.path}`, + inLanguage: 'en-US', + publisher: { '@id': `${SITE.url}/#organization` }, + } + : articleNode(page) + + const graph = [orgNode(), breadcrumbNode(page), main] if (page.faq?.length) graph.push(faqNode(page)) if (page.extraNodes) graph.push(...page.extraNodes) return { '@context': 'https://schema.org', '@graph': graph } @@ -241,11 +255,18 @@ ${NAV}
${crumbs}

${esc(page.h1)}

-` +}
TL;DR${page.tldr.map((p) => `

${p}

`).join('')}
${page.body} ${relatedBlock(related)}