Skip to content

Commit

Permalink
Comment out client side route detection
Browse files Browse the repository at this point in the history
  • Loading branch information
jrmybtlr committed May 14, 2024
1 parent 7c74f69 commit 98beaf6
Showing 1 changed file with 27 additions and 24 deletions.
51 changes: 27 additions & 24 deletions nuxt-web/components/TableOfContents.vue
Original file line number Diff line number Diff line change
Expand Up @@ -16,32 +16,35 @@
</NuxtLink>
</template>

<NuxtLink
:to="`https://github.com/LittleFoxCompany/usemods/blob/main/src/${pageId.at(-1)}.ts`"
class="flex items-center gap-1.5 py-8 text-sm font-medium leading-none text-zinc-500">
<Icon name="fa6-brands:github" class="-mt-px mr-1.5 h-4 w-4" />
View on GitHub
</NuxtLink>
<!-- <NuxtLink
:to="`https://github.com/LittleFoxCompany/usemods/blob/main/src/${pageId.at(-1)}.ts`"
class="flex items-center gap-1.5 py-8 text-sm font-medium leading-none text-zinc-500">
<Icon name="fa6-brands:github" class="-mt-px mr-1.5 h-4 w-4" />
View on GitHub
</NuxtLink> -->
</nav>
</template>

<script setup lang="ts">
const route = useRoute()
const links = ref([{ id: '' }])
const pageId = detectUrlPath()
const activeSections = useState('activeSections', () => [])
async function fetchLinks() {
const toc = await queryContent(route.fullPath.split('?')[0].split('#')[0]).only('body').find()
links.value = toc[0].body?.children?.map((link) => ({ id: link.props?.name ?? link.props?.name ?? link.props?.id })).filter((link) => Object.keys(link).length > 0) || []
}
watch(
() => route.fullPath,
() => {
fetchLinks()
},
{ immediate: true }
)
const route = useRoute()
const links = ref([{ id: '' }])
// const pageId = detectUrlPath()
const activeSections = useState('activeSections', () => [])
async function fetchLinks() {
const toc = await queryContent(route.fullPath.split('?')[0].split('#')[0]).only('body').find()
links.value = toc[0].body?.children?.map((link) => ({ id: link.props?.name ?? link.props?.name ?? link.props?.id })).filter((link) => Object.keys(link).length > 0) || []
}
watch(
() => route.fullPath,
() => {
fetchLinks()
},
{ immediate: true }
)
</script>

0 comments on commit 98beaf6

Please sign in to comment.