fix(vitepress): fix docs site title

This commit is contained in:
Sagi 2022-10-06 01:03:13 +08:00
parent 59346761d9
commit eda8dabc4e
3 changed files with 23 additions and 22 deletions

View File

@ -5,7 +5,7 @@ import sidebar from './sidebar';
import markdown from './markdown';
const config = defineConfig({
title: ' ',
title: 'Farris Vue',
description: '基于 Farris Design 的前端组件库',
head,
markdown,

View File

@ -1,19 +1,19 @@
<script setup lang="ts">
import { useRoute, useData } from 'vitepress'
import { useCopyCode } from '../composables/copy-code.js'
import { useSidebar } from '../composables/sidebar.js'
import Theme from '@theme/index'
import VPPage from './VPPage.vue'
import VPHome from './VPHome.vue'
import VPDoc from './VPDoc.vue'
import { useRoute, useData } from "vitepress";
import { useCopyCode } from "../composables/copy-code.js";
import { useSidebar } from "../composables/sidebar.js";
import Theme from "@theme/index";
import VPPage from "./VPPage.vue";
import VPHome from "./VPHome.vue";
import VPDoc from "./VPDoc.vue";
const route = useRoute()
const { frontmatter } = useData()
const { hasSidebar } = useSidebar()
const route = useRoute();
const { frontmatter } = useData();
const { hasSidebar } = useSidebar();
const NotFound = Theme.NotFound || (() => '404 Not Found')
const NotFound = Theme.NotFound || (() => "404 Not Found");
useCopyCode()
useCopyCode();
</script>
<template>
@ -22,7 +22,7 @@ useCopyCode()
id="VPContent"
:class="{
'has-sidebar': hasSidebar,
'is-home': frontmatter.layout === 'home'
'is-home': frontmatter.layout === 'home',
}"
>
<NotFound v-if="route.component === NotFound" />
@ -72,6 +72,7 @@ useCopyCode()
.VPContent.has-sidebar {
margin: 0;
padding-left: var(--vp-sidebar-width);
background-color: rgba(255, 255, 255, 0.7);
}
}

View File

@ -1,10 +1,10 @@
<script setup lang="ts">
import { useData } from 'vitepress'
import { useSidebar } from '../composables/sidebar.js'
import VPImage from './VPImage.vue'
import { useData } from "vitepress";
import { useSidebar } from "../composables/sidebar.js";
import VPImage from "./VPImage.vue";
const { site, theme } = useData()
const { hasSidebar } = useSidebar()
const { site, theme } = useData();
const { hasSidebar } = useSidebar();
</script>
<template>
@ -12,8 +12,8 @@ const { hasSidebar } = useSidebar()
<a class="title" :href="site.base">
<slot name="nav-bar-title-before" />
<VPImage class="logo" :image="theme.logo" />
<template v-if="theme.siteTitle">{{ theme.siteTitle }}</template>
<template v-else-if="theme.siteTitle === undefined">{{ site.title }}</template>
<!-- <template v-if="theme.siteTitle">{{ theme.siteTitle }}</template>
<template v-else-if="theme.siteTitle === undefined">{{ site.title }}</template> -->
<slot name="nav-bar-title-after" />
</a>
</div>
@ -33,7 +33,7 @@ const { hasSidebar } = useSidebar()
/* background-color: var(--vp-c-bg-alt); */
padding-left: 32px;
margin-right: 0;
background-color: rgba(255,255,255,.7);
background-color: rgba(255, 255, 255, 0.7);
width: var(--vp-sidebar-width);
backdrop-filter: saturate(50%) blur(8px);
padding-right: 32px;