From ae96947230fd6affa50f75bca3efeb3530645e2a Mon Sep 17 00:00:00 2001 From: Felix Delval Date: Wed, 6 Dec 2023 13:18:02 +0100 Subject: [PATCH] Updating index and blog import --- helix-query.yaml | 9 --------- tools/importer/transformers/hero.js | 3 ++- tools/importer/transformers/index.js | 6 ++++++ 3 files changed, 8 insertions(+), 10 deletions(-) diff --git a/helix-query.yaml b/helix-query.yaml index 81ad4d20..4497f121 100644 --- a/helix-query.yaml +++ b/helix-query.yaml @@ -27,10 +27,6 @@ indices: select: head > meta[name="author"] value: attribute(el, "content") tags: - select: head > meta[property="article:tag"] - values: | - match(attribute(el, 'content'), '([^,]+)') - tags-raw: select: head > meta[property="article:tag"] values: attribute(el, 'content') blog_ca: @@ -59,10 +55,5 @@ indices: select: head > meta[name="author"] value: attribute(el, "content") tags: - select: head > meta[property="article:tag"] - values: | - match(attribute(el, 'content'), '([^,]+)') - tags-raw: select: head > meta[property="article:tag"] values: attribute(el, 'content') - diff --git a/tools/importer/transformers/hero.js b/tools/importer/transformers/hero.js index 0efd5fa5..3a67e137 100644 --- a/tools/importer/transformers/hero.js +++ b/tools/importer/transformers/hero.js @@ -2,7 +2,8 @@ const createHero = (main, document) => { const hero = main.querySelector('div#mainContent > div > div:first-child'); - if (hero) { + const title = hero.querySelector('h1'); + if (hero && title) { const titleNodes = hero.querySelector('h1').childNodes; const h1 = document.createElement('h1'); diff --git a/tools/importer/transformers/index.js b/tools/importer/transformers/index.js index 719a09fe..ba8cfe19 100644 --- a/tools/importer/transformers/index.js +++ b/tools/importer/transformers/index.js @@ -7,6 +7,9 @@ import createHeader from './header.js'; import createHero from './hero.js'; import createMetadata from './metadata.js'; import cleanUpHTML from './cleanUpHTML.js'; +import createBlogArticle from './blogArticle.js'; +import createBlogBanner from './blogBanner.js'; +import cleanBlog from './cleanBlog.js'; export const transformers = [ createFullLayoutSection, @@ -14,6 +17,8 @@ export const transformers = [ createHomepage, createCards, createFeatureImage, + createBlogArticle, + createBlogBanner, ]; export const xfTransformers = [ @@ -31,4 +36,5 @@ export const preTransformers = [ export const postTransformers = [ createMetadata, cleanUpHTML, + cleanBlog, ];