vuepress / core

Vue-Powered Static Site Generator
https://vuepress.vuejs.org
MIT License
2.27k stars 925 forks source link

[Bug report] root-level config for custom container does not work #175

Closed yhunko closed 3 years ago

yhunko commented 3 years ago

Bug report

Description

Danger and warning custom Markdown containers have the same title - WARNING

Steps to reproduce

::: warning
Test warning
:::

::: danger
Test danger
:::

Expected behavior

Warning container should have WARNING title Danger container should have DANGER title

Screenshots

Screenshot from 2021-05-28 17-35-28

Environment info


  System:
    OS: Linux 5.8 Ubuntu 20.04.2 LTS (Focal Fossa)
    CPU: (4) x64 Intel(R) Core(TM) i5-2310 CPU @ 2.90GHz
    Memory: 710.05 MB / 11.61 GB
    Shell: 5.0.17 - /bin/bash
  Binaries:
    Node: 14.17.0
    Yarn: 1.22.10
    npm: 7.15.0
  Utilities:
    Git: 2.25.1 - /usr/bin/git
  Browsers:
    Firefox: 88.0.1
  npmPackages:
    @vuepress/bundler-vite:  2.0.0-beta.15 
    @vuepress/bundler-webpack:  2.0.0-beta.15 
    @vuepress/cli:  2.0.0-beta.15 
    @vuepress/client:  2.0.0-beta.15 
    @vuepress/core:  2.0.0-beta.15 
    @vuepress/markdown:  2.0.0-beta.15 
    @vuepress/plugin-active-header-links:  2.0.0-beta.15 
    @vuepress/plugin-back-to-top:  2.0.0-beta.15 
    @vuepress/plugin-container:  2.0.0-beta.15 
    @vuepress/plugin-debug: Not Found
    @vuepress/plugin-docsearch: Not Found
    @vuepress/plugin-git:  2.0.0-beta.15 
    @vuepress/plugin-google-analytics: Not Found
    @vuepress/plugin-medium-zoom:  2.0.0-beta.15 
    @vuepress/plugin-nprogress:  2.0.0-beta.15 
    @vuepress/plugin-palette:  2.0.0-beta.15 
    @vuepress/plugin-prismjs:  2.0.0-beta.15 
    @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: Not Found
    @vuepress/plugin-theme-data:  2.0.0-beta.15 
    @vuepress/plugin-toc: Not Found
    @vuepress/shared:  2.0.0-beta.7 
    @vuepress/theme-default:  2.0.0-beta.15 
    @vuepress/theme-vue: Not Found
    @vuepress/utils:  2.0.0-beta.15 
    vue:  3.0.11 
    vue-loader:  16.2.0 
    vue-router:  4.0.8 
    vuepress: ^2.0.0-beta.15 => 2.0.0-beta.15 
    vuepress-vite: ^2.0.0-beta.15 => 2.0.0-beta.15
meteorlxy commented 3 years ago

It's by design. You can override it yourself

yhunko commented 3 years ago

@meteorlxy Changing config themeConfig.warning and themeConfig.danger options doesn't change the titles.

Mister-Hope commented 3 years ago

It should work, my docs is working well.

TRY waline.js.org

yhunko commented 3 years ago

@Mister-Hope well, I can see that it really works on your website. But still it doesn't in my environment.

Maybe I'm just stupid and doing something wrong...

Peek 2021-05-31 17-46

vuepress info below:

  System:
    OS: Linux 5.8 Ubuntu 20.04.2 LTS (Focal Fossa)
    CPU: (4) x64 Intel(R) Core(TM) i5-2310 CPU @ 2.90GHz
    Memory: 175.26 MB / 11.61 GB
    Shell: 5.0.17 - /bin/bash
  Binaries:
    Node: 14.17.0 - ~/.nvm/versions/node/v14.17.0/bin/node
    Yarn: 1.22.10 - ~/.nvm/versions/node/v14.17.0/bin/yarn
  Utilities:
    Git: 2.25.1 - /usr/bin/git
  Browsers:
    Firefox: 88.0.1
  npmPackages:
    @vuepress/bundler-vite:  2.0.0-beta.16 
    @vuepress/bundler-webpack:  2.0.0-beta.15 
    @vuepress/cli:  2.0.0-beta.15 
    @vuepress/client:  2.0.0-beta.15 
    @vuepress/core:  2.0.0-beta.15 
    @vuepress/markdown:  2.0.0-beta.15 
    @vuepress/plugin-active-header-links:  2.0.0-beta.15 
    @vuepress/plugin-back-to-top:  2.0.0-beta.16 
    @vuepress/plugin-container:  2.0.0-beta.15 
    @vuepress/plugin-debug: Not Found
    @vuepress/plugin-docsearch: Not Found
    @vuepress/plugin-git:  2.0.0-beta.15 
    @vuepress/plugin-google-analytics: Not Found
    @vuepress/plugin-medium-zoom:  2.0.0-beta.16 
    @vuepress/plugin-nprogress:  2.0.0-beta.16 
    @vuepress/plugin-palette:  2.0.0-beta.15 
    @vuepress/plugin-prismjs:  2.0.0-beta.15 
    @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: Not Found
    @vuepress/plugin-theme-data:  2.0.0-beta.15 
    @vuepress/plugin-toc: Not Found
    @vuepress/shared:  2.0.0-beta.7 
    @vuepress/theme-default:  2.0.0-beta.16 
    @vuepress/theme-vue: Not Found
    @vuepress/utils:  2.0.0-beta.15 
    vue:  3.0.11 
    vue-loader:  16.2.0 
    vue-router:  4.0.8 
    vuepress: ^2.0.0-beta.16 => 2.0.0-beta.16 
    vuepress-vite: ^2.0.0-beta.16 => 2.0.0-beta.16
Mister-Hope commented 3 years ago

This is something you should take a look: https://github.com/walinejs/waline/blob/main/docs/.vuepress/config.ts

yhunko commented 3 years ago

This is something you should take a look: https://github.com/walinejs/waline/blob/main/docs/.vuepress/config.ts

I believe that the only difference in your config and mine is that yours is wrapped inside /en/ path object.

meteorlxy commented 3 years ago

That could be kind of edge case of the default theme option: the root level tip, warning, danger does not take effect.


BTW, the danger WARNING was migrated from v1.

After some consideration, I think we could reset it to DANGER.