feat: 添加网站底部栏
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
<script setup>
|
||||
import DefaultTheme from 'vitepress/theme';
|
||||
import DocContentFooter from './DocContentFooter.vue';
|
||||
import SiteFooter from './SiteFooter.vue';
|
||||
|
||||
const { Layout } = DefaultTheme;
|
||||
</script>
|
||||
@@ -11,5 +12,8 @@ const { Layout } = DefaultTheme;
|
||||
<hr class="custom__divider" />
|
||||
<DocContentFooter />
|
||||
</template>
|
||||
<template #layout-bottom>
|
||||
<SiteFooter />
|
||||
</template>
|
||||
</Layout>
|
||||
</template>
|
||||
|
49
docs/.vitepress/theme/layout/SiteFooter.vue
Normal file
49
docs/.vitepress/theme/layout/SiteFooter.vue
Normal file
@@ -0,0 +1,49 @@
|
||||
<script setup>
|
||||
import { useData } from 'vitepress';
|
||||
import { computed } from 'vue';
|
||||
import { siteLinksOnline } from '../../site-links.mjs';
|
||||
|
||||
const siteData = useData();
|
||||
|
||||
const siteLinks = computed(() => {
|
||||
return siteLinksOnline.filter((item) => {
|
||||
return item.isGlobal;
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="site-footer">
|
||||
<div class="site-footer__row">
|
||||
<span>Copyright © {{ siteData.site.value.title }} • Powered by VitePress</span>
|
||||
</div>
|
||||
<div class="site-footer__row">
|
||||
<span>友情链接:</span>
|
||||
<a
|
||||
v-for="(item, index) in siteLinks"
|
||||
:key="index"
|
||||
:href="item.siteUrl"
|
||||
target="_blank"
|
||||
>{{ item.siteTitle }}</a>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<style lang="less">
|
||||
.site-footer {
|
||||
padding: 32px 0;
|
||||
background-color: var(--vp-c-bg-alt);
|
||||
color: var(--vp-c-text-1);
|
||||
font-size: 14px;
|
||||
line-height: 2;
|
||||
text-align: center;
|
||||
user-select: none;
|
||||
|
||||
a {
|
||||
margin: 0 0.25em;
|
||||
color: var(--vp-c-brand-1);
|
||||
text-decoration: underline;
|
||||
text-underline-offset: 2px;
|
||||
}
|
||||
}
|
||||
</style>
|
Reference in New Issue
Block a user