Skip to content

Commit c675820

Browse files
MathieuPuechdaKmoR
authored andcommitted
fix: windows path issue avoid filtering of index section of collections
1 parent f4a0ab5 commit c675820

File tree

3 files changed

+8
-1
lines changed

3 files changed

+8
-1
lines changed

.changeset/thirty-turkeys-own.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@rocket/cli': patch
3+
---
4+
5+
fix: windows path issue avoid filtering of index section of collections

packages/cli/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@
7373
"fs-extra": "^9.0.1",
7474
"micromatch": "^4.0.2",
7575
"plugins-manager": "^0.2.1",
76+
"slash": "^3.0.0",
7677
"utf8": "^3.0.0"
7778
},
7879
"types": "dist-types/index.d.ts"

packages/cli/src/eleventy-plugins/rocketCollections.cjs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
const path = require('path');
22
const fs = require('fs');
3+
const slash = require('slash');
34
const { readdirSync } = require('fs');
45

56
function getDirectories(source) {
@@ -23,7 +24,7 @@ const rocketCollections = {
2324
let docs = [
2425
...collection.getFilteredByGlob(`${_inputDirCwdRelative}/${section}/**/*.md`),
2526
];
26-
docs = docs.filter(page => page.inputPath !== `./${indexSection}`);
27+
docs = docs.filter(page => page.inputPath !== `./${slash(indexSection)}`);
2728

2829
return docs;
2930
});

0 commit comments

Comments
 (0)