fix(builder): robustecer carga local de elementor en windows

This commit is contained in:
komkida91
2026-02-12 19:03:21 +01:00
parent 6aad246fbc
commit 06d4781dc6
5 changed files with 978 additions and 1684 deletions

View File

@@ -22,8 +22,8 @@ def scan_available_themes():
continue
try:
with open(config_path, 'r', encoding='utf-8') as f:
config = json.load(f)
with open(config_path, 'r', encoding='utf-8-sig') as f:
config = json.load(f)
themes[theme_dir] = {
'id': theme_dir,
@@ -37,9 +37,9 @@ def scan_available_themes():
'features': config.get('features', {}),
'preview': f'/themes/{theme_dir}/preview.jpg' if os.path.exists(os.path.join(theme_path, 'preview.jpg')) else None
}
except Exception as e:
print(f"⚠️ Error cargando template {theme_dir}: {e}")
continue
except Exception as e:
print(f"WARNING: Error cargando template {theme_dir}: {e}")
continue
return themes
@@ -50,11 +50,11 @@ def get_theme_config(theme_id):
return None
try:
with open(config_path, 'r', encoding='utf-8') as f:
return json.load(f)
except Exception as e:
print(f"⚠️ Error cargando config de {theme_id}: {e}")
return None
with open(config_path, 'r', encoding='utf-8-sig') as f:
return json.load(f)
except Exception as e:
print(f"WARNING: Error cargando config de {theme_id}: {e}")
return None
def get_themes_by_rubro(rubro, user_plan='base'):
"""Obtener templates filtrados por rubro y plan del usuario"""
@@ -126,8 +126,8 @@ def render_gkachele_template(theme, content, site_id=None, user_id=None):
try:
menus = get_site_menus(site_id, user_id)
widgets = get_site_widgets(site_id, user_id)
except Exception as e:
print(f"⚠️ Error obteniendo menús/widgets: {e}")
except Exception as e:
print(f"WARNING: Error obteniendo menus/widgets: {e}")
theme_template = ''
theme_path = os.path.join(THEMES_DIR, theme, 'template.html')