Skip to content
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

feat(theme-default): heading-sidebar #30

Merged
merged 7 commits into from
Jan 28, 2024

Conversation

nruffing
Copy link
Contributor

Before submitting the PR, please make sure you do the following

  • Read the Contributing Guidelines.
  • Provide a description in this PR that addresses what the PR is solving. If this PR is going to solve an existing issue, please reference the issue (e.g. close vuepress/core#123).

What is the purpose of this pull request?

  • Bug fix
  • New feature
  • Other

Description

The auto sidebar feature of the default theme is quite useful, especially in cases where the pages are autogenerated documentation from something like TypeDoc.

Currently you can only use the auto feature on all pages or manually specify the sidebar for every page. It would be great if you could turn the feature on per page as well.

This PR also contains the initial setup of the e2e tests for the default theme and a couple e2e tests of this new feature.

Screenshots

Before

After

closes #17

@nruffing nruffing changed the title Auto sidebar feat(theme-default): heading-sidebar Jan 27, 2024
Copy link
Member

@Mister-Hope Mister-Hope left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some tweaks is suggested.

.eslintrc.cjs Outdated Show resolved Hide resolved
@@ -69,6 +69,7 @@ export default defineUserConfig({
],
},
],
'/heading-sidebar/': 'heading',
Copy link
Member

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:

sidebar/
  auto/
  auto.md
  config/
    1.md
    2.md
  README.md

I believe this could be better, thanks.

Copy link
Contributor Author

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 the sidebar folder with this structure?

Screenshot 2024-01-28 at 9 13 51 AM

Copy link
Member

@Mister-Hope Mister-Hope Jan 28, 2024

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.

themes/theme-default/package.json Outdated Show resolved Hide resolved
@nruffing
Copy link
Contributor Author

I created a docs PR for these changes. vuepress/docs#9

@Mister-Hope Mister-Hope merged commit 0ac591d into vuepress:main Jan 28, 2024
33 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Feature request] Auto Sidebar Per Page
2 participants