Skip to content

Commit

Permalink
feat: footer (#684)
Browse files Browse the repository at this point in the history
  • Loading branch information
Aganivi authored Nov 13, 2023
1 parent 3db6098 commit a38fe4d
Show file tree
Hide file tree
Showing 5 changed files with 47 additions and 2 deletions.
1 change: 1 addition & 0 deletions docs/.vitepress/config/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,5 +71,6 @@ export const enConfig = async () => ({
icon: 'FAQandOthers',
},
],
copyright: '©Copyright 2023 Greptime Inc. All Rights Reserved',
},
})
8 changes: 8 additions & 0 deletions docs/.vitepress/config/zh.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,11 @@ export const zhConfig = async () => ({
en: { label: 'English', lang: 'en-US', link: `${websiteMap['en']}${base}` },
},
themeConfig: {
notFound: {
title: '页面不存在',
quote: '您访问的页面不存在,可能是因为您的链接已失效、输入的地址有误或者该页面已被删除。',
linkText: '返回首页',
},
search: {
options: {
locales: {
Expand Down Expand Up @@ -96,5 +101,8 @@ export const zhConfig = async () => ({
next: '下一篇',
},
outlineTitle: '目录',
copyright: '©2023 格睿云(北京)技术咨询有限公司',
icp: { text: '京ICP备2023008042号', link: 'https://beian.miit.gov.cn/' },
gongan: { text: '京公网安备 11010502052203号', link: 'https://www.beian.gov.cn/portal/registerSystemInfo?recordcode=11010502052203' },
},
})
35 changes: 34 additions & 1 deletion docs/.vitepress/theme/Layout.vue
Original file line number Diff line number Diff line change
@@ -1,16 +1,49 @@
<template lang="pug">
Layout
template(#doc-after)
.footer
.copyright-wrapper
.copyright {{copyright}}
a.icp(v-if="showIcp" :href="icp.link" target="_blank") {{ icp.text }}
a.icp(v-if="showIcp" :href="gongan.link" target="_blank") {{ gongan.text }}
</template>
<script setup name="Layout" lang="ts">
import Layout from 'vitepress/dist/client/theme-default/Layout.vue'
import { getSidebarIcon } from '@/utils.ts'
// data
const { theme } = useData()
const { iconMap } = theme.value
const { iconMap, copyright, icp, gongan } = theme.value
const showIcp = computed(() => !!icp)
// methods
// lifecycle
onMounted(async () => {
getSidebarIcon(iconMap)
})
</script>
<style lang="stylus" rel="stylesheet/stylus" scoped>
.footer
display flex
align-items center
justify-content center
.copyright-wrapper
width 100%
margin-top 60px
margin-bottom -148px
padding 16px 0
color var(--color-gray-5)
font-size var(--font-size-xxs)
line-height var(--line-height-xxs)
display flex
justify-content center
align-items center
.copyright
display inline-block
.icp
line-height 12px
display inline-block
padding-left 5px
margin-left 5px
border-left 1px solid var(--color-gray-5)
</style>
3 changes: 2 additions & 1 deletion docs/.vitepress/theme/serverUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,10 @@ export const getVersionList = (lang: string) => {
.filter(version => version !== CURRENT_VERSION)
.map(version => {
const endText = version !== LATEST_VERSION ? '' : textMap[lang] || '(latest)'
const linkVersion = version !== LATEST_VERSION ? `${version}/` : ''
return {
text: `${version} ${endText}`,
link: `${websiteMap[lang]}/${version}/`,
link: `${websiteMap[lang]}/${linkVersion}`,
}
})
}
2 changes: 2 additions & 0 deletions docs/.vitepress/theme/style/vars.styl
Original file line number Diff line number Diff line change
Expand Up @@ -78,13 +78,15 @@
--font-size-m 16px
--font-size-s 15px
--font-size-xs 14px
--font-size-xxs 12px

--line-height-xxl 47px
--line-height-xl 37px
--line-height-l 28px
--line-height-m 24px
--line-height-s 23px
--line-height-xs 18px
--line-height-xxs 15px

--border-radius-l 8px
--border-radius-m 6px
Expand Down

0 comments on commit a38fe4d

Please sign in to comment.