fix(theme): show outline even without sidebar (#1189)

pull/1191/head
Divyansh Singh 2 years ago committed by GitHub
parent a8834ac3b2
commit 3714ea3463
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -7,9 +7,9 @@ describe('render corrent content', () => {
}) })
test('main content', async () => { test('main content', async () => {
const h1Locator = await page.locator('h1') const h1Locator = page.locator('h1')
const h2Locator = await page.locator('h2') const h2Locator = page.locator('h2')
const pLocator = await page.locator('.Layout p') const pLocator = page.locator('.Layout p')
const [h1Contents, h2Conetents, pContents] = await Promise.all([ const [h1Contents, h2Conetents, pContents] = await Promise.all([
h1Locator.allTextContents(), h1Locator.allTextContents(),
@ -28,11 +28,11 @@ describe('render corrent content', () => {
}) })
test('outline', async () => { test('outline', async () => {
const outlineLinksLocator = await page.locator( const outlineLinksLocator = page.locator(
'.VPDocAsideOutline .root .outline-link' '.VPDocAsideOutline .root .outline-link'
) )
const outlineLinksCount = await outlineLinksLocator.count() const outlineLinksCount = await outlineLinksLocator.count()
expect(outlineLinksCount).toEqual(0) expect(outlineLinksCount).toEqual(4)
}) })
}) })

@ -73,10 +73,6 @@ const pageName = computed(() =>
max-width: 992px; max-width: 992px;
} }
.VPDoc:not(.has-sidebar) .aside {
display: block;
}
.VPDoc:not(.has-sidebar) .content { .VPDoc:not(.has-sidebar) .content {
max-width: 752px; max-width: 752px;
} }

@ -23,13 +23,9 @@ export function useSidebar() {
}) })
const hasAside = computed(() => { const hasAside = computed(() => {
if ( return (
frontmatter.value.layout !== 'home' && frontmatter.value.layout !== 'home' && frontmatter.value.aside !== false
frontmatter.value.aside === false
) )
return false
return hasSidebar.value
}) })
function open() { function open() {

Loading…
Cancel
Save