-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
Defined sidebar with auto fallback #1252
Comments
// .vuepress/config.js
module.exports = {
themeConfig: {
sidebar: 'auto'
}
} Ref: https://vuepress.vuejs.org/theme/default-theme-config.html#auto-sidebar-for-single-pages |
Yes... that's not the issue. |
@ulivz please reopen or clarify. It doesn't seem to be possible to use
So in the case of routed sidebars, the values are always assumed to be an array. We shouldn't be required to specify |
I carefully read your issue again, so what you want is that when you set |
@ulivz you've got it. I agree with @mrleblanc101's two options in the OP. Let's say I have a
With this option I'd set
This is the most intuitive option, where setup is as simple as: module.exports = {
themeConfig: {
sidebar: {
// every page under this route has its sidebar overridden
'/guide/': [
{
title: 'Guide',
collapsable: false,
children: [
'',
'one',
'two',
'three',
'four'
]
}
],
// fallback to 'auto' sidebar for every route not covered by the above
'/': 'auto'
}
}
} Maybe |
Yes, thanks @citycide for the clarification. |
This idea is that I want a specify page sidebar to be able to link to other pages, somewhat like a hub. But all other page to display their heading in the sidebar like the "auto" option already does. This is quite similar to what the official Vue documentation does (but it doesn't use Vuepress) |
I was thinking the same thing (fallback to auto) and found this issue here. My situation is that I want my homepage have custom sidebar with links I want to show. But all other article pages should have only that article titles in the sidebar for easy reading and navigation. Please allow 'auto' in multiple sidebar config. Thanks |
I've taken a stab at this with #2380 :) this would be useful to me too, as I have pretty much the exact same use case as #1252 (comment) |
Feature request
Hi,
I was using
sidebar: 'auto'
until now.For a specific page, I want to override the sidebar.
I thought I could so this with the in YAML config of that specific page but after looking at the docs, it looks like I need to do this in the theme config.
So I added my sidebar, but it remove the automatic sidebar from every other page !
By looking at the example for the default theme config (https://vuepress.vuejs.org/theme/default-theme-config.html#sidebar), I see there is a fallback option.
If I use the fallback options with auto, the whole site does not load but there is no error while generating.
The only possible way to bypass this that works would be to not provide a fallback and add a YAML config for EVERY page with
What problem does this feature solve?
Allow to have an auto sidebar for everypage expect a few specific pages.
What does the proposed API look like?
A) Allow overriding an auto sidebar in the YAML of the page
B) Allowing auto option on sidebar fallback in config.json
How should this be implemented in your opinion?
Option B
Are you willing to work on this yourself?**
The text was updated successfully, but these errors were encountered: