From 7a52ddeba2a68388b544f529d2d92104420f77b0 Mon Sep 17 00:00:00 2001 From: Shipwreckt Date: Fri, 31 Oct 2025 20:02:14 +0000 Subject: Changed from static to 11ty! --- .../@11ty/eleventy/src/Util/PathPrefixer.js | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 node_modules/@11ty/eleventy/src/Util/PathPrefixer.js (limited to 'node_modules/@11ty/eleventy/src/Util/PathPrefixer.js') diff --git a/node_modules/@11ty/eleventy/src/Util/PathPrefixer.js b/node_modules/@11ty/eleventy/src/Util/PathPrefixer.js new file mode 100644 index 0000000..abd5582 --- /dev/null +++ b/node_modules/@11ty/eleventy/src/Util/PathPrefixer.js @@ -0,0 +1,21 @@ +import path from "node:path"; + +import PathNormalizer from "./PathNormalizer.js"; + +class PathPrefixer { + static normalizePathPrefix(pathPrefix) { + if (pathPrefix) { + // add leading / (for browsersync), see #1454 + // path.join uses \\ for Windows so we split and rejoin + return PathPrefixer.joinUrlParts("/", pathPrefix); + } + + return "/"; + } + + static joinUrlParts(...parts) { + return PathNormalizer.normalizeSeperator(path.join(...parts)); + } +} + +export default PathPrefixer; -- cgit v1.2.3