diff --git a/gatsby-node.js b/gatsby-node.js index a92e3c791..bd604157d 100644 --- a/gatsby-node.js +++ b/gatsby-node.js @@ -40,6 +40,12 @@ exports.onCreateNode = ({ node, actions }) => { $(el).replaceWith(`
`); }); + /* Drop tables with no rows (usually from malformed asciidoc tables). + * turndown-plugin-gfm reads `table.rows[0].parentNode` and throws on them. */ + $('table').each((_, el) => { + if (!$(el).find('tr').length) $(el).remove(); + }); + /* Get the cleaned HTML */ const cleanedHtml = $('body').html() || ''; @@ -55,7 +61,13 @@ exports.onCreateNode = ({ node, actions }) => { const { tables } = require('turndown-plugin-gfm'); td.use(tables); - const markdownBody = td.turndown(cleanedHtml); + /* A conversion failure on one page must not fail the whole build */ + let markdownBody = ''; + try { + markdownBody = td.turndown(cleanedHtml); + } catch (err) { + console.warn(`Markdown conversion failed for "${title}" (${node.id}): ${err.message}`); + } createNodeField({ node, diff --git a/modules/ROOT/pages/home.adoc b/modules/ROOT/pages/home.adoc index f0f150e82..f6e036d4a 100644 --- a/modules/ROOT/pages/home.adoc +++ b/modules/ROOT/pages/home.adoc @@ -7,17 +7,9 @@ ++++${type}: ${content}
- {t('404_PAGE_MSG_PRETEXT')} {t('404_PAGE_MSG')} -
-- - {t('404_GO_HOME_LINK_TEXT')} - - . -
+ {/* Radiance "home" product pattern: the same gradient as the product home page and the + docs home hero. Markup follows products/home/README.md; the recipe CSS owns the look. */} +{t('404_DOC_MSG')}
+ {homeLink} ++ {t('404_PAGE_CODE')} +
+
+ {t('404_PAGE_MSG')}
+
+ {t('404_PAGE_MSG_DETAIL')}
+