From e370c504832c4cd5c0cbfee0688535903fb07dea Mon Sep 17 00:00:00 2001 From: Bryan Deffley Date: Fri, 14 Jun 2024 09:16:28 -0400 Subject: [PATCH] assign getCategory to a variable --- cigaradvisor/scripts/linking-data.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/cigaradvisor/scripts/linking-data.js b/cigaradvisor/scripts/linking-data.js index f99af69..ea6dfea 100644 --- a/cigaradvisor/scripts/linking-data.js +++ b/cigaradvisor/scripts/linking-data.js @@ -127,13 +127,14 @@ function addFAQLdJson() { } export default function addLinkingData() { + const category = getCategory(window.location.pathname); addOrg(document.querySelector('head')); if (window.location.pathname === '/cigaradvisor') { addBlogPosts(); - } else if (window.location.pathname === getCategory(window.location.pathname)) { + } else if (window.location.pathname === category) { addOrUpdateCollection(); window.addEventListener('hashchange', addOrUpdateCollection); - } else if (getCategory(window.location.pathname)) { + } else if (category) { addFAQLdJson(); } }