mirror of
https://github.com/lutinglt/gitea-github-theme.git
synced 2026-04-13 23:11:37 +08:00
Compare commits
10 Commits
9c67ea1697
...
v1.25.5
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c130e6c778 | ||
|
|
c6134161bf | ||
|
|
d65a5e8f67 | ||
|
|
86d67a4559 | ||
|
|
5b9b7372a6 | ||
|
|
59b9c66c4e | ||
|
|
ec0f8660e9 | ||
|
|
673b7a13de | ||
|
|
de0cac06b2 | ||
|
|
bd7899114b |
5
.github/workflows/build.yml
vendored
5
.github/workflows/build.yml
vendored
@@ -15,6 +15,7 @@ jobs:
|
||||
with:
|
||||
filters: |
|
||||
src:
|
||||
- ".github/workflows/*.yml"
|
||||
- "scripts/*"
|
||||
- "src/**/*.ts"
|
||||
- "styles/**/*.ts"
|
||||
@@ -26,7 +27,7 @@ jobs:
|
||||
id: build
|
||||
if: steps.changes.outputs.src == 'true'
|
||||
run: |
|
||||
npm run install:vite8
|
||||
npm install
|
||||
npm run build
|
||||
|
||||
- name: Upload css assets
|
||||
@@ -53,4 +54,4 @@ jobs:
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: locales
|
||||
path: dist/options/locale
|
||||
path: dist/options/locale
|
||||
|
||||
2
.vscode/settings.json
vendored
2
.vscode/settings.json
vendored
@@ -1,3 +1,3 @@
|
||||
{
|
||||
"typescript.experimental.useTsgo": false
|
||||
}
|
||||
}
|
||||
|
||||
15
CHANGELOG.md
15
CHANGELOG.md
@@ -2,19 +2,8 @@
|
||||
|
||||
#### More aligned with GitHub style
|
||||
|
||||
- Optimize the selection style of items in the menu.
|
||||
- Optimize code block styles.
|
||||
- Optimize some element styles on Issue/PR page
|
||||
|
||||
##### Template File
|
||||
|
||||
- Synchronized repository commit page layout and styles.
|
||||
- Synchronized repository code list page layout and styles.
|
||||
- Synchronized repository add file button menu styles.
|
||||
- Fine-tune the style of the navigation bar.
|
||||
|
||||
### 🐞 Fix
|
||||
|
||||
- Fixed extra lines under heatmap.
|
||||
- Supplement the PR operation panel status style in PR.
|
||||
- Fixed avatar size for approving users in PR
|
||||
- Fixed bot label styles in Issue/PR
|
||||
- Fix no auto-focus of search filter on issue/PR properties. #27
|
||||
|
||||
14
README.md
14
README.md
@@ -79,6 +79,20 @@ For details, please refer to the Gitea documentation
|
||||
>
|
||||
> The template modifies Gitea's layout to make it closer to GitHub's layout. Do not use template files across versions,
|
||||
> as this may lead to missing functionality and other issues.
|
||||
>
|
||||
> Template layout is bound to the Gitea instance and will affect all themes, impacting the experience of other
|
||||
> non-project themes.
|
||||
|
||||
### Translation File Installation (Optional)
|
||||
|
||||
> [!TIP]
|
||||
>
|
||||
> Translation files are only needed when using this project's template files to provide support for non-English
|
||||
> languages.
|
||||
|
||||
1. Download the latest translation files from the release page and place them in the `data/gitea/options/locale`
|
||||
directory (This directory may not be available by default and needs to be manually created)
|
||||
2. Restart Gitea
|
||||
|
||||
## Screenshots
|
||||
|
||||
|
||||
15
README_CN.md
15
README_CN.md
@@ -70,6 +70,21 @@ THEMES = gitea-auto, gitea-light, gitea-dark, github-auto, github-light, github-
|
||||
> [!IMPORTANT]
|
||||
>
|
||||
> 模板修改了 Gitea 的布局, 使其更接近 GitHub 的布局, 请勿跨版本使用模板文件, 可能会导致功能缺失等问题
|
||||
>
|
||||
> 模板布局跟 Gitea 实例绑定, 所有主题都会生效, 会影响其他非本项目的主题的体验
|
||||
|
||||
### 翻译文件安装 (可选)
|
||||
|
||||
> [!TIP]
|
||||
>
|
||||
> 仅在使用本项目的模板文件时需要安装翻译文件以提供非英文语言的支持
|
||||
|
||||
1. 在发布页下载最新的翻译文件放入 `data/gitea/options/locale` 目录下 (默认可能没有此目录需手动创建)
|
||||
2. 重启 Gitea
|
||||
|
||||
> [!NOTE]
|
||||
>
|
||||
> 中文翻译中还额外将 "工单" 替换为 "议题", "合并请求" 替换为 "拉取请求", 以与 GitHub 手机版中文保持一致
|
||||
|
||||
## 截图
|
||||
|
||||
|
||||
@@ -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.5",
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"dev": "vite build --mode dev",
|
||||
@@ -10,6 +10,7 @@
|
||||
"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:vite8": "npm install --force"
|
||||
@@ -34,7 +35,7 @@
|
||||
"sass-embedded": "^1.89.2",
|
||||
"typescript-eslint": "^8.34.1",
|
||||
"typescript-plugin-css-modules": "^5.1.0",
|
||||
"vite": "^8.0.0-beta.0"
|
||||
"vite": "^7.3.1"
|
||||
},
|
||||
"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);
|
||||
}
|
||||
})();
|
||||
@@ -202,7 +202,7 @@ export function github2ThemeColor(githubColor: GithubColor): ThemeColor {
|
||||
bg: githubColor.bgColor.emphasis,
|
||||
},
|
||||
nav: {
|
||||
bg: githubColor.bgColor.muted,
|
||||
bg: githubColor.bgColor.inset,
|
||||
hoverBg: githubColor.control.transparent.bgColor.hover,
|
||||
text: themeVars.color.text.self,
|
||||
},
|
||||
|
||||
@@ -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};
|
||||
|
||||
@@ -309,7 +309,7 @@ export const comment = css`
|
||||
.ui.basic.label {
|
||||
${botLabelStyle}
|
||||
}
|
||||
a:has(relative-time){
|
||||
a:has(relative-time) {
|
||||
text-decoration: underline;
|
||||
}
|
||||
// 已编辑按钮
|
||||
@@ -741,6 +741,10 @@ export const issueSidebar = css`
|
||||
}
|
||||
}
|
||||
}
|
||||
// 修复菜单下拉打开时, 无法聚焦输入框
|
||||
.menu input {
|
||||
transition: none;
|
||||
}
|
||||
}
|
||||
// 时间追踪
|
||||
> div:not([class]):not([id]) {
|
||||
|
||||
@@ -3,7 +3,6 @@ import { css, customThemeVars, otherThemeVars, themeVars } from "src/types/vars"
|
||||
|
||||
export const navbarRight = css`
|
||||
#navbar {
|
||||
border-bottom: 0;
|
||||
padding: 8px 16px; // 上下内边距 + .navbar-left & .navbar-right 的 min-height = 64px
|
||||
min-height: 64px;
|
||||
.navbar-left,
|
||||
|
||||
@@ -123,3 +123,15 @@ export const packagesDetail = css`
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
// 手机页面下的软件包详细信息页
|
||||
export const packagesListMobile = css`
|
||||
@media (max-width: 767.98px) {
|
||||
.page-content.packages .packages-content {
|
||||
.packages-content-left,
|
||||
.packages-content-right {
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
@@ -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"}}
|
||||
|
||||
Reference in New Issue
Block a user