-
Notifications
You must be signed in to change notification settings - Fork 76
feat(theme-default): heading-sidebar #30
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
e061c2a
feat(theme-default): auto sidebar per route and e2e test setup (close…
nruffing a2f35a9
feat(theme-default): sync lock file (close #17, #19)
nruffing d575c66
Merge remote-tracking branch 'origin/main' into auto-sidebar
nruffing 3ce32a8
feat(theme-default): use heading to configure auto sidebar per page (…
nruffing 6b89a01
fix(theme-default): lint format fix
nruffing fd793f0
Merge remote-tracking branch 'origin/main' into auto-sidebar
nruffing 942638e
chore: tweaks
nruffing File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import { defineClientConfig } from '@vuepress/client' | ||
|
||
export default defineClientConfig({ | ||
// | ||
}) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -69,6 +69,7 @@ export default defineUserConfig({ | |
], | ||
}, | ||
], | ||
'/heading-sidebar/': 'heading', | ||
}, | ||
}), | ||
}) as UserConfig |
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# heading-sidebar | ||
|
||
## header 1 | ||
|
||
## header 2 | ||
|
||
## header 3 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
it("route has 'heading' sidebar", () => { | ||
cy.visit('/heading-sidebar/') | ||
cy.get('.theme-default-content').then((el) => { | ||
cy.wrap(el) | ||
.get('h1') | ||
.invoke('text') | ||
.should('be.not.empty') | ||
.then((text) => { | ||
cy.get('.sidebar-heading') | ||
.invoke('text') | ||
.should('contain', text.replace('#', '').trim()) | ||
}) | ||
cy.wrap(el) | ||
.get('h2') | ||
.each((header) => { | ||
cy.wrap(header) | ||
.invoke('text') | ||
.should('be.not.empty') | ||
.then((headerText) => { | ||
cy.get('a.sidebar-item').contains( | ||
headerText.replace('#', '').trim(), | ||
) | ||
}) | ||
}) | ||
}) | ||
}) | ||
|
||
it('route has custom sidebar', () => { | ||
cy.visit('/sidebar/') | ||
cy.get('.theme-default-content').then((el) => { | ||
cy.wrap(el).get('.sidebar-heading').should('contain', 'Sidebar') | ||
cy.wrap(el) | ||
.get('a.sidebar-item') | ||
.should('contain', 'Sidebar Heading 1') | ||
.should('contain', 'Sidebar Heading 2') | ||
}) | ||
}) |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you change the strcture to:
I believe this could be better, thanks.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To clarify, are you suggesting we remove the
heading-sidebar
folder and replace thesidebar
folder with this structure?Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes! but a auto folder and a auto.md, auto folder is for theme config, and auto.md is for frontmatter.
This can be done in another pr, and e2e test cases completion welcome.