diff --git a/lib/aggregator.ts b/lib/aggregator.ts index b548137..a05c0f8 100644 --- a/lib/aggregator.ts +++ b/lib/aggregator.ts @@ -54,7 +54,14 @@ import { ytVideoMeta, } from "./utilities"; -import { basename, dirname, join, relative, resolve } from "node:path"; +import { + basename, + dirname, + join, + relative, + resolve, + sep, +} from "node:path"; import { cwd } from "node:process"; import configurations from "../configLoader"; @@ -199,7 +206,7 @@ export function breadCrumb(htmlPath: string): breadCrumbListOptions { const relativePath: string = relative(cwd(), htmlPath); /* path branches in chronological order */ - const pathTree: string[] = relativePath.split("\\"); + const pathTree: string[] = relativePath.split(sep); /* check if input htmlpath is index.html */ const sourceIsIndex: boolean = basename(htmlPath) === "index.html"; @@ -218,7 +225,7 @@ export function breadCrumb(htmlPath: string): breadCrumbListOptions { /* assume in first iteration file always exist so skip existance check */ if (firstIteration) { - let itemUrl: string = pathTree.join("\\"); + let itemUrl: string = pathTree.join(sep); const preserveBasename: boolean = sourceIsIndex ? false : true; @@ -241,7 +248,7 @@ export function breadCrumb(htmlPath: string): breadCrumbListOptions { } else { //check if index html is available for each levels // L1/L2 => L1/L2/index.html - const requiredFile: string = pathTree.join("\\") + "\\index.html"; + const requiredFile: string = pathTree.join(sep) + `${sep}index.html`; if (existsSync(requiredFile)) { const listItem: breadCrumbMeta = generateMeta( diff --git a/test/outputs/OP_Of_(17) productCombined.html b/test/outputs/OP_Of_(17) productCombined.html index 9a3debe..31b6332 100644 --- a/test/outputs/OP_Of_(17) productCombined.html +++ b/test/outputs/OP_Of_(17) productCombined.html @@ -13,7 +13,7 @@ "description": "Product Description Lorem ipsum dolor sit amet, consectetur adipiscing elit.", "url": "https://www.cresteem.com/test/test-sample/productVarient/productCombined", "brand": { "@type": "Brand", "name": "XYZ Brand" }, - "productGroupID": "a906d5c79402ec5b1d5600748a76796e", + "productGroupID": "80369227d029366a68317844038f619a", "variesBy": ["color", "suggestedAge", "suggestedGender"], "hasVariant": [ { diff --git a/test/outputs/OP_Of_(3) recipies.html b/test/outputs/OP_Of_(3) recipies.html index 8dd3709..52fcdf5 100644 --- a/test/outputs/OP_Of_(3) recipies.html +++ b/test/outputs/OP_Of_(3) recipies.html @@ -101,7 +101,7 @@ "interactionStatistic": { "@type": "InteractionCounter", "interactionType": { "@type": "WatchAction" }, - "userInteractionCount": 36005270 + "userInteractionCount": 36005520 }, "expires": "3020-05-16T11:00:00+05:30" } @@ -168,7 +168,7 @@ "interactionStatistic": { "@type": "InteractionCounter", "interactionType": { "@type": "WatchAction" }, - "userInteractionCount": 804942 + "userInteractionCount": 804932 }, "expires": "3023-06-29T12:51:52+05:30" } diff --git a/test/outputs/OP_Of_(4) recipies.html b/test/outputs/OP_Of_(4) recipies.html index ff70eb3..b416aa2 100644 --- a/test/outputs/OP_Of_(4) recipies.html +++ b/test/outputs/OP_Of_(4) recipies.html @@ -96,7 +96,7 @@ "interactionStatistic": { "@type": "InteractionCounter", "interactionType": { "@type": "WatchAction" }, - "userInteractionCount": 36005270 + "userInteractionCount": 36005520 }, "expires": "3020-05-16T11:00:00+05:30" }