Skip to content

Commit 86d0a38

Browse files
committed
add a bottom nav
1 parent bbca757 commit 86d0a38

File tree

2 files changed

+69
-0
lines changed

2 files changed

+69
-0
lines changed

.vitepress/theme/components/Home.vue

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
<script setup lang="ts">
22
import { onMounted } from 'vue'
3+
import SiteMap from './SiteMap.vue';
34
// import NewsLetter from './NewsLetter.vue'
45
import { load, data, base } from './sponsors'
56
import SponsorsGroup from './SponsorsGroup.vue'
@@ -88,6 +89,7 @@ onMounted(async () => {
8889
<SponsorsGroup tier="gold" placement="landing" />
8990
</section>
9091

92+
<SiteMap />
9193
<!-- <NewsLetter /> -->
9294
</template>
9395

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
<script setup lang="ts">
2+
import { VTLink } from '@vue/theme'
3+
import { useData } from 'vitepress'
4+
5+
const data = useData()
6+
const nav = data.site.value.themeConfig.nav
7+
const ecosystem = nav.find((i: any) => i.text === 'Ecosystem')
8+
const items = nav
9+
.filter((i: any) => i !== ecosystem && i.items)
10+
.concat(ecosystem.items)
11+
</script>
12+
13+
<template>
14+
<section id="sitemap">
15+
<div class="container">
16+
<div class="sitemap-col" v-for="col in items">
17+
<h4>{{ col.text }}</h4>
18+
<ul>
19+
<li v-for="row in col.items">
20+
<VTLink :href="row.link">{{ row.text }}</VTLink>
21+
</li>
22+
</ul>
23+
</div>
24+
</div>
25+
</section>
26+
</template>
27+
28+
<style>
29+
#sitemap {
30+
background: var(--vt-c-bg-soft);
31+
}
32+
33+
#sitemap .container {
34+
max-width: 900px;
35+
margin: 0 auto;
36+
columns: 1;
37+
padding: 24px 32px;
38+
}
39+
40+
@media (min-width: 768px) {
41+
#sitemap .container {
42+
columns: 2;
43+
}
44+
}
45+
46+
@media (min-width: 1024px) {
47+
#sitemap .container {
48+
columns: 3;
49+
}
50+
}
51+
52+
#sitemap h4 {
53+
font-weight: 500;
54+
color: var(--vt-c-text-1);
55+
margin-bottom: 0.25em;
56+
}
57+
58+
.sitemap-col {
59+
margin-bottom: 2em;
60+
break-inside: avoid;
61+
}
62+
63+
#sitemap .vt-link {
64+
font-size: 0.9em;
65+
color: var(--vt-c-text-2);
66+
}
67+
</style>

0 commit comments

Comments
 (0)