Skip to content

Commit

Permalink
generate card
Browse files Browse the repository at this point in the history
  • Loading branch information
JonnyBurger committed Jan 13, 2025
1 parent 0d5b39f commit 5a921b4
Show file tree
Hide file tree
Showing 3 changed files with 156 additions and 156 deletions.
30 changes: 15 additions & 15 deletions packages/docs/get-pages.mjs
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
import fs from "fs";
import path from "path";
import fs from 'fs';
import path from 'path';

export const readDir = (dir, pages = []) => {
const docs = fs.readdirSync(dir);
for (const doc of docs) {
const stat = fs.statSync(path.join(dir, doc));
if (stat.isDirectory()) {
readDir(path.join(dir, doc), pages);
} else if (stat.isFile()) {
if (doc.includes("redirect")) {
continue;
}
const docs = fs.readdirSync(dir);
for (const doc of docs) {
const stat = fs.statSync(path.join(dir, doc));
if (stat.isDirectory()) {
readDir(path.join(dir, doc), pages);
} else if (stat.isFile()) {
if (doc.includes('redirect')) {
continue;
}

pages.push(path.join(dir, doc));
}
}
pages.push(path.join(dir, doc));
}
}

return pages;
return pages.sort((a, b) => a.localeCompare(b));
};
Loading

0 comments on commit 5a921b4

Please sign in to comment.