Skip to content

Commit b66d4bc

Browse files
CopilotTechQuery
andcommitted
Make pageListOf function generic - remove hardcoded PPT logic and delete package-lock.json
Co-authored-by: TechQuery <19969570+TechQuery@users.noreply.github.com>
1 parent 33cc339 commit b66d4bc

File tree

3 files changed

+15
-23
lines changed

3 files changed

+15
-23
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
/node_modules
55
/.pnp
66
.pnp.js
7+
package-lock.json
78

89
# testing
910
/coverage

package-lock.json

Lines changed: 12 additions & 12 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pages/api/core.ts

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -96,17 +96,8 @@ export async function* pageListOf(path: string, prefix = 'pages'): AsyncGenerato
9696
}
9797
yield article;
9898
} else if (node.isFile() && !isMDX) {
99-
// Handle non-Markdown files - link them to GitHub raw proxy
100-
let proxyPath = path;
101-
102-
// Check if this is in the PPT submodule directory
103-
if (path.startsWith('/article/PPT/')) {
104-
// Remove /article/PPT prefix and create GitHub raw proxy link
105-
const relativePath = path.replace('/article/PPT/', '');
106-
proxyPath = `/proxy/raw.githubusercontent.com/FreeCodeCamp-Chengdu/Activity_PPT/main/${relativePath}`;
107-
}
108-
109-
const article: ArticleMeta = { name: node.name, path: proxyPath, subs: [] };
99+
// Handle non-Markdown files generically
100+
const article: ArticleMeta = { name: node.name, path, subs: [] };
110101
yield article;
111102
} else if (node.isDirectory()) {
112103
const subs = await Array.fromAsync(pageListOf(path, prefix));

0 commit comments

Comments
 (0)