|
1 | 1 | <template>
|
2 |
| - <div class="sticky right-0 top-0 z-40 w-screen min-h-screen"> |
3 |
| - <Sidebar v-if="showSidebar" :node="nodeData" /> |
4 |
| - <FullView v-else :node="nodeData" /> |
| 2 | + <div class="fixed right-0 top-0 z-40 w-screen h-screen"> |
| 3 | + <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" |
| 6 | + > |
| 7 | + <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" /> |
| 9 | + <div class="flex flex-col items-start w-full m:max-w-[800px] sm:max-w-[600px]"> |
| 10 | + <h4 id="related-content" class="text-black mb-3"> |
| 11 | + <a href="#related-content">Contenido Extra Relacionado</a> |
| 12 | + </h4> |
| 13 | + <a |
| 14 | + class="text-black mb-1" |
| 15 | + v-for="(link, i) in content.data.externalLinks" |
| 16 | + :key="i" |
| 17 | + :href="link.link" |
| 18 | + > |
| 19 | + <span v-if="link.english">[Contenido en Ingles]</span> |
| 20 | + {{link.name}} |
| 21 | + </a> |
| 22 | + </div> |
| 23 | + </ContentRenderer> |
| 24 | + </div> |
5 | 25 | </div>
|
6 | 26 | <Header />
|
7 | 27 | <HeroSection />
|
|
11 | 31 | <script setup>
|
12 | 32 | import { useRoute } from 'vue-router'
|
13 | 33 | import { ref, onMounted } from 'vue'
|
14 |
| -import Sidebar from '@/components/Sidebar.vue' |
15 |
| -import FullView from '@/components/FullView.vue' |
16 | 34 | import Roadmap from '@/components/Roadmap.vue'
|
17 | 35 | import HeroSection from '@/layouts/hero.vue'
|
18 | 36 |
|
19 | 37 | const route = useRoute()
|
20 | 38 | const nodeId = route.params.slug
|
21 |
| -const nodeData = ref(null) |
22 | 39 | const showSidebar = ref(true)
|
| 40 | +const content = ref(null) |
23 | 41 |
|
24 | 42 | onMounted(async () => {
|
25 |
| - // Fetch the node data based on the nodeId |
26 |
| - const response = await fetchNodeData(nodeId) |
27 |
| - nodeData.value = response |
| 43 | + content.value = await queryContent(nodeId).findOne() |
| 44 | + console.log(content) |
28 | 45 |
|
29 |
| - showSidebar.value = response && (route.query.fromClick || false) |
| 46 | + showSidebar.value = content && (route.query.fromClick || false) |
30 | 47 | })
|
31 |
| -
|
32 |
| -async function fetchNodeData(id) { |
33 |
| - return { |
34 |
| - id, |
35 |
| - title: 'Nodo ' + id, |
36 |
| - content: 'Contenido del nodo ' + id |
37 |
| - } |
38 |
| -} |
39 | 48 | </script>
|
0 commit comments