Skip to content

Commit

Permalink
new footer
Browse files Browse the repository at this point in the history
  • Loading branch information
skyraah committed Sep 1, 2024
1 parent 0619928 commit 9926c1e
Show file tree
Hide file tree
Showing 3 changed files with 81 additions and 9 deletions.
8 changes: 0 additions & 8 deletions .vitepress/config.mts
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,6 @@ export default withMermaid(
prev: '上一页',
next: '下一页'
},
footer: {
message: '基于 MIT 证书发布-晋ICP备2022005790号-2',
copyright: `版权所有 © 2024-${new Date().getFullYear()} 不是客服`
},
langMenuLabel: '改变语言',
darkModeSwitchLabel: '切换主题',
lightModeSwitchTitle: '切换到浅色模式',
Expand Down Expand Up @@ -80,10 +76,6 @@ export default withMermaid(
prev: 'Previous Page',
next: 'Next Page'
},
footer: {
message: 'Licensed under MIT-晋ICP备2022005790号-2',
copyright: `Copyright © 2024-${new Date().getFullYear()} M1hono`
},
langMenuLabel: 'Change Language',
darkModeSwitchLabel: 'Switch Theme',
lightModeSwitchTitle: 'Switch to light mode',
Expand Down
78 changes: 78 additions & 0 deletions .vitepress/theme/components/Footer.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
<template>
<v-footer style="background: transparent;">
<v-row justify="center" align="end" no-gutters>
<v-btn
v-for="link in links"
:key="link.code"
class="mx-0 bold-text"
color="grey-darken-1"
rounded="xl"
variant="text"
:href="link.link"
>
<v-sheet class="pa-0 ma-0" color="transparent">
<v-icon :color="isDark ? 'grey-lighten-2' : 'primary'" size="14" :icon="link.icon" /> {{ link.code[lang] }}
</v-sheet>
</v-btn>
<v-col style="color: grey" class="text-center text-large bold-text mt-2" cols="12">
{{copyright[lang]}}©{{ currentYear }}-{{beginYear}} {{author.code[lang]}}
</v-col>
</v-row>
</v-footer>
</template>

<script>
import { useData } from 'vitepress';
export default {
setup() {
const { isDark , lang } = useData();
return { isDark, lang };
},
data: () => ({
links: [icp, license],
currentYear,
beginYear,
author,
copyright,
}),
}
const currentYear = new Date().getFullYear()
const beginYear = '2024'
const copyright = {
"en-US":"Copyright",
"zh-CN":"版权所有"
}
const author = {
code: {
"en-US":"M1hono",
"zh-CN":"不是客服"
},
icon: 'mdi-copyright',
}
const icp = {
code: {
"en-US":'晋ICP备2022005790号-2',
"zh-CN":'晋ICP备2022005790号-2',
},
link: 'https://beian.miit.gov.cn/#/Integrated/index',
icon: 'mdi-monitor',
}
const license = {
code: {
"en-US":"Licensed under MIT",
"zh-CN":"基于 MIT 证书发布"
},
link: 'https://mit-license.org/',
icon: 'mdi-wrench-outline',
}
</script>
<style>
.text-large {
font-size: 14px; /* 根据需要设置大小 */
}
.bold-text {
font-weight: 400; /* 粗体 */
}
</style>

4 changes: 3 additions & 1 deletion .vitepress/theme/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import BilibiliVideo from './components/BilibiliVideo.vue'
import damageChart from './components/minecraft-advanced-damage-chart.vue'
import carousel from './components/carousel.vue'
import ShareLinkButton from './components/ShareLinkButton.vue'
import Footer from './components/Footer.vue'
import '@mdit/plugin-spoiler/style'

export default {
Expand All @@ -35,7 +36,8 @@ export default {
"layout-top": () => h(TdesignDark),
"aside-outline-after": () => h(AuthorsComponent),
"doc-after": () => h(Comment),
"aside-outline-before": () => h(ShareLinkButton)
"aside-outline-before": () => h(ShareLinkButton),
"layout-bottom" : () => h(Footer)
})
},
enhanceApp: (ctx) => {
Expand Down

0 comments on commit 9926c1e

Please sign in to comment.