From f3a6253cc9f20a0fcb7dc8a983ac130cfb20d3aa Mon Sep 17 00:00:00 2001 From: TeshuKatepalli Date: Tue, 5 Dec 2023 11:51:57 +0530 Subject: [PATCH] removed lint issues --- scripts/scripts.js | 2 +- styles/Typo.css | 2 +- templates/Blog/Blog.js | 4 ++-- templates/News/News.js | 6 ++---- 4 files changed, 6 insertions(+), 8 deletions(-) diff --git a/scripts/scripts.js b/scripts/scripts.js index f31767a0..b27b3c5f 100644 --- a/scripts/scripts.js +++ b/scripts/scripts.js @@ -123,7 +123,7 @@ async function decorateNavigation(main) { if (getMetadata('navigation')) { const sidebarElement = main.querySelector('#sidebar'); const navigation = await getSubNavigation(window.location.pathname); - if(navigation) { + if (navigation) { const block = await buildBlock('sidebar-navigation', navigation); sidebarElement.prepend(block); if (document.body.classList.contains('full-width')) { diff --git a/styles/Typo.css b/styles/Typo.css index b6296c0d..cd5d3c02 100644 --- a/styles/Typo.css +++ b/styles/Typo.css @@ -415,7 +415,7 @@ hr { clear: both; display: block; height: 1px; - padding: 1em 0; + margin: 1em 0; } pre { diff --git a/templates/Blog/Blog.js b/templates/Blog/Blog.js index 6abdf7bb..11e8ab63 100644 --- a/templates/Blog/Blog.js +++ b/templates/Blog/Blog.js @@ -68,8 +68,8 @@ function generateTopicBlock(results) { tagCounts[tag.trim()] = (tagCounts[tag.trim()] || 0) + 1; }); }); - const tagCountArray = Object.entries(tagCounts).map(([tag, count]) => ({ title: tag.trim(), count })); - return createSidebar('Topic', tagCountArray, 10); + const tagCArray = Object.entries(tagCounts).map(([tag, count]) => ({ title: tag.trim(), count })); + return createSidebar('Topic', tagCArray, 10); } function generateResultsBlock(articles, currentPage, totalArticles) { diff --git a/templates/News/News.js b/templates/News/News.js index 861f9767..61f32a44 100644 --- a/templates/News/News.js +++ b/templates/News/News.js @@ -67,8 +67,8 @@ function generateTopicBlock(results) { tagCounts[tag.trim()] = (tagCounts[tag.trim()] || 0) + 1; }); }); - const tagCountArray = Object.entries(tagCounts).map(([tag, count]) => ({ title: tag.trim(), count })); - return createSidebar('Topic', tagCountArray, 10); + const tagCArray = Object.entries(tagCounts).map(([tag, count]) => ({ title: tag.trim(), count })); + return createSidebar('Topic', tagCArray, 10); } function generateResultsBlock(articles, currentPage, totalArticles) { @@ -246,13 +246,11 @@ export default async function buildAutoBlocks(block) { } const data = await fetchNewsData(); - console.log(data); let filteredResults = data.filter((item) => { const path = item.path.toLowerCase(); const regex = /^\/about-us\/news\/.*$/; return regex.test(path); }); - console.log(filteredResults); if (filteredResults.length) { filteredResults = filteredResults.sort((ar1, ar2) => ar2.date - ar1.date); }