Open Peque opened 2 months ago
Hello, thank you for using vitepress-sidebar
and leaving your feedback.
First, based on the current behavior, this plugin does not directly read VitePress' config because it is declared at the themeConfig -> sidebar level, not at the plugin level in Vite. Therefore, we need to find a way to read the settings in the config file to make this work.
For now, if you want to pass the same value with srcExclude
, there is a way to define it as a global constant and use it on both sides.
const srcExclude = ['**/README.md', '**/TODO.md'];
export default defineConfig({
title: 'VitePress Sidebar',
srcExclude: srcExclude,
themeConfig: {
sidebar: generateSidebar({
documentRootPath: '/docs',
excludePattern: srcExclude,
};
}),
}
});
It doesn't seem likely that this issue will be addressed quickly, but we'll keep it open for future reference for others.
Regards,
Right now,
excludePattern
allows you to define file/directory exclusions based on patterns, just likesrcExclude
does.It does work fine but, apparently, it requires you to declare both
srcExclude
andexcludePattern
(with the same values).It would be great if VitePress Sidebar could honor
srcExclude
. That means it would inherit allsrcExclude
values, which probably makes sense since thesrcExclude
is declared at a "higher" level than the Sidebar plugin (it affects the whole VitePress project).