Skip to content

Commit 87a2052

Browse files
committed
refactor(ui): unique page for all paths
1 parent a469132 commit 87a2052

File tree

2 files changed

+17
-15
lines changed

2 files changed

+17
-15
lines changed
File renamed without changes.
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,31 @@
11
<template>
2-
<div class="fixed right-0 top-0 z-40 w-screen h-screen">
2+
<Header />
3+
<HeroSection />
4+
<Roadmap />
5+
<div v-if="content" :class="['fixed top-0 h-screen', sidebarClass]">
36
<div
4-
v-if="content"
5-
class="right-0 top-0 flex h-full w-full overflow-y-auto flex-col items-center bg-white p-4 focus:outline-0 sm:p-6"
7+
class="top-0 flex h-full w-full overflow-y-auto flex-col items-center bg-white p-4 focus:outline-0 sm:p-6"
68
>
79
<ContentRenderer :key="content._id" :value="content">
8-
<ContentRendererMarkdown class="flex flex-col gap-3 text-black m:max-w-[800px] sm:max-w-[600px]" :value="content" />
10+
<ContentRendererMarkdown class="flex flex-col gap-3 text-black w-full m:max-w-[800px] sm:max-w-[600px]" :value="content" />
911
<div class="flex flex-col items-start w-full m:max-w-[800px] sm:max-w-[600px]">
1012
<h4 id="related-content" class="text-black mb-3">
1113
<a href="#related-content">Contenido Extra Relacionado</a>
1214
</h4>
13-
<a
14-
class="text-black mb-1"
15+
<Card
16+
moreTransparency
17+
class="gap-x-2 mb-1"
1518
v-for="(link, i) in content.data.externalLinks"
1619
:key="i"
1720
:href="link.link"
1821
>
19-
<span v-if="link.english">[Contenido en Ingles]</span>
22+
<strong v-if="link.english">[Contenido en Ingles]</strong>
2023
{{link.name}}
21-
</a>
24+
</Card>
2225
</div>
2326
</ContentRenderer>
2427
</div>
2528
</div>
26-
<Header />
27-
<HeroSection />
28-
<Roadmap />
2929
</template>
3030

3131
<script setup>
@@ -40,9 +40,11 @@ const showSidebar = ref(true)
4040
const content = ref(null)
4141
4242
onMounted(async () => {
43-
content.value = await queryContent(nodeId).findOne()
44-
console.log(content)
45-
46-
showSidebar.value = content && (route.query.fromClick || false)
43+
if (!nodeId) return
44+
const contentResult = await queryContent(nodeId.join("/")).findOne()
45+
content.value = contentResult
46+
showSidebar.value = contentResult && (route.query.fromClick || false)
4747
})
48+
49+
const sidebarClass = computed(() => showSidebar ? 'right-0' : '')
4850
</script>

0 commit comments

Comments
 (0)