mirror of
https://github.com/lutinglt/gitea-github-theme.git
synced 2026-04-13 23:11:37 +08:00
Compare commits
4 Commits
d27376a800
...
v1.25.3
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
de0cac06b2 | ||
|
|
bd7899114b | ||
|
|
9c67ea1697 | ||
|
|
4a60775c32 |
@@ -14,5 +14,5 @@ trim_trailing_whitespace = true
|
||||
max_line_length = 120
|
||||
|
||||
# documentation, utils
|
||||
[*.{md,mdx,diff}]
|
||||
[*.{md,diff}]
|
||||
trim_trailing_whitespace = false
|
||||
|
||||
2
.github/workflows/build.yml
vendored
2
.github/workflows/build.yml
vendored
@@ -26,7 +26,7 @@ jobs:
|
||||
id: build
|
||||
if: steps.changes.outputs.src == 'true'
|
||||
run: |
|
||||
npm install
|
||||
npm run install:vite8
|
||||
npm run build
|
||||
|
||||
- name: Upload css assets
|
||||
|
||||
2
.github/workflows/release.yml
vendored
2
.github/workflows/release.yml
vendored
@@ -13,7 +13,7 @@ jobs:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Build theme
|
||||
run: |
|
||||
npm install
|
||||
npm run install:vite8
|
||||
npm run release
|
||||
- name: Create release
|
||||
run: |
|
||||
|
||||
2
.vscode/settings.json
vendored
2
.vscode/settings.json
vendored
@@ -1,3 +1,3 @@
|
||||
{
|
||||
"typescript.experimental.useTsgo": true
|
||||
"typescript.experimental.useTsgo": false
|
||||
}
|
||||
@@ -4,7 +4,8 @@
|
||||
|
||||
- Optimize the selection style of items in the menu.
|
||||
- Optimize code block styles.
|
||||
- Optimize some element styles on Issue/PR page
|
||||
- Optimize some element styles on Issue/PR page.
|
||||
- Optimize the width of the left side of the workflow details page in different zoom levels.
|
||||
|
||||
##### Template File
|
||||
|
||||
|
||||
@@ -1,15 +1,14 @@
|
||||
import js from "@eslint/js";
|
||||
import { defineConfig } from "eslint/config";
|
||||
import globals from "globals";
|
||||
import tseslint from "typescript-eslint";
|
||||
|
||||
export default tseslint.config(
|
||||
{ ignores: ["dist"] },
|
||||
{
|
||||
extends: [js.configs.recommended, ...tseslint.configs.recommended],
|
||||
files: ["**/*.{ts}"],
|
||||
languageOptions: {
|
||||
ecmaVersion: 2020,
|
||||
globals: globals.browser,
|
||||
},
|
||||
}
|
||||
);
|
||||
export default defineConfig({
|
||||
ignores: ["dist"],
|
||||
extends: [js.configs.recommended, ...tseslint.configs.recommended],
|
||||
files: ["**/*.{ts}"],
|
||||
languageOptions: {
|
||||
ecmaVersion: 2020,
|
||||
globals: globals.browser,
|
||||
},
|
||||
});
|
||||
|
||||
@@ -120,6 +120,13 @@
|
||||
{{svg "octicon-question"}}
|
||||
{{ctx.Locale.Tr "help"}}
|
||||
</a>
|
||||
{{if .IsAdmin}}
|
||||
<div class="divider"></div>
|
||||
<a class="{{if .PageIsAdmin}}active {{end}}item" href="{{AppSubUrl}}/-/admin">
|
||||
{{svg "octicon-server"}}
|
||||
{{ctx.Locale.Tr "admin_panel"}}
|
||||
</a>
|
||||
{{end}}
|
||||
<div class="divider"></div>
|
||||
<a class="item link-action" href data-url="{{AppSubUrl}}/user/logout">
|
||||
{{svg "octicon-sign-out"}}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "gitea-github-theme",
|
||||
"version": "1.25.3.rc",
|
||||
"version": "1.25.3",
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"dev": "vite build --mode dev",
|
||||
@@ -10,8 +10,10 @@
|
||||
"commit": "npm run lint && npm run format && npm run build",
|
||||
"version": "node scripts/version.cjs",
|
||||
"tr": "node scripts/translate.cjs",
|
||||
"tmpl": "node scripts/update_template.cjs",
|
||||
"release": "npm run build && npm run tr",
|
||||
"install:clean": "npm cache clean --force && rm -rf node_modules package-lock.json && npm install"
|
||||
"install:clean": "npm cache clean --force && rm -rf node_modules package-lock.json && npm install",
|
||||
"install:vite8": "npm install --force"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/preset-typescript": "^7.28.4",
|
||||
@@ -33,7 +35,7 @@
|
||||
"sass-embedded": "^1.89.2",
|
||||
"typescript-eslint": "^8.34.1",
|
||||
"typescript-plugin-css-modules": "^5.1.0",
|
||||
"vite": "^7.2.4"
|
||||
"vite": "^8.0.0-beta.0"
|
||||
},
|
||||
"prettier": {
|
||||
"printWidth": 120,
|
||||
|
||||
@@ -17,7 +17,7 @@ const localePath = "options/locale";
|
||||
|
||||
const [major, minor, patch, tag = ""] = pkg.version.split(".");
|
||||
|
||||
console.log("Version: ", pkg.version);
|
||||
console.log("Version:", pkg.version);
|
||||
let versionPath = "";
|
||||
if (tag.includes("rc") || patch.includes("latest")) {
|
||||
versionPath = `${githubBranchPath}/v${major}.${minor}`;
|
||||
@@ -26,14 +26,12 @@ if (tag.includes("rc") || patch.includes("latest")) {
|
||||
}
|
||||
|
||||
const githubUrl = `${githubSite}/${giteaRepo}/${versionPath}/${localePath}`;
|
||||
|
||||
const locales = fs.readdirSync(path.join(rootDir, localePath)).filter(file => file.endsWith(".ini"));
|
||||
|
||||
// 使用立即执行异步函数
|
||||
(async () => {
|
||||
for (const locale of locales) {
|
||||
const localUrl = `${githubUrl}/${locale}`;
|
||||
console.log("LocaleUrl: ", localUrl);
|
||||
console.log("LocaleUrl:", localUrl);
|
||||
const themeLocale = fs.readFileSync(path.join(rootDir, localePath, locale), "utf-8");
|
||||
|
||||
const response = await fetch(localUrl);
|
||||
|
||||
54
scripts/update_template.cjs
Normal file
54
scripts/update_template.cjs
Normal file
@@ -0,0 +1,54 @@
|
||||
const fs = require("fs");
|
||||
const path = require("path");
|
||||
|
||||
const rootDir = path.join(__dirname, "..");
|
||||
const pkgPath = path.join(rootDir, "package.json");
|
||||
const pkg = JSON.parse(fs.readFileSync(pkgPath));
|
||||
|
||||
const githubSite = "https://raw.githubusercontent.com";
|
||||
const giteaRepo = "go-gitea/gitea";
|
||||
const githubTagPath = "refs/tags";
|
||||
const tmplPath = "templates";
|
||||
const localTmplPath = path.join(rootDir, "gitea", tmplPath);
|
||||
const [major, minor, patch = ""] = pkg.version.split(".");
|
||||
console.log("Version:", pkg.version);
|
||||
const versionPath = `${githubTagPath}/v${major}.${minor}.${patch}`;
|
||||
const githubUrl = `${githubSite}/${giteaRepo}/${versionPath}/${tmplPath}`;
|
||||
|
||||
// 递归读取所有子目录中的 .tmpl 文件
|
||||
function readTmplFilesRecursively(dir) {
|
||||
const results = [];
|
||||
const files = fs.readdirSync(dir);
|
||||
|
||||
for (const file of files) {
|
||||
const filePath = path.join(dir, file);
|
||||
const stat = fs.statSync(filePath);
|
||||
|
||||
if (stat.isDirectory()) {
|
||||
// 如果是目录,递归读取
|
||||
results.push(...readTmplFilesRecursively(filePath));
|
||||
} else if (file.endsWith(".tmpl")) {
|
||||
// 如果是 .tmpl 文件,添加到结果中(相对于模板目录的相对路径)
|
||||
const relativePath = path.relative(localTmplPath, filePath);
|
||||
results.push(relativePath);
|
||||
}
|
||||
}
|
||||
|
||||
return results;
|
||||
}
|
||||
|
||||
// 读取所有模板文件
|
||||
const tmpls = readTmplFilesRecursively(localTmplPath);
|
||||
(async () => {
|
||||
for (const tmpl of tmpls) {
|
||||
const tmplUrl = `${githubUrl}/${tmpl}`;
|
||||
console.log("TmplUrl:", tmplUrl);
|
||||
|
||||
const response = await fetch(tmplUrl);
|
||||
if (!response.ok) {
|
||||
throw new Error(`HTTP error! status: ${response.status}`);
|
||||
}
|
||||
let content = await response.text();
|
||||
fs.writeFileSync(path.join(localTmplPath, tmpl), content);
|
||||
}
|
||||
})();
|
||||
@@ -163,9 +163,10 @@ export const actionViewHeader = css`
|
||||
|
||||
// 工作流左侧作业列表
|
||||
export const actionViewLeft = css`
|
||||
.action-view-left {
|
||||
.action-view-left.action-view-left.action-view-left {
|
||||
margin-right: 28px;
|
||||
border-top: 1px solid ${themeVars.color.console.border};
|
||||
max-width: 22vw;
|
||||
&:before {
|
||||
content: "Jobs";
|
||||
color: ${themeVars.color.console.fg.subtle};
|
||||
|
||||
@@ -564,7 +564,7 @@ export const timeline = css`
|
||||
}
|
||||
.timeline-item,
|
||||
.timeline-item-group {
|
||||
padding: 16px 0;
|
||||
padding: 12px 0;
|
||||
.comment-text-line {
|
||||
color: ${themeVars.color.text.light.num1};
|
||||
}
|
||||
|
||||
@@ -114,6 +114,13 @@
|
||||
{{svg "octicon-question"}}
|
||||
{{ctx.Locale.Tr "help"}}
|
||||
</a>
|
||||
{{if .IsAdmin}}
|
||||
<div class="divider"></div>
|
||||
<a class="{{if .PageIsAdmin}}active {{end}}item" href="{{AppSubUrl}}/-/admin">
|
||||
{{svg "octicon-server"}}
|
||||
{{ctx.Locale.Tr "admin_panel"}}
|
||||
</a>
|
||||
{{end}}
|
||||
<div class="divider"></div>
|
||||
<a class="item link-action" href data-url="{{AppSubUrl}}/user/logout">
|
||||
{{svg "octicon-sign-out"}}
|
||||
|
||||
@@ -8,9 +8,8 @@ import * as sass from "sass-embedded";
|
||||
import { defineConfig } from "vite";
|
||||
import { themeInput, themePlugin } from "./src/core/vite";
|
||||
|
||||
dotenv.config({ quiet: true });
|
||||
|
||||
const require = createRequire(import.meta.url);
|
||||
dotenv.config({ quiet: true });
|
||||
|
||||
const outDir = "dist"; // 输出目录
|
||||
const themesDir = "themes"; // 颜色主题目录
|
||||
|
||||
Reference in New Issue
Block a user