mirror of
https://github.com/pbakaus/impeccable.git
synced 2026-09-19 17:46:36 +03:00
Add tabbed case studies, CLAUDE.md, and various improvements
- Convert "See It In Action" section to tabbed interface for space efficiency - Add CLAUDE.md with project instructions for CSS build process - Update README with additional documentation - Enhance glass terminal component - Add new API handlers and server routes Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.5
parent
0b9c1846a6
commit
af21bf2d34
@@ -3,6 +3,7 @@ import homepage from "../public/index.html";
|
||||
import {
|
||||
getSkills,
|
||||
getCommands,
|
||||
getCommandSource,
|
||||
getPatterns,
|
||||
handleFileDownload,
|
||||
handleBundleDownload
|
||||
@@ -49,6 +50,16 @@ const server = serve({
|
||||
},
|
||||
},
|
||||
|
||||
// API: Get command source content
|
||||
"/api/command-source/:id": async (req) => {
|
||||
const { id } = req.params;
|
||||
const content = await getCommandSource(id);
|
||||
if (!content) {
|
||||
return Response.json({ error: "Command not found" }, { status: 404 });
|
||||
}
|
||||
return Response.json({ content });
|
||||
},
|
||||
|
||||
// API: Download individual file
|
||||
"/api/download/:type/:provider/:id": async (req) => {
|
||||
const { type, provider, id } = req.params;
|
||||
|
||||
@@ -72,6 +72,23 @@ export async function getCommands() {
|
||||
return commands;
|
||||
}
|
||||
|
||||
// Get command source content
|
||||
export async function getCommandSource(id) {
|
||||
const sourceDir = join(PROJECT_ROOT, "source");
|
||||
const commandPath = join(sourceDir, "commands", `${id}.md`);
|
||||
|
||||
try {
|
||||
if (!existsSync(commandPath)) {
|
||||
return null;
|
||||
}
|
||||
const content = await readFileContent(commandPath);
|
||||
return content;
|
||||
} catch (error) {
|
||||
console.error("Error reading command source:", error);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
// Get the appropriate file path for a provider
|
||||
export function getFilePath(type, provider, id) {
|
||||
const distDir = join(PROJECT_ROOT, "dist");
|
||||
|
||||
Reference in New Issue
Block a user