chore: prepare open source archive

This commit is contained in:
2026-07-19 18:49:14 +08:00
parent 9756bbaa5a
commit 18b74a9d51
16 changed files with 94 additions and 1943 deletions
+12 -2
View File
@@ -3,6 +3,14 @@ import { siteConfig } from '~/config/site'
const colorMode = useColorMode()
const container = ref<HTMLElement>()
const isEnabled = computed(() =>
Boolean(
siteConfig.giscus.repo
&& siteConfig.giscus.repoId
&& siteConfig.giscus.category
&& siteConfig.giscus.categoryId
)
)
function loadGiscus() {
if (!container.value) return
@@ -29,10 +37,12 @@ function loadGiscus() {
}
onMounted(() => {
loadGiscus()
if (isEnabled.value) loadGiscus()
})
watch(() => colorMode.value, () => {
if (!isEnabled.value) return
const frame = document.querySelector<HTMLIFrameElement>('iframe.giscus-frame')
if (frame?.contentWindow) {
frame.contentWindow.postMessage(
@@ -44,7 +54,7 @@ watch(() => colorMode.value, () => {
</script>
<template>
<div>
<div v-if="isEnabled">
<h2 class="text-xl font-semibold mb-4">评论</h2>
<div ref="container" />
</div>
+6 -8
View File
@@ -1,25 +1,23 @@
<script setup lang="ts">
import { siteConfig } from '~/config/site'
const config = useRuntimeConfig()
const icp = config.public.icp
const psBeian = config.public.psBeian
const { filing } = siteConfig
</script>
<template>
<footer class="py-6 text-center text-sm border-t" style="color: var(--color-text-secondary); border-color: var(--color-border);">
<p>
&copy; {{ new Date().getFullYear() }} {{ siteConfig.siteName }}
<template v-if="icp">
<template v-if="filing.icp">
&nbsp;·&nbsp;
<a href="https://beian.miit.gov.cn/" target="_blank" rel="noopener noreferrer" class="hover:opacity-70 whitespace-nowrap" style="border-bottom: 1px solid var(--color-text-secondary); padding-bottom: 1px;">{{ icp }}</a>
<a href="https://beian.miit.gov.cn/" target="_blank" rel="noopener noreferrer" class="hover:opacity-70 whitespace-nowrap" style="border-bottom: 1px solid var(--color-text-secondary); padding-bottom: 1px;">{{ filing.icp }}</a>
</template>
<template v-if="psBeian">
<template v-if="filing.publicSecurity.code">
&nbsp;·&nbsp;
<a :href="`https://beian.mps.gov.cn/#/query/webSearch?code=${psBeian}`" rel="noreferrer" target="_blank" class="hover:opacity-70 whitespace-nowrap" style="border-bottom: 1px solid var(--color-text-secondary); padding-bottom: 1px;">
<a :href="`https://beian.mps.gov.cn/#/query/webSearch?code=${filing.publicSecurity.code}`" rel="noreferrer" target="_blank" class="hover:opacity-70 whitespace-nowrap" style="border-bottom: 1px solid var(--color-text-secondary); padding-bottom: 1px;">
<span class="inline-flex items-center gap-0.5">
<img src="@/assets/备案图标.png" alt="" class="w-3 h-3" />
<span>川公网安备{{ psBeian }}</span>
<span>{{ filing.publicSecurity.label }}{{ filing.publicSecurity.code }}</span>
</span>
</a>
</template>