Make site URLs environment-driven
This commit is contained in:
@@ -41,9 +41,13 @@ const isPlaceholder = activity.source === 'placeholder';
|
||||
: '这里展示构建阶段同步下来的 Gitea 热力图与最近活动摘要。'}
|
||||
</p>
|
||||
</div>
|
||||
<a class="section-link" href={site.gitea.url} target="_blank" rel="noreferrer">
|
||||
打开 Gitea
|
||||
</a>
|
||||
{
|
||||
site.gitea.url ? (
|
||||
<a class="section-link" href={site.gitea.url} target="_blank" rel="noreferrer">
|
||||
打开 Gitea
|
||||
</a>
|
||||
) : null
|
||||
}
|
||||
</div>
|
||||
|
||||
<div class="activity-grid">
|
||||
|
||||
@@ -33,7 +33,7 @@ const {
|
||||
source,
|
||||
} = Astro.props;
|
||||
|
||||
const fallbackRepoUrl = repo ? `${site.gitea.url}/${repo}` : '';
|
||||
const fallbackRepoUrl = repo && site.gitea.url ? `${site.gitea.url}/${repo}` : '';
|
||||
const resolvedRepoUrl = repoUrl || fallbackRepoUrl;
|
||||
const visibleDownloads = downloads.filter((item) => item.name || item.url);
|
||||
const sourceLabels = {
|
||||
|
||||
+15
-6
@@ -1,3 +1,12 @@
|
||||
const publicSiteUrl = import.meta.env.PUBLIC_SITE_URL?.trim() || '';
|
||||
const publicGiteaUrl = import.meta.env.PUBLIC_GITEA_URL?.trim() || '';
|
||||
const publicGithubUrl = import.meta.env.PUBLIC_GITHUB_URL?.trim() || '';
|
||||
const publicBlogUrl = import.meta.env.PUBLIC_BLOG_URL?.trim() || publicSiteUrl;
|
||||
const publicGiteaUsername =
|
||||
import.meta.env.PUBLIC_GITEA_USERNAME?.trim() ||
|
||||
import.meta.env.GITEA_USERNAME?.trim() ||
|
||||
'sepcomet';
|
||||
|
||||
export const site = {
|
||||
name: 'SepComet',
|
||||
title: '个人主页',
|
||||
@@ -7,13 +16,13 @@ export const site = {
|
||||
avatar: '/images/avatar.svg',
|
||||
location: 'Shanghai / Remote',
|
||||
gitea: {
|
||||
url: 'https://gitea.sepcomet.xyz',
|
||||
username: 'sepcomet',
|
||||
url: publicGiteaUrl,
|
||||
username: publicGiteaUsername,
|
||||
},
|
||||
links: [
|
||||
{ name: 'GitHub', url: 'https://github.com/sepcomet' },
|
||||
{ name: 'Gitea', url: 'https://gitea.sepcomet.xyz' },
|
||||
{ name: 'Blog', url: 'https://sepcomet.xyz' },
|
||||
],
|
||||
{ name: 'GitHub', url: publicGithubUrl },
|
||||
{ name: 'Gitea', url: publicGiteaUrl },
|
||||
{ name: 'Blog', url: publicBlogUrl },
|
||||
].filter((link) => link.url),
|
||||
stacks: ['Unity', 'Astro', 'TypeScript', 'Docker'],
|
||||
} as const;
|
||||
|
||||
Reference in New Issue
Block a user