Skip to content

Commit

Permalink
fix: page layout breaks when page name matches the css class name (#696
Browse files Browse the repository at this point in the history
…) (#699)

fix: #696 

To fix the issue, make the page name inside VPDoc use a complete path.
  • Loading branch information
brc-dd authored Jun 6, 2022
1 parent 305bcc0 commit 9c0ed93
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions src/client/theme-default/components/VPDoc.vue
Original file line number Diff line number Diff line change
@@ -1,16 +1,13 @@
<script setup lang="ts">
import { computed } from 'vue'
import { useData } from 'vitepress'
import { useRoute } from 'vitepress'
import { useSidebar } from '../composables/sidebar'
import VPDocAside from './VPDocAside.vue'
import VPDocFooter from './VPDocFooter.vue'
const { page } = useData()
const { path } = useRoute()
const { hasSidebar } = useSidebar()
const pageName = computed(() => {
return page.value.relativePath.slice(0, page.value.relativePath.indexOf('/'))
})
const pageName = path.replace(/[./]+/g, '_').replace(/_html$/, '')
</script>

<template>
Expand Down

0 comments on commit 9c0ed93

Please sign in to comment.