Skip to content

set sidebar: auto as default configure of pages #552

Closed
@tyrion-yu

Description

@tyrion-yu

Feature request

What problem does this feature solve?

If someone use VuePress to build a blog of himself, he may have tons of files in his docs directory.
He may want all his contents have a sidebar of the content.
It's crazy to append FrontMatter Config to all the files.

What does the proposed API look like?

In the .vuepress/config.js, we can set sidebar property to auto. Then all the pages have this value for default. FrontMatter on single page still have higher priority to rewrite the default value.

How should this be implemented in your opinion?

// resolveSidebarItems
const { themeConfig } = site
const pageSidebarConfig = page.frontmatter.sidebar || themeConfig.sidebar
if (pageSidebarConfig === 'auto') {
    return resolveHeaders(page)
}

Are you willing to work on this yourself?**

I'm not sure. At least Not Recently.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions