Spaces:
Sleeping
Sleeping
File size: 861 Bytes
ec675f2 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 | import fs from "fs";
export function loadSiteContext(file="stripe.json") {
const data = JSON.parse(
fs.readFileSync(file,"utf-8")
);
return `
REFERENCE WEBSITE:
Title:
${data.title}
Description:
${data.description}
Viewport:
${data.viewport}
LAYOUT STRUCTURE:
${(data.headingsChunks || [])
.flat()
.map((h:any)=>`${h.level}: ${h.text}`)
.join("\n")}
VISUAL SYSTEM:
Colors:
${(data.design?.colors || []).join(", ")}
Fonts:
${(data.design?.fonts || []).join(", ")}
Font Sizes:
${(data.design?.fontSizes || []).join(", ")}
Spacing:
${(data.design?.spacing || []).join(", ")}
Border Radius:
${(data.design?.borderRadius || []).join(", ")}
Gradients:
${(data.design?.gradients || []).join(", ")}
ASSETS:
Images:
${(data.images || []).slice(0,20).join("\n")}
CONTENT:
${(data.textChunks || [data.text])
.slice(0,5)
.join("\n")}
`;
}
|