vuejs / vuepress

📝 Minimalistic Vue-powered static site generator
https://vuepress.vuejs.org
MIT License
22.44k stars 4.78k forks source link

Sidebar menu still visible when set to false #3004

Open verdverm opened 2 years ago

verdverm commented 2 years ago

Bug report

Steps to reproduce

Using 2.0.0-beta.35

  1. Create a new site, per the docs page
  2. add the config.js file
  3. set sidebar: false in the theme config

What is expected?

That the hamburger menu is not displayed

What is actually happening?

Sidebar is not displayed, but the hamburger button is visible on mobile breakpoints. Looking at the theme code, I think that the showSidebar variable is not passed and available to v-if the hamburger menu. This is in the theme-default/lib/client/layouts/Layout.vue file (in node_modules, can't find where the .

Other relevant information

$ npx vuepress info

  System:
    OS: Linux 5.10 Debian GNU/Linux 10 (buster) 10 (buster)
    CPU: (4) x64 06/8e
    Memory: 14.20 GB / 14.21 GB
    Shell: 5.0.3 - /bin/bash
  Binaries:
    Node: 17.5.0 - ~/.config/nvm/versions/node/v17.5.0/bin/node
    Yarn: 1.22.4 - ~/.npm-global/bin/yarn
    npm: 8.4.1 - ~/.config/nvm/versions/node/v17.5.0/bin/npm
  Utilities:
    Git: 2.20.1 - /usr/bin/git
  Browsers:
    Chrome: Not Found
    Firefox: Not Found
  npmPackages:
    @vuepress/bundler-vite:  2.0.0-beta.35 
    @vuepress/bundler-webpack: Not Found
    @vuepress/cli:  2.0.0-beta.35 
    @vuepress/client:  2.0.0-beta.35 
    @vuepress/core:  2.0.0-beta.35 
    @vuepress/markdown:  2.0.0-beta.35 
    @vuepress/plugin-active-header-links:  2.0.0-beta.35 
    @vuepress/plugin-back-to-top:  2.0.0-beta.35 
    @vuepress/plugin-container:  2.0.0-beta.35 
    @vuepress/plugin-docsearch: Not Found
    @vuepress/plugin-external-link-icon:  2.0.0-beta.35 
    @vuepress/plugin-git:  2.0.0-beta.35 
    @vuepress/plugin-google-analytics: Not Found
    @vuepress/plugin-medium-zoom:  2.0.0-beta.35 
    @vuepress/plugin-nprogress:  2.0.0-beta.35 
    @vuepress/plugin-palette:  2.0.0-beta.35 
    @vuepress/plugin-prismjs:  2.0.0-beta.35 
    @vuepress/plugin-pwa: Not Found
    @vuepress/plugin-pwa-popup: Not Found
    @vuepress/plugin-register-components: Not Found
    @vuepress/plugin-search: Not Found
    @vuepress/plugin-shiki: ^2.0.0-beta.35 => 2.0.0-beta.35 
    @vuepress/plugin-theme-data:  2.0.0-beta.35 
    @vuepress/plugin-toc: Not Found
    @vuepress/shared:  2.0.0-beta.35 
    @vuepress/theme-default:  2.0.0-beta.35 
    @vuepress/utils:  2.0.0-beta.35 
    vue:  3.2.31 
    vue-loader: Not Found
    vue-router:  4.0.12 
    vuepress: ^2.0.0-beta.35 => 2.0.0-beta.35 
    vuepress-vite:  2.0.0-beta.35 
    vuepress-webpack: Not Found

images

Normal width

image

Narrow width

image

Open menu

image

surya-purohit commented 2 years ago

Have you tried this in .vuepress/config.js?

theme: defaultTheme({
  locales: {
    '/': { sidebar: false }
  }
})
verdverm commented 2 years ago

@surya-purohit yes, the issue description mentions that it is explicitly set. The problem is that the value is not checked in all the places it is needed

Mister-Hope commented 2 years ago

This is VuePress 1 repo, please ensure you are using correct version and reading correct docs, VuePress 2 repo are at VuePress/VuePress-next

verdverm commented 2 years ago

You closed that one as not a bug (see the linked issue above)

I still regard it as a bug, because when I set the menu to not display, per the config, the menu button is still shown

The fix looked to be minimal, and would use the same logic as the menu area component