主题更名为banana

This commit is contained in:
User
2025-10-11 09:48:42 +08:00
parent cf28591b77
commit 68bf6c9654
27 changed files with 133 additions and 252 deletions

View File

@@ -1,4 +1,3 @@
import { execSync } from "node:child_process";
import crypto from "node:crypto";
import fs from "node:fs";
import path from "node:path";
@@ -52,10 +51,10 @@ export function themeInput(outDir: string, themeDir: string, mode: string): { [k
function giteaThemeMetaInfo(nameGroup: string[]): string {
const displayName = nameGroup.map(word => word.charAt(0).toUpperCase() + word.slice(1).toLowerCase()).join(" ");
return `gitea-theme-meta-info{--theme-display-name:"Nanobanana ${displayName}";}`; // 不要省略分号, 也不要追加任何变量, 否则 Gitea 不识别
return `gitea-theme-meta-info{--theme-display-name:"banana ${displayName}";}`; // 不要省略分号, 也不要追加任何变量, 否则 Gitea 不识别
}
const prefix = "theme-nanobanana-";
const prefix = "theme-banana-";
/**
* 生成主题文件
@@ -116,24 +115,5 @@ export function themePlugin(): Plugin {
}
}
},
writeBundle() {
// 上传到服务器
const server = process.env.SSH_SERVER;
const user = process.env.SSH_USER || "root";
const theme_path = process.env.GITEA_THEME_PATH;
if (server && theme_path) {
const cmd = `scp dist/${prefix}*.css ${user}@${server}:${theme_path}`;
console.log("[themePlugin] exec:", cmd);
try {
execSync(cmd, { stdio: "inherit" });
// eslint-disable-next-line @typescript-eslint/no-unused-vars
} catch (_) {
// continue regardless of error
}
} else {
console.log("[themePlugin] no SSH_SERVER or GITEA_THEME_PATH, skip upload");
}
console.log("[themePlugin] exec end.");
},
};
}