From 36bc909482da8f52046f128b559fedfffba38ad7 Mon Sep 17 00:00:00 2001 From: Satya Deep Maheshwari Date: Mon, 18 Sep 2023 10:02:21 +0530 Subject: [PATCH] Removed 'Engineering' (#26) * Removed 'Engineering' --------- Co-authored-by: Satya Deep Maheshwari --- 404.html | 2 +- blocks/finder/finder.css | 52 ------- blocks/finder/finder.js | 255 -------------------------------- helix-sitemap.yaml | 2 +- package-lock.json | 4 +- robots.txt | 2 +- scripts/scripts.js | 8 +- tools/importer/constants.js | 99 ------------- tools/importer/import-header.js | 6 +- tools/importer/import.js | 8 +- tools/sidekick/config.json | 4 +- 11 files changed, 18 insertions(+), 424 deletions(-) delete mode 100644 blocks/finder/finder.css delete mode 100644 blocks/finder/finder.js diff --git a/404.html b/404.html index fb4be5a2..c6d029f1 100644 --- a/404.html +++ b/404.html @@ -54,7 +54,7 @@ const title = document.querySelector('head title'); if (title) { - title.innerHTML = `${placeholders['page-not-found-title-prefix'] + ' – Sunstar Engineering'}` + title.innerHTML = `${placeholders['page-not-found-title-prefix'] + ' – Sunstar'}` } const metaTitle = document.querySelector('meta[property="og:title"]'); diff --git a/blocks/finder/finder.css b/blocks/finder/finder.css deleted file mode 100644 index 18255872..00000000 --- a/blocks/finder/finder.css +++ /dev/null @@ -1,52 +0,0 @@ -.finder .container { - margin: 0 auto; - padding: 20px; -} - -.finder .form-group { - margin-bottom: 10px; -} - -.finder .spinner { - display: none; - margin-top: 20px; - text-align: center; -} - -.finder .spinner::before { - content: ""; - display: inline-block; - width: 40px; - height: 40px; - border-radius: 50%; - border: 4px solid #ccc; - border-top-color: #333; - animation: spin 1s ease-in-out infinite; -} - -@keyframes spin { - to { - transform: rotate(360deg); - } -} - -.finder table { - text-align: center; -} - -.finder table, -th, -td { - border: 1px solid black; - text-align: left; -} - -.finder #valid-links-count { - color: green; - font-weight: bold; -} - -.finder #invalid-links-count { - color: red; - font-weight: bold; -} diff --git a/blocks/finder/finder.js b/blocks/finder/finder.js deleted file mode 100644 index e8164fc4..00000000 --- a/blocks/finder/finder.js +++ /dev/null @@ -1,255 +0,0 @@ -/* eslint-disable no-console */ -import { fetchIndex } from '../../scripts/scripts.js'; - -const cachedResponses = {}; -const brokenLinks = []; - -function template() { - return ` -
-

Site Selector Search

-
-
- - - Few Examples: - - - - - - - - - - - - - -
ItemSelector
Cards Block
.cards
Breadcrumb Block
.breadcrumb
-
- -

Results will appear below

-

For the first search on page load, the search results take time (~ 1 minute) to appear. Subsequent searches would be faster.
-
-
-
-
`; -} - -function replaceIndex(path) { - if (path.endsWith('/index')) { - return path.slice(0, -6); - } - return path; -} -function pathToUrl(path) { - return `${window.location.origin}${replaceIndex(path)}`; -} - -async function fetchHtml(url) { - if (cachedResponses[url]) { - return cachedResponses[url]; - } - const response = await fetch(url); - const html = await response.text(); - cachedResponses[url] = html; - return html; -} - -async function checkURLValidity(url) { - const checkUrl = url.endsWith('/') ? url.slice(0, -1) : url; - try { - const response = await fetch(checkUrl, { - method: 'GET', - redirect: 'follow', - }); - return response.status; - } catch (error) { - console.error(`Error while checking validity of ${checkUrl}: ${error}`); - } - return 0; -} - -function excludeDomain(url) { - const excludedDomains = ['twitter.com', - 'facebook.com', - 'linkedin.com', - 'youtube.com', - 'mailto', - 'tel', - 'javascript', - 'amazon.com', - 'amazon.de', - 'instagram.com', - 'pinterest.com', - 'google.com', - 'www.invest-in-bavaria.com', - 'www.sunstarqais.com', - 'www.u-vix.com', - 'www.tsubamex.co.jp', - 'sunstar.com', - 'kukanjizai.com', - 'www.rinya.maff.go.jp', - 'www.sunstar-kc.jp', - 'www.sho-han.com', - 'www.braking.com', - 'sunstar-braking.com', - 'www.sunstarmoto.com', - 'corp.sunstar-engineering.com', - 'jp.sunstar-engineering.com', - 'store.sunstarqais.com', - 'www.daytona.co.jp', - 'bit.ly', - 'www.risesearch.it']; - - // eslint-disable-next-line no-restricted-syntax - for (const excludedDomain of excludedDomains) { - if (url.includes(excludedDomain)) { - return true; - } - } - return false; -} - -async function checkBrokenLink(link, page) { - if (!excludeDomain(link)) { - // eslint-disable-next-line no-await-in-loop - const respcode = await checkURLValidity(link); - if (respcode !== 200) { - brokenLinks.push({ url: link, respcode }); - console.log(`Broken link: ${link}, ${respcode}`); - document.getElementById('invalid-links-count').textContent = parseInt(document.getElementById('invalid-links-count').textContent, 10) + 1; - const brokenLinkRow = document.createElement('tr'); - - const brokenLinkUrl = document.createElement('td'); - brokenLinkUrl.textContent = link; - brokenLinkRow.appendChild(brokenLinkUrl); - - const brokenLinkRespCode = document.createElement('td'); - brokenLinkRespCode.textContent = respcode; - brokenLinkRow.appendChild(brokenLinkRespCode); - - const brokenLinkPage = document.createElement('td'); - brokenLinkPage.textContent = page; - brokenLinkRow.appendChild(brokenLinkPage); - - document.getElementById('brokenLinksTable').appendChild(brokenLinkRow); - } else { - console.log(`Valid link: ${link}, ${respcode}`); - document.getElementById('valid-links-count').textContent = parseInt(document.getElementById('valid-links-count').textContent, 10) + 1; - } - } -} - -async function checkBrokenLinks(matchingElements, page) { - if (matchingElements && matchingElements.length > 0) { - console.log('>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>'); - console.log('Checking broken links on page:', page); - for (let i = 0; i < matchingElements.length; i += 1) { - const el = matchingElements[i]; - if (el.tagName === 'A') { - // eslint-disable-next-line no-await-in-loop - await checkBrokenLink(el.href, page); - } - } - } -} - -async function searchForElement(url, selector) { - const html = await fetchHtml(url); - const element = document.createElement('div'); - element.innerHTML = html; - - // Modify the selector and condition based on your requirements - const matchingElements = element.querySelectorAll(selector); - checkBrokenLinks(matchingElements, url); - return !!matchingElements && matchingElements.length > 0; -} - -async function filterUrlsWithElement(urls, selector) { - const filteredUrls = []; - - // eslint-disable-next-line no-restricted-syntax - for (const url of urls) { - // eslint-disable-next-line no-await-in-loop - const hasElement = await searchForElement(url, selector); - if (hasElement) { - filteredUrls.push(pathToUrl(url.replace('.plain.html', ''))); - } - } - - return filteredUrls; -} - -async function handleFormSubmit(event, urlList) { - event.preventDefault(); - - const form = event.target; - const input = form.elements.desiredSelector; - const desiredSelector = input.value; - - const container = document.getElementById('resultContainer'); - const brokenLinksContainer = document.createElement('div'); - brokenLinksContainer.classList.add('broken-links'); - const validLinksHeader = document.createElement('h5'); - validLinksHeader.textContent = 'Valid Links Count:'; - const validLinksCount = document.createElement('span'); - validLinksCount.id = 'valid-links-count'; - validLinksCount.textContent = 0; - validLinksHeader.appendChild(validLinksCount); - brokenLinksContainer.appendChild(validLinksHeader); - - const invalidLinksHeader = document.createElement('h5'); - invalidLinksHeader.textContent = 'Invalid Links Count:'; - const invalidLinksCount = document.createElement('span'); - invalidLinksCount.id = 'invalid-links-count'; - invalidLinksCount.textContent = 0; - invalidLinksHeader.appendChild(invalidLinksCount); - brokenLinksContainer.appendChild(invalidLinksHeader); - - const brokenLinksTable = document.createElement('table'); - brokenLinksTable.id = 'brokenLinksTable'; - const brokenLinksTableHeader = document.createElement('thead'); - const brokenLinksTableHeaderRow = document.createElement('tr'); - const brokenLinksTableHeaderCell1 = document.createElement('th'); - brokenLinksTableHeaderCell1.textContent = 'URL'; - const brokenLinksTableHeaderCell2 = document.createElement('th'); - brokenLinksTableHeaderCell2.textContent = 'Response Code'; - const brokenLinksTableHeaderCell3 = document.createElement('th'); - brokenLinksTableHeaderCell3.textContent = 'Page'; - brokenLinksTableHeaderRow.appendChild(brokenLinksTableHeaderCell1); - brokenLinksTableHeaderRow.appendChild(brokenLinksTableHeaderCell2); - brokenLinksTableHeaderRow.appendChild(brokenLinksTableHeaderCell3); - brokenLinksTableHeader.appendChild(brokenLinksTableHeaderRow); - brokenLinksTable.appendChild(brokenLinksTableHeader); - brokenLinksContainer.appendChild(brokenLinksTable); - - container.appendChild(brokenLinksContainer); - const spinner = document.getElementById('spinner'); - spinner.style.display = 'block'; - - const filteredUrls = await filterUrlsWithElement(urlList, desiredSelector); - - const resultList = document.createElement('ul'); - resultList.textContent = 'Filtered URLs:'; - filteredUrls.forEach((url) => { - const li = document.createElement('li'); - const a = document.createElement('a'); - a.href = url; - a.textContent = url; - li.appendChild(a); - resultList.appendChild(li); - }); - container.appendChild(resultList); - spinner.style.display = 'none'; -} - -export default async function decorate(block) { - const index = (await fetchIndex('query-index')).data; - const urlList = index.map((item) => (item.path === '/' ? '/index.plain.html' : `${item.path}.plain.html`)); - block.innerHTML = template(); - block.querySelector('#filterForm').addEventListener('submit', (event) => { - handleFormSubmit(event, urlList); - }); -} diff --git a/helix-sitemap.yaml b/helix-sitemap.yaml index 22c6a508..1b8e3ffa 100644 --- a/helix-sitemap.yaml +++ b/helix-sitemap.yaml @@ -2,7 +2,7 @@ version: 1 auto-generated: true sitemaps: default: - origin: https://www.sunstar-engineering.com + origin: https://www.sunstar.com source: /query-index.json destination: /sitemap.xml lastmod: YYYY-MM-DD \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index fbe7d30a..f36275f4 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,11 +1,11 @@ { - "name": "@sunstar/sunstar-engineering", + "name": "@sunstar/sunstar", "version": "1.0.0", "lockfileVersion": 3, "requires": true, "packages": { "": { - "name": "@sunstar/sunstar-engineering", + "name": "@sunstar/sunstar", "version": "1.0.0", "license": "Apache License 2.0", "devDependencies": { diff --git a/robots.txt b/robots.txt index 9122aca8..10afa3a0 100644 --- a/robots.txt +++ b/robots.txt @@ -13,4 +13,4 @@ Disallow: /**/thankyou Disallow: /search Disallow: /**/search -Sitemap: https://www.sunstar-engineering.com/sitemap.xml +Sitemap: https://www.sunstar.com/sitemap.xml diff --git a/scripts/scripts.js b/scripts/scripts.js index 6150e7d3..be81e20a 100644 --- a/scripts/scripts.js +++ b/scripts/scripts.js @@ -404,10 +404,10 @@ export function getSearchWidget(placeholders, initialVal, searchbox, lang = getL */ export function getEnvType(hostname = window.location.hostname) { const fqdnToEnvType = { - 'sunstar-engineering.com': 'live', - 'www.sunstar-engineering.com': 'live', - 'main--sunstar-engineering--hlxsites.hlx.page': 'preview', - 'main--sunstar-engineering--hlxsites.hlx.live': 'live', + 'sunstar.com': 'live', + 'www.sunstar.com': 'live', + 'main--sunstar--hlxsites.hlx.page': 'preview', + 'main--sunstar--hlxsites.hlx.live': 'live', }; return fqdnToEnvType[hostname] || 'dev'; } diff --git a/tools/importer/constants.js b/tools/importer/constants.js index 9cc1c09a..57ca3ae3 100644 --- a/tools/importer/constants.js +++ b/tools/importer/constants.js @@ -1,103 +1,4 @@ const urls = { - '/news/sunstar-engineering-americas-expanding-operations-in-springboro/': { - publishedDate: '2023-05-10T00:39:34+00:00', - }, - '/news/at-the-hospital-at-school-by-train-photocatalytic-technology-that-suppresses-bacteria-and-viruses-is-active/': { - publishedDate: '2022-01-20T07:33:20+00:00', - }, - '/news/discover-the-formed%E2%80%90in%E2%80%90place-foamed-gasket-fipfg/': { - publishedDate: '2021-12-10T01:31:08+00:00', - }, - '/news/topics-about-sunstar-engineerings-social-contributions-vol-2/': { - publishedDate: '2020-12-18T02:09:21+00:00', - }, - '/news/topics-about-sunstar-engineerings-social-contributions-vol-1/': { - publishedDate: '2020-12-17T08:44:41+00:00', - }, - '/news/launch-of-sunstars-qais-air-03-photocatalytic-deodorization-and-sterilization-system-for-home-use/': { - publishedDate: '2020-08-28T07:12:19+00:00', - }, - '/news/sunstars-photocatalytic-deodorization-and-sterilization-system-is-adopted-for-limited-express-trains-of-west-japan-railway-company/': { - publishedDate: '2020-06-17T07:28:01+00:00', - }, - '/news/20191115/': { - publishedDate: '2019-11-15T09:00:00+00:00', - }, - '/news/20191001/': { - publishedDate: '2019-10-02T10:43:11+00:00', - }, - '/news/20190930/': { - publishedDate: '2019-09-30T00:00:05+00:00', - }, - '/ja/news/%e3%80%8cstay-healthy-stay-safe-%e5%81%a5%e5%ba%b7%e3%81%a7%e3%81%84%e3%82%88%e3%81%86%e3%80%81%e5%85%83%e6%b0%97%e3%81%a7%e3%81%84%e3%82%88%e3%81%86%ef%bc%81%e3%80%8d/': { - publishedDate: '2020-06-01T07:27:02+00:00', - }, - '/ja/news/%e3%82%b5%e3%83%b3%e3%82%b9%e3%82%bf%e3%83%bc%e3%80%81%e3%82%b5%e3%82%b9%e3%83%86%e3%83%8a%e3%83%93%e3%83%aa%e3%83%86%e3%82%a3%e6%b4%bb%e5%8b%95%e3%82%92%e6%8e%a8%e9%80%b2%e3%82%b0%e3%83%ad%e3%83%bc/': { - publishedDate: '2021-03-26T02:01:10+00:00', - }, - '/ja/news/%e3%82%b5%e3%83%b3%e3%82%b9%e3%82%bf%e3%83%bc%e3%80%81%e3%83%87%e3%82%b6%e3%82%a4%e3%83%b3%e6%80%a7%e3%81%ab%e5%84%aa%e3%82%8c%e3%81%9f%e5%ae%b6%e5%ba%ad%e7%94%a8%e9%99%a4%e8%8f%8c%e8%84%b1%e8%87%ad/': { - publishedDate: '2020-08-28T01:00:57+00:00', - }, - '/ja/news/%e3%82%b5%e3%83%b3%e3%82%b9%e3%82%bf%e3%83%bc%e3%80%81%e7%97%85%e9%99%a2%e3%83%bb%e4%bb%8b%e8%ad%b7%e6%96%bd%e8%a8%ad%e5%90%91%e3%81%91%e3%81%aeuv-c%e3%81%a8%e5%85%89%e8%a7%a6%e5%aa%92%e6%90%ad/': { - publishedDate: '2020-10-29T02:08:33+00:00', - }, - '/ja/news/%e3%82%b5%e3%83%b3%e3%82%b9%e3%82%bf%e3%83%bc%e3%80%81jr%e6%9d%b1%e6%97%a5%e6%9c%ac%e3%81%a8kddi%e3%81%8c%e5%89%b5%e8%a8%ad%e3%81%ae%e3%80%8c%e7%a9%ba%e9%96%93%e8%87%aa%e5%9c%a8%e3%82%b3%e3%83%b3/': { - publishedDate: '2021-05-11T08:47:21+00:00', - }, - '/ja/news/%e3%82%b5%e3%83%b3%e3%82%b9%e3%82%bf%e3%83%bc%e3%82%a8%e3%83%b3%e3%82%b8%e3%83%8b%e3%82%a2%e3%83%aa%e3%83%b3%e3%82%b0%e3%82%a2%e3%83%a1%e3%83%aa%e3%82%ab-%e3%82%aa%e3%83%8f%e3%82%a4%e3%82%aa%e5%b7%9e/': { - publishedDate: '2023-05-10T02:59:04+00:00', - }, - '/ja/news/%e3%82%b5%e3%83%b3%e3%82%b9%e3%82%bf%e3%83%bc%e6%8a%80%e7%a0%94%e3%80%81%e4%bd%9c%e6%a5%ad%e6%80%a7%e3%83%bb%e8%80%90%e4%b9%85%e6%80%a7%e3%81%ab%e5%84%aa%e3%82%8c%e3%82%8b2%e6%b6%b2%e6%a7%8b%e9%80%a0/': { - publishedDate: '2021-02-18T01:13:12+00:00', - }, - '/ja/news/%e3%82%b5%e3%83%b3%e3%82%b9%e3%82%bf%e3%83%bc%e6%8a%80%e7%a0%94%e3%80%81%e5%ae%a4%e5%86%85%e7%a9%ba%e6%b0%97%e8%b3%aa%e6%94%b9%e5%96%84%e4%ba%8b%e6%a5%ad%e5%ad%90%e4%bc%9a%e7%a4%be%e3%82%92%e5%90%b8/': { - publishedDate: '2020-12-22T01:01:07+00:00', - }, - '/ja/news/%e3%82%b5%e3%83%b3%e3%82%b9%e3%82%bf%e3%83%bc%e9%99%a4%e8%8f%8c%e8%84%b1%e8%87%ad%e6%a9%9f%e3%80%8cqais-air-01%ef%bc%88%e3%82%af%e3%83%af%e3%82%a4%e3%82%b9%e3%82%a8%e3%82%a2%e3%83%bc%e3%82%bc/': { - publishedDate: '2020-12-16T02:21:57+00:00', - }, - '/ja/news/%e3%83%9a%e3%83%83%e3%83%88%e3%81%ae%e3%83%88%e3%82%a4%e3%83%ac%e8%87%ad%e3%81%ab%e7%9d%80%e7%9b%ae%e3%81%97%e3%81%9f%e9%99%a4%e8%8f%8c%e8%84%b1%e8%87%ad%e6%a9%9f%e3%82%b5%e3%83%b3%e3%82%b9%e3%82%bf/': { - publishedDate: '2022-07-06T04:08:19+00:00', - }, - '/ja/news/%e5%b2%a9%e8%b0%b7%e5%ad%a6%e5%9c%92%e3%81%ae%e7%be%8e%e5%ae%b9%e5%b0%82%e9%96%80%e5%ad%a6%e6%a0%a1%e3%81%b8%e7%a9%ba%e9%96%93%e9%99%a4%e8%8f%8c%e8%84%b1%e8%87%ad%e6%a9%9f%e5%af%84%e8%b4%88/': { - publishedDate: '2022-12-22T01:08:06+00:00', - }, - '/ja/news/%e6%96%b0%e5%9e%8b-%e3%82%b3%e3%83%ad%e3%83%8a%e3%82%a6%e3%82%a4%e3%83%ab%e3%82%b9-%e6%84%9f%e6%9f%93%e6%8b%a1%e5%a4%a7%e3%81%ab%e4%bc%b4%e3%81%86-%e7%b7%8a%e6%80%a5-%e4%ba%8b%e6%85%8b%e5%ae%a3/': { - publishedDate: '2020-04-08T03:56:02+00:00', - }, - '/ja/news/%e6%96%b0%e5%9e%8b%e3%82%b3%e3%83%ad%e3%83%8a%e3%82%a6%e3%82%a4%e3%83%ab%e3%82%b9%e6%84%9f%e6%9f%93%e6%8b%a1%e5%a4%a7%e3%81%ab%e4%bc%b4%e3%81%86%e7%b7%8a%e6%80%a5%e4%ba%8b%e6%85%8b%e5%ae%a3%e8%a8%80/': { - publishedDate: '2020-05-29T05:34:44+00:00', - }, - '/ja/news/%e6%96%b0%e7%99%ba%e5%a3%b2%e3%81%ae%e3%82%b5%e3%83%b3%e3%82%b9%e3%82%bf%e3%83%bc%e3%83%bb%e3%83%a2%e3%83%bc%e3%82%bf%e3%83%bc%e3%82%b5%e3%82%a4%e3%82%af%e3%83%ab%e5%b0%82%e7%94%a8%e3%83%81%e3%82%a7/': { - publishedDate: '2021-04-22T08:05:38+00:00', - }, - '/ja/news/%e6%ad%af%e7%a7%91%e7%8f%be%e5%a0%b4%e3%81%ae%e5%a3%b0%e3%81%ab%e5%bf%9c%e3%81%88%e3%81%9f%e3%83%ab%e3%83%bc%e3%83%9a%e5%af%be%e5%bf%9c%e5%9e%8b%e3%83%95%e3%82%a7%e3%82%a4%e3%82%b9%e3%82%b7%e3%83%bc/': { - publishedDate: '2021-06-10T01:03:30+00:00', - }, - '/ja/news/20200318/': { - publishedDate: '2020-03-18T06:25:00+00:00', - }, - '/ja/news/2023%e5%b9%b4%e5%ba%a6%e6%96%b0%e5%8d%92%e6%8e%a1%e7%94%a8%e3%83%9a%e3%83%bc%e3%82%b8%e3%81%ab%e3%81%a4%e3%81%84%e3%81%a6%e3%81%ae%e3%81%8a%e7%9f%a5%e3%82%89%e3%81%9b/': { - publishedDate: '2022-01-20T04:41:09+00:00', - }, - '/ja/news/jr%e8%a5%bf%e6%97%a5%e6%9c%ac%e3%81%ae%e7%89%b9%e6%80%a5%e5%88%97%e8%bb%8a%e3%81%ab-%e3%82%b5%e3%83%b3%e3%82%b9%e3%82%bf%e3%83%bc%e3%81%ae%e5%85%89%e8%a7%a6%e5%aa%92%e8%84%b1%e8%87%ad%e9%99%a4/': { - publishedDate: '2020-06-17T05:00:00+00:00', - }, - '/cn/news/20200406/': { - publishedDate: '2020-04-06T08:00:00+00:00', - }, - '/de/news/20190930/': { - publishedDate: '2019-09-30T00:00:25+00:00', - }, - '/id/news/20200406/': { - publishedDate: '2020-04-06T08:00:00+00:00', - }, - '/it/news/20200406/': { - publishedDate: '2020-04-06T01:23:30+00:00', - }, - '/th/news/20200406/': { - publishedDate: '2020-04-06T08:00:00+00:00', - }, }; export default urls; diff --git a/tools/importer/import-header.js b/tools/importer/import-header.js index c1547622..ad14ab5e 100644 --- a/tools/importer/import-header.js +++ b/tools/importer/import-header.js @@ -37,7 +37,7 @@ function addTopNav(document) { } else if (el.tagName === 'SPAN' && el.classList.contains('links-social')) { li.textContent = '[social]'; const social = document.createElement('ul'); - const linkedin = '
  • :linkedin:
  • '; + const linkedin = '
  • :linkedin:
  • '; const youtube = '
  • :youtube:
  • '; social.innerHTML = linkedin + youtube; li.append(social); @@ -70,8 +70,8 @@ function addMidNav(document, url) { const midNav = document.querySelector('nav.ss-header-middle'); if (midNav) { midNav.innerHTML = ` - :sunstar-logo: -

    Sunstar Engineering

    + :sunstar-logo: +

    Sunstar

    `; midNav.after(document.createElement('hr')); } diff --git a/tools/importer/import.js b/tools/importer/import.js index 38a65105..86baa0f8 100644 --- a/tools/importer/import.js +++ b/tools/importer/import.js @@ -92,7 +92,7 @@ function addHeroVerticalTabs(doc) { const cells = [['Hero-Vertical-Tabs']]; const heroMenu = doc.createElement('ul'); hero.querySelectorAll('.auto-hero-menu li a').forEach((a) => { - a.href = 'https://main--sunstar-engineering--hlxsites.hlx.live'.concat(a.href).replace(/\/$/, ''); + a.href = 'https://main--sunstar--hlxsites.hlx.live'.concat(a.href).replace(/\/$/, ''); const li = doc.createElement('li'); if (a.classList.contains('active')) { const strong = doc.createElement('strong'); @@ -330,7 +330,7 @@ function createCardsBlockFromSection(document) { const block = [['Cards']]; // create a cards block from the section - const sectionIsCard = section.parentElement.className.includes('wp-block-sunstar-blocks-home-engineering-solution'); + const sectionIsCard = section.parentElement.className.includes('wp-block-sunstar-blocks-home-solution'); if (sectionIsCard) { const contentCards = Array.from(section.children) .filter( @@ -421,7 +421,7 @@ function createImgVariantsBlockFromSection(document) { */ function changeAnchorTags(document) { const aTags = document.querySelectorAll('.news-details a'); - const homepage = 'https://www.sunstar-engineering.com'; + const homepage = 'https://www.sunstar.com'; const basePath = '/'; aTags.forEach((aTag) => { @@ -491,7 +491,7 @@ function getFomattedDate(newsDate) { */ function fixRelativeLinks(document) { document.querySelectorAll('a').forEach((a) => { - const targetDomain = 'https://main--sunstar-engineering--hlxsites.hlx.page'; + const targetDomain = 'https://main--sunstar--hlxsites.hlx.page'; // if the link is relative, make it absolute if (a.href.startsWith('/')) { let link = a.href; diff --git a/tools/sidekick/config.json b/tools/sidekick/config.json index 4ef73303..89883ae6 100644 --- a/tools/sidekick/config.json +++ b/tools/sidekick/config.json @@ -1,6 +1,6 @@ { - "project": "Sunstar engineering", - "host": "main--sunstar-engineering--hlxsites.hlx.live", + "project": "Sunstar", + "host": "main--sunstar--hlxsites.hlx.live", "plugins": [ { "id": "library",