fix
This commit is contained in:
+26
-1
@@ -311,7 +311,32 @@ export const deploy = {
|
||||
console.error(`[ERROR] JSON content preview:`, metadataStr.substring(0, 200));
|
||||
throw new Error(`Invalid JSON in metadata.json: ${jsonError.message}`);
|
||||
}
|
||||
} else if (entry.filename.startsWith('public/')) {
|
||||
}
|
||||
else if (entry.filename === 'content/layout-content-trees.json') {
|
||||
//inject content_tree to layouts
|
||||
const layoutContentTrees = JSON.parse(new TextDecoder().decode(fileContent));
|
||||
for (const layout of g.deploy.content.layouts) {
|
||||
layout.content_tree = layoutContentTrees[layout.id];
|
||||
}
|
||||
console.log(`[DEBUG] ✓ Injected content_tree to ${g.deploy.content.layouts.length} layouts`);
|
||||
}
|
||||
else if(entry.filename === 'content/page-content-trees.json') {
|
||||
//inject content_tree to pages
|
||||
const pageContentTrees = JSON.parse(new TextDecoder().decode(fileContent));
|
||||
for (const page of g.deploy.content.pages) {
|
||||
page.content_tree = pageContentTrees[page.id];
|
||||
}
|
||||
console.log(`[DEBUG] ✓ Injected content_tree to ${g.deploy.content.pages.length} pages`);
|
||||
}
|
||||
else if(entry.filename === 'content/component-content-trees.json') {
|
||||
//inject content_tree to components
|
||||
const componentContentTrees = JSON.parse(new TextDecoder().decode(fileContent));
|
||||
for (const comp of g.deploy.content.comps) {
|
||||
comp.content_tree = componentContentTrees[comp.id];
|
||||
}
|
||||
console.log(`[DEBUG] ✓ Injected content_tree to ${g.deploy.content.comps.length} components`);
|
||||
}
|
||||
else if (entry.filename.startsWith('public/')) {
|
||||
const relativePath = entry.filename.slice(7); // Remove 'public/' prefix
|
||||
const binaryExtensions = ['.jpg', '.jpeg', '.png', '.gif', '.ico', '.svg', '.woff', '.woff2', '.ttf', '.eot', '.js', '.css', '.map'];
|
||||
const isBinary = binaryExtensions.some(ext => relativePath.toLowerCase().endsWith(ext));
|
||||
|
||||
Reference in New Issue
Block a user