feat: add gitea sync and env-aware content sync

This commit is contained in:
SepComet
2026-05-05 09:53:51 +08:00
parent 7915f8c244
commit fdeb25805c
7 changed files with 480 additions and 55 deletions
+1 -1
View File
@@ -43,7 +43,7 @@ const isPlaceholder = activity.source === 'placeholder';
: '这里展示构建阶段同步下来的 Gitea 热力图与最近活动摘要。'}
</p>
</div>
<a class="section-link" href={site.gitea.baseUrl} target="_blank" rel="noreferrer">
<a class="section-link" href={site.gitea.url} target="_blank" rel="noreferrer">
打开 Gitea
</a>
</div>
+3 -1
View File
@@ -1,4 +1,6 @@
---
import { site } from '../config';
interface Props {
name: string;
description: string;
@@ -23,7 +25,7 @@ const {
downloadLink = '',
} = Astro.props;
const fallbackRepoUrl = repo ? `https://gitea.sepcomet.xyz/${repo}` : '';
const fallbackRepoUrl = repo ? `${site.gitea.url}/${repo}` : '';
const resolvedRepoUrl = repoUrl || fallbackRepoUrl;
---
+1 -1
View File
@@ -19,7 +19,7 @@ const sortedLogs = logs.sort((a, b) => b.data.date.getTime() - a.data.date.getTi
const latestLogs = sortedLogs.slice(0, 3);
const featuredProjects = projects.filter((project) => project.featured).slice(0, 3);
const latestLog = latestLogs[0];
const activeRepo = activity.recent[0]?.repo ?? featuredProjects[0]?.gitea_repo ?? 'sepcomet/personal-homepage';
const activeRepo = activity.recent[0]?.repo ?? featuredProjects[0]?.gitea_repo ?? `${site.gitea.username}/personal-homepage`;
---
<Layout title={`${site.name} | ${site.title}`} description={site.description} currentPath="/">