[CMS-VISUAL] E 激进清场: 下架 10 套伪主题(tag themes-before-cleanup-2026-09 + docs/主题备份/ 双备份)→ 保留 default/scholar-blue/campus-glow 三套;色皮档并入 default.colorScheme、克隆档并入 scholar-blue.colorScheme(ThemeParam.presets + ThemeVarsCss 变量组注入);别名表 R-46 映射(渲染端不断渲染 + 保存归一化 + 站点级 theme_params.colorScheme)
This commit is contained in:
@@ -44,6 +44,44 @@ public class ThemeRegistry {
|
||||
public static final String SOURCE_BUILTIN = "builtin";
|
||||
public static final String SOURCE_EXTERNAL = "external";
|
||||
|
||||
/**
|
||||
* docs/20 E(激进清场)下架主题别名表:原主题名 → [保留主题, colorScheme 预设值]。
|
||||
* 存量站点 theme 仍写下架名时按本表解析(R-46:门户不断渲染,不 404);
|
||||
* 站点下次保存时由 SiteService 归一化为保留主题 + config.theme_params.colorScheme。
|
||||
*/
|
||||
private static final java.util.Map<String, String[]> DEPRECATED_ALIASES = java.util.Collections.unmodifiableMap(
|
||||
new java.util.LinkedHashMap<String, String[]>() {{
|
||||
// 色皮档 4 套 → default 预设
|
||||
put("blue-white", new String[] {DEFAULT_THEME, "blue-white"});
|
||||
put("classic-red", new String[] {DEFAULT_THEME, "classic-red"});
|
||||
put("fresh-mint", new String[] {DEFAULT_THEME, "fresh-mint"});
|
||||
put("warm-kinder", new String[] {DEFAULT_THEME, "warm-kinder"});
|
||||
// 骨架克隆档 6 套 → scholar-blue 预设
|
||||
put("academic-navy", new String[] {"scholar-blue", "navy"});
|
||||
put("campus-azure", new String[] {"scholar-blue", "azure"});
|
||||
put("poly-blue", new String[] {"scholar-blue", "poly"});
|
||||
put("agri-forest", new String[] {"scholar-blue", "agri"});
|
||||
put("jade-normal", new String[] {"scholar-blue", "jade"});
|
||||
put("mint-breeze", new String[] {"scholar-blue", "mint"});
|
||||
}});
|
||||
|
||||
/** 下架别名解析结果:target=保留主题名;colorScheme=对应预设值(可能为 null) */
|
||||
public static final class AliasInfo {
|
||||
public final String target;
|
||||
public final String colorScheme;
|
||||
|
||||
AliasInfo(String target, String colorScheme) {
|
||||
this.target = target;
|
||||
this.colorScheme = colorScheme;
|
||||
}
|
||||
}
|
||||
|
||||
/** 下架别名解析:非别名返回 null */
|
||||
public static AliasInfo aliasOf(String name) {
|
||||
String[] mapped = name == null ? null : DEPRECATED_ALIASES.get(name);
|
||||
return mapped == null ? null : new AliasInfo(mapped[0], mapped[1]);
|
||||
}
|
||||
|
||||
/** 包名与目录名约束(方案 §4.1) */
|
||||
private static final Pattern NAME_PATTERN = Pattern.compile("^[a-z][a-z0-9-]{1,30}[a-z0-9]$");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user