-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathLayout.vue
55 lines (51 loc) · 1.43 KB
/
Layout.vue
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
<script setup lang="ts">
import { useData, Content } from "vitepress";
import NotFound from "./src/layouts/NotFound.vue";
import HelpfulLayout from "./src/layouts/Helpful.vue";
import ArticleHead from "./src/layouts/ArticleHead.vue";
import ArticleFooter from "./src/layouts/ArticleFooter.vue";
import SiteFooter from "./src/components/Footer.vue";
import Navigation from "./src/components/Navigation.vue";
const { site, frontmatter, page, theme } = useData();
</script>
<template>
<div :class="theme.boosts">
<Navigation />
<main
id="content-main"
:class="{
numeric: frontmatter.style === 'numeric',
'icon-links': theme.links === 'icons',
}"
>
<div v-if="frontmatter.home">
<h1>{{ site.title }}</h1>
</div>
<div
v-if="
frontmatter.layout === 'article' &&
(!theme.minimal || frontmatter.layout !== 'article')
"
>
<ArticleHead />
</div>
<NotFound v-if="page.isNotFound" />
<div v-else id="content" :class="frontmatter.pageClass">
<Content />
</div>
<template v-if="frontmatter.layout === 'helpful'">
<hr />
<HelpfulLayout />
</template>
<div
v-if="
frontmatter.layout === 'article' &&
(!theme.minimal || frontmatter.layout !== 'article')
"
>
<ArticleFooter />
</div>
</main>
<SiteFooter />
</div>
</template>