Skip to content

Commit 7f52658

Browse files
authored
feat: enhance component path handling by removing .md and .json extension (#62)
* feat: enhance component path handling by removing .md and .json extensions * feat: remove .json extension from MCP names in command generation
1 parent 52c743c commit 7f52658

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

docs/js/index-events.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -448,8 +448,9 @@ class IndexPageManager {
448448
generateComponentCard(component) {
449449
// Generate install command - remove .md extension from path
450450
let componentPath = component.path || component.name;
451-
if (componentPath.endsWith('.md')) {
452-
componentPath = componentPath.replace(/\.md$/, '');
451+
// Remove .md or .json extensions from path
452+
if (componentPath.endsWith('.md') || componentPath.endsWith('.json')) {
453+
componentPath = componentPath.replace(/\.(md|json)$/, '');
453454
}
454455
if (componentPath.endsWith('.json')) {
455456
componentPath = componentPath.replace(/\.json$/, '');

docs/js/script.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1504,7 +1504,9 @@ function generateInstallCommand(component) {
15041504
} else if (component.type === 'command') {
15051505
return `npx claude-code-templates@latest --command=${component.name} --yes`;
15061506
} else if (component.type === 'mcp') {
1507-
return `npx claude-code-templates@latest --mcp=${component.name} --yes`;
1507+
// Remove .json extension from MCP names for the command
1508+
const mcpName = component.name.replace(/\.json$/, '');
1509+
return `npx claude-code-templates@latest --mcp=${mcpName} --yes`;
15081510
}
15091511
return `npx claude-code-templates@latest`;
15101512
}

0 commit comments

Comments
 (0)