Skip to content

Commit 55de087

Browse files
11ty build: Fix platform separator (#4720)
1 parent c3a8202 commit 55de087

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

11ty/guidelines.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { glob } from "glob";
44
import pick from "lodash-es/pick";
55

66
import { readFile } from "fs/promises";
7-
import { basename, join } from "path";
7+
import { basename, join, sep } from "path";
88

99
import { flattenDomFromFile, load, loadFromFile, type CheerioAnyNode } from "./cheerio";
1010
import { generateId } from "./common";
@@ -52,7 +52,7 @@ async function resolveScVersions(version: WcagVersion) {
5252
const map: Record<string, WcagVersion> = {};
5353

5454
for (const path of paths) {
55-
const [fileVersion, filename] = path.split("/");
55+
const [fileVersion, filename] = path.split(sep);
5656
assertIsWcagVersion(fileVersion);
5757
const slug = basename(filename, ".html");
5858
map[slug in scSlugOverrides ? scSlugOverrides[slug] : slug] = fileVersion;

11ty/techniques.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import lowerFirst from "lodash-es/lowerFirst";
55
import uniqBy from "lodash-es/uniqBy";
66

77
import { readFile } from "fs/promises";
8-
import { basename } from "path";
8+
import { basename, sep } from "path";
99

1010
import type {
1111
UnderstandingAssociatedTechniqueArray,
@@ -334,7 +334,7 @@ export async function getTechniquesByTechnology(guidelines: FlatGuidelinesMap) {
334334
}
335335

336336
for (const path of paths) {
337-
const [technology, filename] = path.split("/");
337+
const [technology, filename] = path.split(sep);
338338
assertIsTechnology(technology);
339339
// Support front-matter within HTML files
340340
const { content, data: frontMatterData } = matter(await readFile(`techniques/${path}`, "utf8"));

0 commit comments

Comments
 (0)