From 0ab67028c2e259ec9bb6cb91438b02eb6973f329 Mon Sep 17 00:00:00 2001 From: JC Kautzmann Date: Tue, 29 Nov 2022 11:31:32 +0100 Subject: [PATCH 01/33] upgrade project to helix v7 --- helix-version.txt | 1 + 1 file changed, 1 insertion(+) create mode 100644 helix-version.txt diff --git a/helix-version.txt b/helix-version.txt new file mode 100644 index 0000000..02a819f --- /dev/null +++ b/helix-version.txt @@ -0,0 +1 @@ +v7 From d6a6e25bbc47a3e642eea0a1633bd192ec51527a Mon Sep 17 00:00:00 2001 From: JC Kautzmann Date: Tue, 29 Nov 2022 11:43:57 +0100 Subject: [PATCH 02/33] upgrade project to helix v7 --- helix-version.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/helix-version.txt b/helix-version.txt index 02a819f..9c0be88 100644 --- a/helix-version.txt +++ b/helix-version.txt @@ -1 +1 @@ -v7 +v6 From effa3e6ca3072bd61cbbce3ffea70ca91621ced3 Mon Sep 17 00:00:00 2001 From: JC Kautzmann Date: Tue, 29 Nov 2022 11:44:20 +0100 Subject: [PATCH 03/33] upgrade project to helix v7 --- helix-version.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/helix-version.txt b/helix-version.txt index 9c0be88..02a819f 100644 --- a/helix-version.txt +++ b/helix-version.txt @@ -1 +1 @@ -v6 +v7 From 3117b8bdc31e250a4d3f3565913058f66f7712a7 Mon Sep 17 00:00:00 2001 From: JC Kautzmann Date: Tue, 29 Nov 2022 15:35:08 +0100 Subject: [PATCH 04/33] upgrade project to helix v7 - fix class names --- blog/blocks/recommended-articles/recommended-articles.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/blog/blocks/recommended-articles/recommended-articles.js b/blog/blocks/recommended-articles/recommended-articles.js index 0c2257c..e744137 100644 --- a/blog/blocks/recommended-articles/recommended-articles.js +++ b/blog/blocks/recommended-articles/recommended-articles.js @@ -7,7 +7,7 @@ import { async function decorateRecommendedArticles(recommendedArticlesEl, paths) { if (recommendedArticlesEl.classList.contains('small')) { - recommendedArticlesEl.closest('.recommended-articles-small-container').querySelectorAll('a').forEach((aEl) => { + recommendedArticlesEl.closest('.recommended-articles.small').querySelectorAll('a').forEach((aEl) => { aEl.classList.add('button', 'primary', 'small', 'light'); }); recommendedArticlesEl.parentNode.classList.add('recommended-articles-small-content-wrapper'); From ef5d1c49a1d78e88003e78ca18fbbcdaf9a56fc1 Mon Sep 17 00:00:00 2001 From: JC Kautzmann Date: Tue, 29 Nov 2022 17:57:06 +0100 Subject: [PATCH 05/33] upgrade project to helix v7 - adapt class names --- blog/blocks/recommended-articles/recommended-articles.js | 2 +- blog/scripts/scripts.js | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/blog/blocks/recommended-articles/recommended-articles.js b/blog/blocks/recommended-articles/recommended-articles.js index e744137..0c2257c 100644 --- a/blog/blocks/recommended-articles/recommended-articles.js +++ b/blog/blocks/recommended-articles/recommended-articles.js @@ -7,7 +7,7 @@ import { async function decorateRecommendedArticles(recommendedArticlesEl, paths) { if (recommendedArticlesEl.classList.contains('small')) { - recommendedArticlesEl.closest('.recommended-articles.small').querySelectorAll('a').forEach((aEl) => { + recommendedArticlesEl.closest('.recommended-articles-small-container').querySelectorAll('a').forEach((aEl) => { aEl.classList.add('button', 'primary', 'small', 'light'); }); recommendedArticlesEl.parentNode.classList.add('recommended-articles-small-content-wrapper'); diff --git a/blog/scripts/scripts.js b/blog/scripts/scripts.js index 38146ce..909015d 100644 --- a/blog/scripts/scripts.js +++ b/blog/scripts/scripts.js @@ -127,6 +127,10 @@ export function toClassName(name) { */ export function decorateBlock(block) { const trimDashes = (str) => str.replace(/(^\s*-)|(-\s*$)/g, ''); + + // transform v7 classes to v6 compatible format + block.className = Array.from(block.classList).join('--'); + const classes = Array.from(block.classList.values()); const blockName = classes[0]; if (!blockName) return; From f497f41d1cfc7283b49bbf63ae094a00173a5e1f Mon Sep 17 00:00:00 2001 From: JC Kautzmann Date: Wed, 30 Nov 2022 10:20:31 +0100 Subject: [PATCH 06/33] upgrade project to helix v7 - adapt class names --- blog/scripts/scripts.js | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/blog/scripts/scripts.js b/blog/scripts/scripts.js index 909015d..1462f2a 100644 --- a/blog/scripts/scripts.js +++ b/blog/scripts/scripts.js @@ -127,16 +127,12 @@ export function toClassName(name) { */ export function decorateBlock(block) { const trimDashes = (str) => str.replace(/(^\s*-)|(-\s*$)/g, ''); - - // transform v7 classes to v6 compatible format - block.className = Array.from(block.classList).join('--'); - const classes = Array.from(block.classList.values()); const blockName = classes[0]; if (!blockName) return; const section = block.closest('.section'); if (section) { - section.classList.add(`${blockName}-container`.replace(/--/g, '-')); + section.classList.add(`${classes.join('-')}-container`); } const blockWithVariants = blockName.split('--'); const shortBlockName = trimDashes(blockWithVariants.shift()); From 31851dcca7cf2ab9ebc1336c79d9ba8de1eaea67 Mon Sep 17 00:00:00 2001 From: JC Kautzmann Date: Wed, 30 Nov 2022 11:11:01 +0100 Subject: [PATCH 07/33] upgrade project to helix v7 - replace DOM nodes with DOM elements --- blog/blocks/animation/animation.js | 4 +- blog/blocks/article-header/article-header.js | 10 ++--- blog/blocks/embed/embed.js | 8 ++-- blog/blocks/footer/footer.js | 6 +-- blog/blocks/images/images.js | 6 +-- blog/blocks/infographic/infographic.js | 4 +- blog/blocks/interlinks/interlinks.js | 6 +-- .../recommended-articles.js | 2 +- .../table-of-contents/table-of-contents.js | 2 +- blog/blocks/video/video.js | 6 +-- blog/scripts/scripts.js | 40 +++++++++---------- blog/styles/styles.css | 13 ++++-- 12 files changed, 56 insertions(+), 51 deletions(-) diff --git a/blog/blocks/animation/animation.js b/blog/blocks/animation/animation.js index efa6a95..ac3de58 100644 --- a/blog/blocks/animation/animation.js +++ b/blog/blocks/animation/animation.js @@ -27,7 +27,7 @@ export default function decorateAnimation(blockEl) { parentEl.innerHTML = picEl; } - const figEl = buildFigure(blockEl.firstChild.firstChild); + const figEl = buildFigure(blockEl.firstElementChild.firstElementChild); blockEl.prepend(figEl); - blockEl.lastChild.remove(); + blockEl.lastElementChild.remove(); } diff --git a/blog/blocks/article-header/article-header.js b/blog/blocks/article-header/article-header.js index ed06aee..55b6d06 100644 --- a/blog/blocks/article-header/article-header.js +++ b/blog/blocks/article-header/article-header.js @@ -45,15 +45,15 @@ export default async function decorateArticleHeader(blockEl, blockName, document // byline const bylineContainer = childrenEls[2]; bylineContainer.classList.add('article-byline'); - bylineContainer.firstChild.classList.add('article-byline-info'); + bylineContainer.firstElementChild.classList.add('article-byline-info'); // author - const author = bylineContainer.firstChild.firstChild; + const author = bylineContainer.firstElementChild.firstElementChild; const authorURL = author.querySelector('a').href; const authorName = author.textContent; author.textContent = authorName; author.classList.add('article-author'); // publication date - const date = bylineContainer.firstChild.lastChild; + const date = bylineContainer.firstElementChild.lastElementChild; date.classList.add('article-date'); // author img const authorImg = document.createElement('div'); @@ -64,8 +64,8 @@ export default async function decorateArticleHeader(blockEl, blockName, document // feature img const featureImgContainer = childrenEls[3]; featureImgContainer.classList.add('article-feature-image'); - const featureFigEl = buildFigure(featureImgContainer.firstChild); + const featureFigEl = buildFigure(featureImgContainer.firstElementChild); featureFigEl.classList.add('figure-feature'); featureImgContainer.prepend(featureFigEl); - featureImgContainer.lastChild.remove(); + featureImgContainer.lastElementChild.remove(); } diff --git a/blog/blocks/embed/embed.js b/blog/blocks/embed/embed.js index ebdb6a4..516785b 100644 --- a/blog/blocks/embed/embed.js +++ b/blog/blocks/embed/embed.js @@ -46,9 +46,9 @@ const embedInstagram = (url) => { const embedVimeo = (url) => { const video = url.pathname.split('/')[1]; const embedHTML = `
-
`; return embedHTML; @@ -150,7 +150,7 @@ const loadEmbed = (block) => { } const a = block.querySelector('a'); - const figure = buildFigure(block.firstChild.firstChild); + const figure = buildFigure(block.firstElementChild.firstElementChild); if (a) { const url = new URL(a.href.replace(/\/$/, '')); diff --git a/blog/blocks/footer/footer.js b/blog/blocks/footer/footer.js index 809466a..c9f6bfb 100644 --- a/blog/blocks/footer/footer.js +++ b/blog/blocks/footer/footer.js @@ -44,13 +44,13 @@ class Footer { infoRow.classList.add('has-privacy'); } - if (infoColumnLeft.hasChildNodes()) { + if (infoColumnLeft.childElementCount !== 0) { infoRow.append(infoColumnLeft); } - if (infoColumnRight.hasChildNodes()) { + if (infoColumnRight.childElementCount !== 0) { infoRow.append(infoColumnRight); } - if (infoRow.hasChildNodes()) { + if (infoRow.childElementCount !== 0) { wrapper.append(infoRow); } diff --git a/blog/blocks/images/images.js b/blog/blocks/images/images.js index 3de1361..38d52b8 100644 --- a/blog/blocks/images/images.js +++ b/blog/blocks/images/images.js @@ -11,11 +11,11 @@ function buildColumns(rowEl, count) { } export default function decorateImages(blockEl) { - const blockCount = blockEl.firstChild.childElementCount; + const blockCount = blockEl.firstElementChild.childElementCount; if (blockCount > 1) { - buildColumns(blockEl.firstChild, blockCount); + buildColumns(blockEl.firstElementChild, blockCount); } else { - const figEl = buildFigure(blockEl.firstChild.firstChild); + const figEl = buildFigure(blockEl.firstElementChild.firstElementChild); blockEl.innerHTML = ''; blockEl.append(figEl); } diff --git a/blog/blocks/infographic/infographic.js b/blog/blocks/infographic/infographic.js index 0375c0e..39fb780 100644 --- a/blog/blocks/infographic/infographic.js +++ b/blog/blocks/infographic/infographic.js @@ -1,7 +1,7 @@ import { buildFigure } from '../../scripts/scripts.js'; export default function decorateInfographic(blockEl) { - const figEl = buildFigure(blockEl.firstChild.firstChild); + const figEl = buildFigure(blockEl.firstElementChild.firstElementChild); blockEl.prepend(figEl); - blockEl.lastChild.remove(); + blockEl.lastElementChild.remove(); } diff --git a/blog/blocks/interlinks/interlinks.js b/blog/blocks/interlinks/interlinks.js index 6b928ef..ebbb3cb 100644 --- a/blog/blocks/interlinks/interlinks.js +++ b/blog/blocks/interlinks/interlinks.js @@ -64,7 +64,7 @@ export default async function interlink() { const paraWords = p.textContent.split(/\s/).length; const maxParaLinks = Math.floor(paraWords / 40) - paraLinks; if (maxParaLinks > 0) { - Array.from(p.childNodes) + Array.from(p.children) // filter out non text nodes .filter((node) => node.nodeType === Node.TEXT_NODE) .forEach((textNode) => { @@ -91,8 +91,8 @@ export default async function interlink() { a.href = item.URL; a.setAttribute('data-origin', 'interlink'); a.appendChild(document.createTextNode(text.substring(start, end))); - p.insertBefore(a, textNode.nextSibling); - p.insertBefore(document.createTextNode(text.substring(end)), a.nextSibling); + p.insertBefore(a, textNode.nextElementSibling); + p.insertBefore(document.createTextNode(text.substring(end)), a.nextElementSibling); textNode.nodeValue = text.substring(0, start); // remove matched link from interlinks keywords.splice(keywords.indexOf(item), 1); diff --git a/blog/blocks/recommended-articles/recommended-articles.js b/blog/blocks/recommended-articles/recommended-articles.js index 0c2257c..11ef091 100644 --- a/blog/blocks/recommended-articles/recommended-articles.js +++ b/blog/blocks/recommended-articles/recommended-articles.js @@ -30,7 +30,7 @@ async function decorateRecommendedArticles(recommendedArticlesEl, paths) { } } recommendedArticlesEl.closest('.section').classList.add('appear'); - if (!articleCardsContainer.hasChildNodes()) { + if (articleCardsContainer.childElementCount === 0) { recommendedArticlesEl.parentNode.parentNode.remove(); } } diff --git a/blog/blocks/table-of-contents/table-of-contents.js b/blog/blocks/table-of-contents/table-of-contents.js index 7cddb09..a200bfd 100644 --- a/blog/blocks/table-of-contents/table-of-contents.js +++ b/blog/blocks/table-of-contents/table-of-contents.js @@ -14,7 +14,7 @@ export default function decorate($block) { if ($tab.textContent === 'Introduction') { $anchor.href = `${baseUrl}introduction`; $anchor.textContent = 'Introduction'; - target = $block.parentElement.parentElement.previousSibling; + target = $block.parentElement.parentElement.previousElementSibling; } else { $headers.forEach(($header) => { if ($tab.textContent === $header.textContent) { diff --git a/blog/blocks/video/video.js b/blog/blocks/video/video.js index 82ffdaf..fbafd21 100644 --- a/blog/blocks/video/video.js +++ b/blog/blocks/video/video.js @@ -8,13 +8,13 @@ export default function decorate(block) { const a = block.querySelector('a'); const videoSrc = a.href; const video = document.createElement('div'); - const figure = buildFigure(block.firstChild.firstChild); + const figure = buildFigure(block.firstElementChild.firstElementChild); video.classList.add('video-wrapper'); video.innerHTML = ``; block.innerHTML = '
'; - block.firstChild.prepend(video); - block.firstChild.append(figure.querySelector('figcaption')); + block.firstElementChild.prepend(video); + block.firstElementChild.append(figure.querySelector('figcaption')); block.classList.add('is-loaded'); } diff --git a/blog/scripts/scripts.js b/blog/scripts/scripts.js index 1462f2a..34d900d 100644 --- a/blog/scripts/scripts.js +++ b/blog/scripts/scripts.js @@ -668,7 +668,7 @@ function removeStylingFromImages(mainEl) { styledImgEls.forEach((imgEl) => { const parentEl = imgEl.closest('p'); parentEl.prepend(imgEl); - parentEl.lastChild.remove(); + parentEl.lastElementChild.remove(); }); } @@ -679,7 +679,7 @@ function removeStylingFromImages(mainEl) { function getImageCaption(picture) { const parentEl = picture.parentNode; const parentSiblingEl = parentEl.nextElementSibling; - return (parentSiblingEl && parentSiblingEl.firstChild.nodeName === 'EM' ? parentSiblingEl : undefined); + return (parentSiblingEl && parentSiblingEl.firstElementChild.nodeName === 'EM' ? parentSiblingEl : undefined); } /** @@ -787,7 +787,7 @@ function unwrapBlock(block) { const els = [...section.children]; const blockSection = document.createElement('div'); const postBlockSection = document.createElement('div'); - const nextSection = section.nextSibling; + const nextSection = section.nextElementSibling; section.parentNode.insertBefore(blockSection, nextSection); section.parentNode.insertBefore(postBlockSection, nextSection); @@ -799,13 +799,13 @@ function unwrapBlock(block) { appendTo = postBlockSection; } }); - if (!section.hasChildNodes()) { + if (section.childElementCount === 0) { section.remove(); } - if (!blockSection.hasChildNodes()) { + if (blockSection.childElementCount === 0) { blockSection.remove(); } - if (!postBlockSection.hasChildNodes()) { + if (postBlockSection.childElementCount === 0) { postBlockSection.remove(); } } @@ -1500,31 +1500,31 @@ export function buildFigure(blockEl) { const figEl = document.createElement('figure'); figEl.classList.add('figure'); // content is picture only, no caption or link - if (blockEl.firstChild) { - if (blockEl.firstChild.nodeName === 'PICTURE' || blockEl.firstChild.nodeName === 'VIDEO') { - figEl.append(blockEl.firstChild); - } else if (blockEl.firstChild.nodeName === 'P') { + if (blockEl.firstElementChild) { + if (blockEl.firstElementChild.nodeName === 'PICTURE' || blockEl.firstElementChild.nodeName === 'VIDEO') { + figEl.append(blockEl.firstElementChild); + } else if (blockEl.firstElementChild.nodeName === 'P') { const pEls = Array.from(blockEl.children); pEls.forEach((pEl) => { - if (pEl.firstChild) { - if (pEl.firstChild.nodeName === 'PICTURE' || pEl.firstChild.nodeName === 'VIDEO') { - figEl.append(pEl.firstChild); - } else if (pEl.firstChild.nodeName === 'EM') { + if (pEl.firstElementChild) { + if (pEl.firstElementChild.nodeName === 'PICTURE' || pEl.firstElementChild.nodeName === 'VIDEO') { + figEl.append(pEl.firstElementChild); + } else if (pEl.firstElementChild.nodeName === 'EM') { const figCapEl = buildCaption(pEl); figEl.append(figCapEl); - } else if (pEl.firstChild.nodeName === 'A') { + } else if (pEl.firstElementChild.nodeName === 'A') { const picEl = figEl.querySelector('picture'); if (picEl) { - pEl.firstChild.textContent = ''; - pEl.firstChild.append(picEl); + pEl.firstElementChild.textContent = ''; + pEl.firstElementChild.append(picEl); } - figEl.prepend(pEl.firstChild); + figEl.prepend(pEl.firstElementChild); } } }); // catch link-only figures (like embed blocks); - } else if (blockEl.firstChild.nodeName === 'A') { - figEl.append(blockEl.firstChild); + } else if (blockEl.firstElementChild.nodeName === 'A') { + figEl.append(blockEl.firstElementChild); } } return figEl; diff --git a/blog/styles/styles.css b/blog/styles/styles.css index 6a34981..ef19544 100644 --- a/blog/styles/styles.css +++ b/blog/styles/styles.css @@ -49,7 +49,7 @@ --heading-font-size-s: 1.25rem; /* 20px */ --heading-font-size-xs: 1.125rem; /* 18px */ --heading-font-size-xxs: 0.875rem; /* 14px */ - + /* details */ --detail-font-weight: 700; --detail-color: var(--color-gray-600); @@ -85,6 +85,11 @@ body { padding: 0; } +img { + height: auto; + width: auto; +} + /* buttons */ a.button:any-link { @@ -95,7 +100,7 @@ a.button:any-link { /* outline: none; (keep outline for a11n) */ text-align: center; font-size: var(--body-font-size-s); - font-style: normal; + font-style: normal; font-weight: 600; cursor: pointer; color: var(--color-white); @@ -216,7 +221,7 @@ main .container { .heading-container { max-width: var(--body-max-width); margin-left: auto; - margin-right: auto; + margin-right: auto; } .recommended-articles-wrapper .heading-container { @@ -608,4 +613,4 @@ body.appear { .columns { max-width: var(--body-max-width); margin: 0 auto; -} \ No newline at end of file +} From 67d8123b849bdc8060acd132c317e22a341a9c6b Mon Sep 17 00:00:00 2001 From: JC Kautzmann Date: Wed, 30 Nov 2022 11:15:44 +0100 Subject: [PATCH 08/33] upgrade project to helix v7 - remove empty divs --- blog/scripts/scripts.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/blog/scripts/scripts.js b/blog/scripts/scripts.js index 34d900d..08434a5 100644 --- a/blog/scripts/scripts.js +++ b/blog/scripts/scripts.js @@ -820,8 +820,10 @@ function splitSections() { } function removeEmptySections() { - document.querySelectorAll('main > div:empty').forEach((div) => { - div.remove(); + document.querySelectorAll('main > div').forEach((div) => { + if (div.innerHTML.trim() === '') { + div.remove(); + } }); } From d0e39594153b07b4d10a6878c1496928edfa83f5 Mon Sep 17 00:00:00 2001 From: JC Kautzmann Date: Wed, 30 Nov 2022 11:42:28 +0100 Subject: [PATCH 09/33] upgrade project to helix v7 - fix null access --- blog/scripts/scripts.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/blog/scripts/scripts.js b/blog/scripts/scripts.js index 08434a5..75a3230 100644 --- a/blog/scripts/scripts.js +++ b/blog/scripts/scripts.js @@ -679,7 +679,7 @@ function removeStylingFromImages(mainEl) { function getImageCaption(picture) { const parentEl = picture.parentNode; const parentSiblingEl = parentEl.nextElementSibling; - return (parentSiblingEl && parentSiblingEl.firstElementChild.nodeName === 'EM' ? parentSiblingEl : undefined); + return (parentSiblingEl && parentSiblingEl.firstElementChild && parentSiblingEl.firstElementChild.nodeName === 'EM' ? parentSiblingEl : undefined); } /** From 4d1241fa3a70aa64f8fb18a689cba7260b05c076 Mon Sep 17 00:00:00 2001 From: JC Kautzmann Date: Wed, 30 Nov 2022 11:58:05 +0100 Subject: [PATCH 10/33] upgrade project to helix v7 - remove white spaces from textContent --- blog/blocks/article-header/article-header.js | 6 +++--- blog/blocks/example/example.js | 4 ++-- blog/blocks/footer/footer.js | 4 ++-- blog/blocks/gnav/gnav-profile.js | 2 +- blog/blocks/gnav/gnav-search.js | 2 +- blog/blocks/gnav/gnav.js | 10 +++++----- blog/blocks/interlinks/interlinks.js | 4 ++-- blog/blocks/table-of-contents/table-of-contents.js | 6 +++--- blog/blocks/tags/tags.js | 2 +- blog/scripts/delayed.js | 2 +- blog/scripts/scripts.js | 14 +++++++------- tools/fgrep/fgrep.js | 4 ++-- 12 files changed, 30 insertions(+), 30 deletions(-) diff --git a/blog/blocks/article-header/article-header.js b/blog/blocks/article-header/article-header.js index 55b6d06..22d99df 100644 --- a/blog/blocks/article-header/article-header.js +++ b/blog/blocks/article-header/article-header.js @@ -35,8 +35,8 @@ export default async function decorateArticleHeader(blockEl, blockName, document categoryContainer.classList.add('article-category'); const category = categoryContainer.querySelector('p'); const categoryA = document.createElement('a'); - categoryA.textContent = category.textContent; - categoryA.href = `${window.location.origin}${getRootPath()}/tags/${toClassName(category.textContent)}`; + categoryA.textContent = category.textContent.trim(); + categoryA.href = `${window.location.origin}${getRootPath()}/tags/${toClassName(category.textContent.trim())}`; category.innerHTML = ''; category.append(categoryA); // title @@ -49,7 +49,7 @@ export default async function decorateArticleHeader(blockEl, blockName, document // author const author = bylineContainer.firstElementChild.firstElementChild; const authorURL = author.querySelector('a').href; - const authorName = author.textContent; + const authorName = author.textContent.trim(); author.textContent = authorName; author.classList.add('article-author'); // publication date diff --git a/blog/blocks/example/example.js b/blog/blocks/example/example.js index 4c0cdc8..699d13e 100644 --- a/blog/blocks/example/example.js +++ b/blog/blocks/example/example.js @@ -2,8 +2,8 @@ export default function decorate($block) { // turn links into buttons $block.querySelectorAll(':scope a').forEach(($a) => { const $button = document.createElement('button'); - $button.title = $a.title || $a.textContent; - $button.textContent = $a.textContent; + $button.title = $a.title || $a.textContent.trim(); + $button.textContent = $a.textContent.trim(); $button.addEventListener('click', () => { window.location.href = $a.href; }); diff --git a/blog/blocks/footer/footer.js b/blog/blocks/footer/footer.js index c9f6bfb..7e46618 100644 --- a/blog/blocks/footer/footer.js +++ b/blog/blocks/footer/footer.js @@ -81,7 +81,7 @@ class Footer { 'aria-expanded': expanded, 'aria-controls': `${titleId}-menu`, }); - title.textContent = heading.textContent; + title.textContent = heading.textContent.trim(); navItem.append(title); const linksContainer = heading.nextElementSibling; linksContainer.classList = 'footer-nav-item-links'; @@ -197,7 +197,7 @@ class Footer { const privacyWrapper = createTag('div', { class: 'footer-privacy' }); // build privacy copyright text const copyright = createTag('p', { class: 'footer-privacy-copyright' }); - copyright.textContent = copyrightEl.textContent; + copyright.textContent = copyrightEl.textContent.trim(); privacyWrapper.append(copyright); // build privacy links const infoLinks = createTag('ul', { class: 'footer-privacy-links' }); diff --git a/blog/blocks/gnav/gnav-profile.js b/blog/blocks/gnav/gnav-profile.js index d2160b1..f5a7b39 100644 --- a/blog/blocks/gnav/gnav-profile.js +++ b/blog/blocks/gnav/gnav-profile.js @@ -46,7 +46,7 @@ function decorateProfileMenu(blockEl, profileEl, profiles, toggle) { const profileActions = createTag('ul', { class: 'gnav-profile-actions' }); profileHeader.href = decorateProfileLink(accountLink.href, 'account'); - profileHeader.setAttribute('aria-label', accountLink.textContent); + profileHeader.setAttribute('aria-label', accountLink.textContent.trim()); const profileImg = avatarImg.cloneNode(true); const profileName = createTag('p', { class: 'gnav-profile-name' }, displayName); diff --git a/blog/blocks/gnav/gnav-search.js b/blog/blocks/gnav/gnav-search.js index dced0cc..9f7090c 100644 --- a/blog/blocks/gnav/gnav-search.js +++ b/blog/blocks/gnav/gnav-search.js @@ -21,7 +21,7 @@ function decorateCard(hit) { function highlightTextElements(terms, elements) { elements.forEach((e) => { const matches = []; - const txt = e.textContent; + const txt = e.textContent.trim(); terms.forEach((term) => { const offset = txt.toLowerCase().indexOf(term); if (offset >= 0) { diff --git a/blog/blocks/gnav/gnav.js b/blog/blocks/gnav/gnav.js index 36dc19d..d379aca 100644 --- a/blog/blocks/gnav/gnav.js +++ b/blog/blocks/gnav/gnav.js @@ -92,10 +92,10 @@ class Gnav { if (!brandBlock) return null; const brand = brandBlock.querySelector('a'); brand.className = brandBlock.className; - const title = createTag('span', { class: 'gnav-brand-title' }, brand.textContent); + const title = createTag('span', { class: 'gnav-brand-title' }, brand.textContent.trim()); brand.href = makeLinkRelative(brand.href); - brand.setAttribute('aria-label', brand.textContent); + brand.setAttribute('aria-label', brand.textContent.trim()); brand.textContent = ''; if (brand.classList.contains('logo')) { brand.insertAdjacentHTML('afterbegin', BRAND_IMG); @@ -108,7 +108,7 @@ class Gnav { const logo = this.body.querySelector('.adobe-logo a'); logo.href = makeLinkRelative(logo.href); logo.classList.add('gnav-logo'); - logo.setAttribute('aria-label', logo.textContent); + logo.setAttribute('aria-label', logo.textContent.trim()); logo.textContent = ''; logo.insertAdjacentHTML('afterbegin', COMPANY_IMG); return logo; @@ -169,7 +169,7 @@ class Gnav { linkGroups.forEach((linkGroup) => { const image = linkGroup.querySelector('picture'); const anchor = linkGroup.querySelector('p a'); - const title = anchor.textContent; + const title = anchor.textContent.trim(); const subtitle = linkGroup.querySelector('p:last-of-type'); const titleWrapper = createTag('div'); anchor.href = makeLinkRelative(anchor.href); @@ -257,7 +257,7 @@ class Gnav { decorateSearch = () => { const searchBlock = this.body.querySelector('.search'); if (searchBlock) { - const label = searchBlock.querySelector('p').textContent; + const label = searchBlock.querySelector('p').textContent.trim(); const advancedLink = searchBlock.querySelector('a'); const searchEl = createTag('div', { class: 'gnav-search' }); const searchBar = this.decorateSearchBar(label, advancedLink); diff --git a/blog/blocks/interlinks/interlinks.js b/blog/blocks/interlinks/interlinks.js index ebbb3cb..7650d6a 100644 --- a/blog/blocks/interlinks/interlinks.js +++ b/blog/blocks/interlinks/interlinks.js @@ -36,7 +36,7 @@ export default async function interlink() { const resp = await fetch(`${getRootPath()}/keywords.json`); if (articleBody && resp.ok) { const json = await resp.json(); - const articleText = articleBody.textContent.toLowerCase(); + const articleText = articleBody.textContent.trim().toLowerCase(); // set article link limit: 1 every 100 words const articleLinks = articleBody.querySelectorAll('a').length; const articleWords = articleText.split(/\s/).length; @@ -61,7 +61,7 @@ export default async function interlink() { .forEach((p) => { // set paragraph link limit: 1 every 40 words const paraLinks = p.querySelectorAll('a').length; - const paraWords = p.textContent.split(/\s/).length; + const paraWords = p.textContent.trim().split(/\s/).length; const maxParaLinks = Math.floor(paraWords / 40) - paraLinks; if (maxParaLinks > 0) { Array.from(p.children) diff --git a/blog/blocks/table-of-contents/table-of-contents.js b/blog/blocks/table-of-contents/table-of-contents.js index a200bfd..dfa0fc6 100644 --- a/blog/blocks/table-of-contents/table-of-contents.js +++ b/blog/blocks/table-of-contents/table-of-contents.js @@ -11,15 +11,15 @@ export default function decorate($block) { const $anchor = createTag('a', {}, null); let target; - if ($tab.textContent === 'Introduction') { + if ($tab.textContent.trim() === 'Introduction') { $anchor.href = `${baseUrl}introduction`; $anchor.textContent = 'Introduction'; target = $block.parentElement.parentElement.previousElementSibling; } else { $headers.forEach(($header) => { - if ($tab.textContent === $header.textContent) { + if ($tab.textContent.trim() === $header.textContent.trim()) { $anchor.href = `${baseUrl}${$header.id}`; - $anchor.textContent = $tab.textContent; + $anchor.textContent = $tab.textContent.trim(); target = $header; } }); diff --git a/blog/blocks/tags/tags.js b/blog/blocks/tags/tags.js index 94a3cf5..0311c50 100644 --- a/blog/blocks/tags/tags.js +++ b/blog/blocks/tags/tags.js @@ -4,7 +4,7 @@ import { } from '../../scripts/scripts.js'; export default function decorateTags(blockEl) { - const tags = blockEl.textContent.split(', '); + const tags = blockEl.textContent.trim().split(', '); const container = blockEl.querySelector('p'); container.classList.add('tags-container'); container.textContent = ''; diff --git a/blog/scripts/delayed.js b/blog/scripts/delayed.js index 5232ac1..0d6520a 100644 --- a/blog/scripts/delayed.js +++ b/blog/scripts/delayed.js @@ -87,7 +87,7 @@ async function setupLinkTracking() { if (img) { value = img.getAttribute('alt'); } else { - value = a.textContent.substr(0, 64); + value = a.textContent.trim().substr(0, 64); } a.setAttribute('daa-ll', value); } diff --git a/blog/scripts/scripts.js b/blog/scripts/scripts.js index 75a3230..d3de130 100644 --- a/blog/scripts/scripts.js +++ b/blog/scripts/scripts.js @@ -160,7 +160,7 @@ export function readBlockConfig(block) { const cols = [...row.children]; if (cols[1]) { const col = cols[1]; - const name = toClassName(cols[0].textContent); + const name = toClassName(cols[0].textContent.trim()); let value = ''; if (col.querySelector('a')) { const as = [...col.querySelectorAll('a')]; @@ -172,11 +172,11 @@ export function readBlockConfig(block) { } else if (col.querySelector('p')) { const ps = [...col.querySelectorAll('p')]; if (ps.length === 1) { - value = ps[0].textContent; + value = ps[0].textContent.trim(); } else { - value = ps.map((p) => p.textContent); + value = ps.map((p) => p.textContent.trim()); } - } else value = row.children[1].textContent; + } else value = row.children[1].textContent.trim(); config[name] = value; } } @@ -404,7 +404,7 @@ export function normalizeHeadings(el, allowedHeadings) { } } if (level !== 7) { - tag.outerHTML = `${tag.textContent}`; + tag.outerHTML = `${tag.textContent.trim()}`; } } }); @@ -550,7 +550,7 @@ initHlx(); */ export function compliantHeadings() { document.querySelectorAll('h1, h2, h3, h4, h5, h6').forEach((tag) => { - tag.outerHTML = `
${tag.outerHTML}
`; + tag.outerHTML = `
${tag.outerHTML}
`; }); } @@ -1604,7 +1604,7 @@ async function getMetadataJson(path) { meta[name] = value; } }); - meta.h1 = doc.querySelector('h1').textContent; + meta.h1 = doc.querySelector('h1').textContent.trim(); } return (JSON.stringify(meta)); } diff --git a/tools/fgrep/fgrep.js b/tools/fgrep/fgrep.js index 9f0284f..0617e61 100644 --- a/tools/fgrep/fgrep.js +++ b/tools/fgrep/fgrep.js @@ -45,13 +45,13 @@ async function loadSitemap(sitemapURL) { const subSitemaps = [...sitemap.querySelectorAll('sitemap loc')]; for (let i = 0; i < subSitemaps.length; i += 1) { const loc = subSitemaps[i]; - const subSitemapURL = new URL(loc.textContent); + const subSitemapURL = new URL(loc.textContent.trim()); // eslint-disable-next-line no-await-in-loop await loadSitemap(subSitemapURL.pathname); } const urlLocs = sitemap.querySelectorAll('url loc'); urlLocs.forEach((loc) => { - const locURL = new URL(loc.textContent); + const locURL = new URL(loc.textContent.trim()); sitemapURLs.push(locURL.pathname); }); } From 85472aead4b70c63ff369c1ab913c67d51565f20 Mon Sep 17 00:00:00 2001 From: JC Kautzmann Date: Wed, 30 Nov 2022 15:22:28 +0100 Subject: [PATCH 11/33] upgrade project to helix v7 - keep looping DOM nodes --- blog/blocks/interlinks/interlinks.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/blog/blocks/interlinks/interlinks.js b/blog/blocks/interlinks/interlinks.js index 7650d6a..7ef43a9 100644 --- a/blog/blocks/interlinks/interlinks.js +++ b/blog/blocks/interlinks/interlinks.js @@ -64,7 +64,7 @@ export default async function interlink() { const paraWords = p.textContent.trim().split(/\s/).length; const maxParaLinks = Math.floor(paraWords / 40) - paraLinks; if (maxParaLinks > 0) { - Array.from(p.children) + Array.from(p.childNodes) // filter out non text nodes .filter((node) => node.nodeType === Node.TEXT_NODE) .forEach((textNode) => { From f593d5b27f9bc9e781fdfde81a4eda635c326be9 Mon Sep 17 00:00:00 2001 From: JC Kautzmann Date: Wed, 30 Nov 2022 15:47:17 +0100 Subject: [PATCH 12/33] upgrade project to helix v7 - fix linting errors --- blog/blocks/block-helpers.js | 4 ++-- blog/blocks/interlinks/interlinks.js | 3 ++- blog/scripts/canary.js | 1 + blog/scripts/scripts.js | 1 + test/unit/blocks/blocks.test.js | 2 +- tools/importer/glossary_import.js | 22 ++++++++++++---------- 6 files changed, 19 insertions(+), 14 deletions(-) diff --git a/blog/blocks/block-helpers.js b/blog/blocks/block-helpers.js index 7c896bd..bc916dd 100644 --- a/blog/blocks/block-helpers.js +++ b/blog/blocks/block-helpers.js @@ -25,7 +25,7 @@ export const replaceElementType = (el, type) => { * @param {HTMLElement} html the content of the element * @returns {HTMLElement} the element created */ - export function createTag(tag, attributes, html) { +export function createTag(tag, attributes, html) { const el = document.createElement(tag); if (html) { if (html instanceof HTMLElement) { @@ -40,4 +40,4 @@ export const replaceElementType = (el, type) => { }); } return el; -} \ No newline at end of file +} diff --git a/blog/blocks/interlinks/interlinks.js b/blog/blocks/interlinks/interlinks.js index 7ef43a9..c80ed60 100644 --- a/blog/blocks/interlinks/interlinks.js +++ b/blog/blocks/interlinks/interlinks.js @@ -92,7 +92,8 @@ export default async function interlink() { a.setAttribute('data-origin', 'interlink'); a.appendChild(document.createTextNode(text.substring(start, end))); p.insertBefore(a, textNode.nextElementSibling); - p.insertBefore(document.createTextNode(text.substring(end)), a.nextElementSibling); + p.insertBefore(document.createTextNode(text.substring(end)), + a.nextElementSibling); textNode.nodeValue = text.substring(0, start); // remove matched link from interlinks keywords.splice(keywords.indexOf(item), 1); diff --git a/blog/scripts/canary.js b/blog/scripts/canary.js index f8ca7f9..fb132f7 100644 --- a/blog/scripts/canary.js +++ b/blog/scripts/canary.js @@ -1 +1,2 @@ +// eslint-disable-next-line no-unused-vars export default function init(el) {} diff --git a/blog/scripts/scripts.js b/blog/scripts/scripts.js index d3de130..83c72ea 100644 --- a/blog/scripts/scripts.js +++ b/blog/scripts/scripts.js @@ -503,6 +503,7 @@ async function loadLibs() { const { default: list } = await import(`${window.milo.libs.base}/blocks/list.js`); window.milo.libs.blocks = { list }; } catch (e) { + // eslint-disable-next-line no-console console.log('Couldn\'t load libs list'); } } diff --git a/test/unit/blocks/blocks.test.js b/test/unit/blocks/blocks.test.js index b638f25..6d2594a 100644 --- a/test/unit/blocks/blocks.test.js +++ b/test/unit/blocks/blocks.test.js @@ -16,7 +16,7 @@ import { decorateBlock, loadBlock, -} from '../../../scripts/scripts.js'; +} from '../../../blog/scripts/scripts.js'; const ROOT_PATH = '/blog/blocks-test'; diff --git a/tools/importer/glossary_import.js b/tools/importer/glossary_import.js index 8b93e55..1bc9011 100644 --- a/tools/importer/glossary_import.js +++ b/tools/importer/glossary_import.js @@ -36,18 +36,19 @@ const createMetadata = (main, document) => { meta.Tags = 'Glossary'; + // eslint-disable-next-line no-undef const block = WebImporter.Blocks.getMetadataBlock(document, meta); main.append(block); return meta; -} +}; const createColumnsBlock = (main, document) => { const relatedLinks = document.querySelector('.dexter-FlexContainer-Items.dexter-FlexContainer--mobileJustifyCenter.dexter-FlexContainer--mobileAlignItemCenter.dexter-FlexContainer--mobileAlignContentStretch.dexter-FlexContainer--mobileAlignItemContentStart.dexter-FlexContainer--tabletJustifyCenter.dexter-FlexContainer--tabletAlignItemStart.dexter-FlexContainer--desktopJustifyCenter.dexter-FlexContainer--desktopAlignItemStart'); - if(relatedLinks) { + if (relatedLinks) { const paragraphs = relatedLinks.querySelectorAll('p'); - if(paragraphs) { + if (paragraphs) { const columnsBlock = document.createElement('table'); let row = document.createElement('tr'); @@ -77,7 +78,7 @@ const createColumnsBlock = (main, document) => { main.append(columnsBlock); } } -} +}; export default { /** @@ -86,10 +87,12 @@ export default { * @param {HTMLDocument} document The document * @returns {HTMLElement} The root element */ - transformDOM: ({ document, html}) => { + // eslint-disable-next-line no-unused-vars + transformDOM: ({ document, html }) => { // simply return the body, no transformation (yet) + // eslint-disable-next-line no-undef WebImporter.DOMUtils.remove(document, [ - 'header, footer, .modalContainer.static, .xf' + 'header, footer, .modalContainer.static, .xf', ]); const main = document.querySelector('.page'); @@ -106,7 +109,6 @@ export default { * @param {String} url The url of the document being transformed. * @param {HTMLDocument} document The document */ - generateDocumentPath: ({ document, url }) => { - return new URL(url).pathname.replace(/\/$/, ''); - }, -} + // eslint-disable-next-line no-unused-vars + generateDocumentPath: ({ document, url }) => new URL(url).pathname.replace(/\/$/, ''), +}; From 68c8ba5f2be7e91165cf640cca1cd5f03fc822b4 Mon Sep 17 00:00:00 2001 From: JC Kautzmann Date: Wed, 30 Nov 2022 19:05:13 +0100 Subject: [PATCH 13/33] upgrade project to helix v7 - fix linting errors --- blog/scripts/scripts.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/blog/scripts/scripts.js b/blog/scripts/scripts.js index 83c72ea..9a97853 100644 --- a/blog/scripts/scripts.js +++ b/blog/scripts/scripts.js @@ -10,7 +10,7 @@ * governing permissions and limitations under the License. */ -const PRODUCTION_DOMAINS = ['business.adobe.com']; +const PRODUCTION_DOMAINS = ['business.adobe.com']; // /** * log RUM if part of the sample. From efb1329381a904cf491e83cb348797fe40178647 Mon Sep 17 00:00:00 2001 From: JC Kautzmann Date: Wed, 30 Nov 2022 19:06:07 +0100 Subject: [PATCH 14/33] upgrade project to helix v7 - fix linting errors --- blog/scripts/scripts.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/blog/scripts/scripts.js b/blog/scripts/scripts.js index 9a97853..83c72ea 100644 --- a/blog/scripts/scripts.js +++ b/blog/scripts/scripts.js @@ -10,7 +10,7 @@ * governing permissions and limitations under the License. */ -const PRODUCTION_DOMAINS = ['business.adobe.com']; // +const PRODUCTION_DOMAINS = ['business.adobe.com']; /** * log RUM if part of the sample. From 482eb26c25c7abf05b120a3158c167fe26d1b269 Mon Sep 17 00:00:00 2001 From: JC Kautzmann Date: Wed, 30 Nov 2022 19:09:30 +0100 Subject: [PATCH 15/33] upgrade project to helix v7 - fix linting errors --- blog/scripts/scripts.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/blog/scripts/scripts.js b/blog/scripts/scripts.js index 83c72ea..9a97853 100644 --- a/blog/scripts/scripts.js +++ b/blog/scripts/scripts.js @@ -10,7 +10,7 @@ * governing permissions and limitations under the License. */ -const PRODUCTION_DOMAINS = ['business.adobe.com']; +const PRODUCTION_DOMAINS = ['business.adobe.com']; // /** * log RUM if part of the sample. From 4e5a32ef0f3d87b8f51944fc0a432bf28d55aa2d Mon Sep 17 00:00:00 2001 From: JC Kautzmann Date: Thu, 1 Dec 2022 10:56:07 +0100 Subject: [PATCH 16/33] upgrade project to helix v7 - fix linting errors --- .github/workflows/run-tests.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/run-tests.yaml b/.github/workflows/run-tests.yaml index e83b609..3e46b0b 100644 --- a/.github/workflows/run-tests.yaml +++ b/.github/workflows/run-tests.yaml @@ -5,6 +5,7 @@ on: types: [opened, synchronize, reopened, edited] branches: - main + - v7 pull_request_target: types: [opened, synchronize, reopened, edited] From ec5df99effcdd9751cd2b702218d4c5ac06f4d6b Mon Sep 17 00:00:00 2001 From: JC Kautzmann Date: Thu, 1 Dec 2022 11:05:14 +0100 Subject: [PATCH 17/33] upgrade project to helix v7 - fix linting errors --- .github/workflows/run-tests.yaml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/run-tests.yaml b/.github/workflows/run-tests.yaml index 3e46b0b..b98a4fc 100644 --- a/.github/workflows/run-tests.yaml +++ b/.github/workflows/run-tests.yaml @@ -5,7 +5,6 @@ on: types: [opened, synchronize, reopened, edited] branches: - main - - v7 pull_request_target: types: [opened, synchronize, reopened, edited] @@ -20,7 +19,7 @@ jobs: node-version: '12' - run: npm install working-directory: test - - run: npm run lint + - run: git status & npm run lint - run: npm test working-directory: test env: From 57d72acafa06e6ca22b9479204f36a60ee5c600d Mon Sep 17 00:00:00 2001 From: JC Kautzmann Date: Thu, 1 Dec 2022 11:12:02 +0100 Subject: [PATCH 18/33] upgrade project to helix v7 - fix linting errors --- .github/workflows/run-tests.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/run-tests.yaml b/.github/workflows/run-tests.yaml index b98a4fc..d560274 100644 --- a/.github/workflows/run-tests.yaml +++ b/.github/workflows/run-tests.yaml @@ -4,7 +4,7 @@ on: pull_request: types: [opened, synchronize, reopened, edited] branches: - - main + - v7 pull_request_target: types: [opened, synchronize, reopened, edited] From 945d1d4efb4a79b5c03e13bf330183955b0a120a Mon Sep 17 00:00:00 2001 From: JC Kautzmann Date: Thu, 1 Dec 2022 11:15:18 +0100 Subject: [PATCH 19/33] upgrade project to helix v7 - fix linting errors --- .github/workflows/run-tests.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/run-tests.yaml b/.github/workflows/run-tests.yaml index d560274..e83b609 100644 --- a/.github/workflows/run-tests.yaml +++ b/.github/workflows/run-tests.yaml @@ -4,7 +4,7 @@ on: pull_request: types: [opened, synchronize, reopened, edited] branches: - - v7 + - main pull_request_target: types: [opened, synchronize, reopened, edited] @@ -19,7 +19,7 @@ jobs: node-version: '12' - run: npm install working-directory: test - - run: git status & npm run lint + - run: npm run lint - run: npm test working-directory: test env: From 5e5cb3b21c3fe7df2444113c08f5e6ca51526bfb Mon Sep 17 00:00:00 2001 From: JC Kautzmann Date: Thu, 1 Dec 2022 11:21:22 +0100 Subject: [PATCH 20/33] upgrade project to helix v7 - fix linting errors --- .github/workflows/run-tests.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/run-tests.yaml b/.github/workflows/run-tests.yaml index e83b609..8991a17 100644 --- a/.github/workflows/run-tests.yaml +++ b/.github/workflows/run-tests.yaml @@ -13,6 +13,7 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 + - run: git checkout v7 - name: Use Node.js uses: actions/setup-node@v1 with: From da778b0396e60dbb79d56249d38ba3a9f4784c26 Mon Sep 17 00:00:00 2001 From: JC Kautzmann Date: Thu, 1 Dec 2022 11:25:43 +0100 Subject: [PATCH 21/33] upgrade project to helix v7 - fix linting errors --- .github/workflows/run-tests.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/run-tests.yaml b/.github/workflows/run-tests.yaml index 8991a17..e83b609 100644 --- a/.github/workflows/run-tests.yaml +++ b/.github/workflows/run-tests.yaml @@ -13,7 +13,6 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - - run: git checkout v7 - name: Use Node.js uses: actions/setup-node@v1 with: From c186369f4ec848b04a2bcfdcd403b86f50c4e0d6 Mon Sep 17 00:00:00 2001 From: JC Kautzmann Date: Thu, 1 Dec 2022 11:39:24 +0100 Subject: [PATCH 22/33] upgrade project to helix v7 - fix linting errors --- .github/workflows/run-tests.yaml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/run-tests.yaml b/.github/workflows/run-tests.yaml index e83b609..2296e9e 100644 --- a/.github/workflows/run-tests.yaml +++ b/.github/workflows/run-tests.yaml @@ -3,8 +3,6 @@ name: Tests on: pull_request: types: [opened, synchronize, reopened, edited] - branches: - - main pull_request_target: types: [opened, synchronize, reopened, edited] From 0e260618dc1d511431680940712f7fc175a7b893 Mon Sep 17 00:00:00 2001 From: JC Kautzmann Date: Thu, 1 Dec 2022 11:40:59 +0100 Subject: [PATCH 23/33] upgrade project to helix v7 - fix linting errors --- .github/workflows/run-tests.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/run-tests.yaml b/.github/workflows/run-tests.yaml index 2296e9e..65779b2 100644 --- a/.github/workflows/run-tests.yaml +++ b/.github/workflows/run-tests.yaml @@ -10,7 +10,7 @@ jobs: build: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Use Node.js uses: actions/setup-node@v1 with: From 533bd5d7ed8b60a867e452c6f26e4ca70a85b0b4 Mon Sep 17 00:00:00 2001 From: JC Kautzmann Date: Thu, 1 Dec 2022 11:41:26 +0100 Subject: [PATCH 24/33] upgrade project to helix v7 - fix linting errors --- .github/workflows/run-tests.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/run-tests.yaml b/.github/workflows/run-tests.yaml index 65779b2..a8a6aa1 100644 --- a/.github/workflows/run-tests.yaml +++ b/.github/workflows/run-tests.yaml @@ -12,7 +12,7 @@ jobs: steps: - uses: actions/checkout@v3 - name: Use Node.js - uses: actions/setup-node@v1 + uses: actions/setup-node@v3 with: node-version: '12' - run: npm install From 0044babc1f3af9b4a015dfeaeae4881b33741e12 Mon Sep 17 00:00:00 2001 From: JC Kautzmann Date: Thu, 1 Dec 2022 11:43:01 +0100 Subject: [PATCH 25/33] upgrade project to helix v7 - fix linting errors --- .github/workflows/run-tests.yaml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/run-tests.yaml b/.github/workflows/run-tests.yaml index a8a6aa1..e83b609 100644 --- a/.github/workflows/run-tests.yaml +++ b/.github/workflows/run-tests.yaml @@ -3,6 +3,8 @@ name: Tests on: pull_request: types: [opened, synchronize, reopened, edited] + branches: + - main pull_request_target: types: [opened, synchronize, reopened, edited] @@ -10,9 +12,9 @@ jobs: build: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v2 - name: Use Node.js - uses: actions/setup-node@v3 + uses: actions/setup-node@v1 with: node-version: '12' - run: npm install From d30d0071573438a425344f43fbc839d8ebef4cc8 Mon Sep 17 00:00:00 2001 From: JC Kautzmann Date: Thu, 1 Dec 2022 11:44:51 +0100 Subject: [PATCH 26/33] upgrade project to helix v7 - fix linting errors --- test/unit/blocks/blocks.test.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/unit/blocks/blocks.test.js b/test/unit/blocks/blocks.test.js index 6d2594a..9a51d29 100644 --- a/test/unit/blocks/blocks.test.js +++ b/test/unit/blocks/blocks.test.js @@ -16,7 +16,7 @@ import { decorateBlock, loadBlock, -} from '../../../blog/scripts/scripts.js'; +} from '../../../blog/scripts/scripts.js'; // const ROOT_PATH = '/blog/blocks-test'; From bf352eca1a0b6b5a9f3ddfab2c5a19e0d575e85a Mon Sep 17 00:00:00 2001 From: JC Kautzmann Date: Thu, 1 Dec 2022 11:46:53 +0100 Subject: [PATCH 27/33] upgrade project to helix v7 - fix linting errors --- test/unit/blocks/blocks.test.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/unit/blocks/blocks.test.js b/test/unit/blocks/blocks.test.js index 9a51d29..6d2594a 100644 --- a/test/unit/blocks/blocks.test.js +++ b/test/unit/blocks/blocks.test.js @@ -16,7 +16,7 @@ import { decorateBlock, loadBlock, -} from '../../../blog/scripts/scripts.js'; // +} from '../../../blog/scripts/scripts.js'; const ROOT_PATH = '/blog/blocks-test'; From 26918f55cd50d391c932942c40e5ac30abe64cdd Mon Sep 17 00:00:00 2001 From: JC Kautzmann Date: Thu, 1 Dec 2022 11:49:41 +0100 Subject: [PATCH 28/33] upgrade project to helix v7 - fix linting errors --- test/unit/blocks/blocks.test.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/unit/blocks/blocks.test.js b/test/unit/blocks/blocks.test.js index 6d2594a..9a51d29 100644 --- a/test/unit/blocks/blocks.test.js +++ b/test/unit/blocks/blocks.test.js @@ -16,7 +16,7 @@ import { decorateBlock, loadBlock, -} from '../../../blog/scripts/scripts.js'; +} from '../../../blog/scripts/scripts.js'; // const ROOT_PATH = '/blog/blocks-test'; From 59801f4e3221f26adc83c960f814aa5ac6dd0f0e Mon Sep 17 00:00:00 2001 From: JC Kautzmann Date: Thu, 1 Dec 2022 11:58:48 +0100 Subject: [PATCH 29/33] upgrade project to helix v7 - fix linting errors --- test/unit/blocks/blocks.test.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/unit/blocks/blocks.test.js b/test/unit/blocks/blocks.test.js index 9a51d29..6d2594a 100644 --- a/test/unit/blocks/blocks.test.js +++ b/test/unit/blocks/blocks.test.js @@ -16,7 +16,7 @@ import { decorateBlock, loadBlock, -} from '../../../blog/scripts/scripts.js'; // +} from '../../../blog/scripts/scripts.js'; const ROOT_PATH = '/blog/blocks-test'; From 9784c295a34e160ff2b8404076e5ede03b263060 Mon Sep 17 00:00:00 2001 From: JC Kautzmann Date: Thu, 1 Dec 2022 12:01:12 +0100 Subject: [PATCH 30/33] upgrade project to helix v7 - fix linting errors --- test/unit/blocks/blocks.test.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/unit/blocks/blocks.test.js b/test/unit/blocks/blocks.test.js index 6d2594a..9a51d29 100644 --- a/test/unit/blocks/blocks.test.js +++ b/test/unit/blocks/blocks.test.js @@ -16,7 +16,7 @@ import { decorateBlock, loadBlock, -} from '../../../blog/scripts/scripts.js'; +} from '../../../blog/scripts/scripts.js'; // const ROOT_PATH = '/blog/blocks-test'; From d4eaeb1e9e4da61fc8e81c5629a932fe26b957d8 Mon Sep 17 00:00:00 2001 From: JC Kautzmann Date: Thu, 1 Dec 2022 14:00:22 +0100 Subject: [PATCH 31/33] upgrade project to helix v7 - fix linting errors --- blog/blocks/tags/tags.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/blog/blocks/tags/tags.js b/blog/blocks/tags/tags.js index 0311c50..f5ecbdb 100644 --- a/blog/blocks/tags/tags.js +++ b/blog/blocks/tags/tags.js @@ -3,7 +3,7 @@ import { loadTaxonomy, } from '../../scripts/scripts.js'; -export default function decorateTags(blockEl) { +export default function decorateTags(blockEl) { // const tags = blockEl.textContent.trim().split(', '); const container = blockEl.querySelector('p'); container.classList.add('tags-container'); From 08489e8f4973643a49fdaa9bd493c6f031aa5016 Mon Sep 17 00:00:00 2001 From: JC Kautzmann Date: Thu, 1 Dec 2022 14:20:05 +0100 Subject: [PATCH 32/33] upgrade project to helix v7 - fix linting errors --- test/unit/blocks/blocks.test.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/unit/blocks/blocks.test.js b/test/unit/blocks/blocks.test.js index 9a51d29..6d2594a 100644 --- a/test/unit/blocks/blocks.test.js +++ b/test/unit/blocks/blocks.test.js @@ -16,7 +16,7 @@ import { decorateBlock, loadBlock, -} from '../../../blog/scripts/scripts.js'; // +} from '../../../blog/scripts/scripts.js'; const ROOT_PATH = '/blog/blocks-test'; From d531793f8958490aa7799562b780f31beaaa6584 Mon Sep 17 00:00:00 2001 From: JC Kautzmann Date: Thu, 1 Dec 2022 15:43:11 +0100 Subject: [PATCH 33/33] upgrade project to helix v7 - fix linting errors --- blog/scripts/scripts.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/blog/scripts/scripts.js b/blog/scripts/scripts.js index 9a97853..83c72ea 100644 --- a/blog/scripts/scripts.js +++ b/blog/scripts/scripts.js @@ -10,7 +10,7 @@ * governing permissions and limitations under the License. */ -const PRODUCTION_DOMAINS = ['business.adobe.com']; // +const PRODUCTION_DOMAINS = ['business.adobe.com']; /** * log RUM if part of the sample.