Skip to content

Commit

Permalink
feat(theme-default): use heading to configure auto sidebar per page (c…
Browse files Browse the repository at this point in the history
…loses vuepress#19)
  • Loading branch information
nruffing committed Jan 27, 2024
1 parent d575c66 commit 3ce32a8
Show file tree
Hide file tree
Showing 10 changed files with 1,333 additions and 1,178 deletions.
1 change: 1 addition & 0 deletions e2e/docs/.vuepress/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ export default defineUserConfig({
],
},
],
'/heading-sidebar/': 'heading',
},
}),
}) as UserConfig
7 changes: 0 additions & 7 deletions e2e/docs/custom-sidebar/README.md

This file was deleted.

1 change: 0 additions & 1 deletion e2e/docs/custom-sidebar/custom-one.md

This file was deleted.

1 change: 0 additions & 1 deletion e2e/docs/custom-sidebar/custom-two.md

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# auto-sidebar
# heading-sidebar

## header 1

Expand Down
1 change: 1 addition & 0 deletions e2e/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
"dependencies": {
"@vuepress/bundler-vite": "2.0.0-rc.2",
"@vuepress/bundler-webpack": "2.0.0-rc.2",
"@vuepress/client": "2.0.0-rc.2",
"@vuepress/theme-default": "workspace:*",
"sass": "^1.70.0",
"sass-loader": "^14.0.0",
Expand Down
12 changes: 6 additions & 6 deletions e2e/tests/theme-default/composables/useSidebarItems.cy.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
it("route has 'auto' sidebar", () => {
cy.visit('/auto-sidebar/')
it("route has 'heading' sidebar", () => {
cy.visit('/heading-sidebar/')
cy.get('.theme-default-content').then((el) => {
cy.wrap(el)
.get('h1')
Expand All @@ -26,12 +26,12 @@ it("route has 'auto' sidebar", () => {
})

it('route has custom sidebar', () => {
cy.visit('/custom-sidebar/')
cy.visit('/sidebar/')
cy.get('.theme-default-content').then((el) => {
cy.wrap(el).get('.sidebar-heading').should('contain', 'custom-sidebar')
cy.wrap(el).get('.sidebar-heading').should('contain', 'Sidebar')
cy.wrap(el)
.get('a.sidebar-item')
.should('contain', 'custom-child-1')
.should('contain', 'custom-child-2')
.should('contain', 'Sidebar Heading 1')
.should('contain', 'Sidebar Heading 2')
})
})
Loading

0 comments on commit 3ce32a8

Please sign in to comment.