update
This commit is contained in:
@@ -74,14 +74,26 @@
|
|||||||
|
|
||||||
<!-- Git build info -->
|
<!-- Git build info -->
|
||||||
<p v-if="build?.short" class="text-text-muted text-xs m-0">
|
<p v-if="build?.short" class="text-text-muted text-xs m-0">
|
||||||
构建自提交:<span :title="build.sha">{{ build.short }}</span>
|
构建自提交:
|
||||||
|
<template v-if="commitUrl">
|
||||||
|
<a
|
||||||
|
:href="commitUrl"
|
||||||
|
target="_blank"
|
||||||
|
rel="noreferrer"
|
||||||
|
class="text-primary hover:underline"
|
||||||
|
>{{ build.short }}</a
|
||||||
|
>
|
||||||
|
</template>
|
||||||
|
<template v-else>
|
||||||
|
<span :title="build.sha">{{ build.short }}</span>
|
||||||
|
</template>
|
||||||
<span v-if="build.date"> · {{ build.date }}</span>
|
<span v-if="build.date"> · {{ build.date }}</span>
|
||||||
</p>
|
</p>
|
||||||
</footer>
|
</footer>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import { onMounted, ref } from "vue";
|
import { onMounted, ref, computed } from "vue";
|
||||||
import siteConfig from "~/config";
|
import siteConfig from "~/config";
|
||||||
const contact = siteConfig.footer || {};
|
const contact = siteConfig.footer || {};
|
||||||
const quote = ref("");
|
const quote = ref("");
|
||||||
@@ -138,6 +150,17 @@ const isExternal = (url) => {
|
|||||||
const runtimeConfig = useRuntimeConfig();
|
const runtimeConfig = useRuntimeConfig();
|
||||||
const build = runtimeConfig.public?.build || null;
|
const build = runtimeConfig.public?.build || null;
|
||||||
|
|
||||||
|
const repoBase = siteConfig.siteMeta?.repo || null;
|
||||||
|
const commitUrl = computed(() => {
|
||||||
|
if (!build?.sha || !repoBase) return null;
|
||||||
|
let base = repoBase;
|
||||||
|
if (!/^https?:\/\//.test(base)) {
|
||||||
|
base = `https://github.com/${base}`;
|
||||||
|
}
|
||||||
|
base = base.replace(/\.git$/, "").replace(/\/$/, "");
|
||||||
|
return `${base}/commit/${build.sha}`;
|
||||||
|
});
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
if (showHitokoto) fetchHitokoto();
|
if (showHitokoto) fetchHitokoto();
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -11,6 +11,8 @@ const siteConfig: SiteConfig = {
|
|||||||
lang: "zh-CN",
|
lang: "zh-CN",
|
||||||
favicon: "/favicon.svg",
|
favicon: "/favicon.svg",
|
||||||
startTime: "2025-10-01",
|
startTime: "2025-10-01",
|
||||||
|
// GitHub repository URL (used for commit links in the footer)
|
||||||
|
repo: "https://github.com/RhenCloud/Cloud-Blog",
|
||||||
},
|
},
|
||||||
|
|
||||||
hero: {
|
hero: {
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ export interface SiteMeta {
|
|||||||
lang?: string;
|
lang?: string;
|
||||||
favicon?: string;
|
favicon?: string;
|
||||||
startTime?: string;
|
startTime?: string;
|
||||||
|
repo?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface TypedOptions {
|
export interface TypedOptions {
|
||||||
|
|||||||
Reference in New Issue
Block a user