vuepress / core

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

SidebarItem with custom source path #1468

Closed rrr3da closed 5 months ago

rrr3da commented 5 months ago

Description

Let's say I need to have 2 languages in my website, English and Italian.

I would create the directory structure to build everything up as usual, with "docs" for default (en) and "docs/it" at the top.

Is there a way to specify that an html page, let's say 'www.host.com/it/home.html', must be generated starting from a file placed at /docs/home.md (without the /it/ subpath)?

Or, in alternative to this, is there a way to use symlinks to fake a file called home.html exists under /docs/it/home.md?

Thank you

Reproduction

https://github.com/rrr3da/vp

Used Package Manager

npm

System Info

System:
    OS: macOS 14.2.1
    CPU: (8) arm64 Apple M2
    Memory: 287.20 MB / 24.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 18.16.1 - ~/.nvm/versions/node/v18.16.1/bin/node
    Yarn: Not Found
    npm: 9.5.1 - ~/.nvm/versions/node/v18.16.1/bin/npm
  Utilities:
    Git: 2.39.3 - /usr/bin/git
  Browsers:
    Chrome: 120.0.6099.234
    Edge: Not Found
    Safari: 17.2.1
  npmPackages:
    @vuepress/bundler-vite:  2.0.0-rc.0 
    @vuepress/bundler-webpack: Not Found
    @vuepress/cli:  2.0.0-rc.0 
    @vuepress/client:  2.0.0-rc.0 
    @vuepress/core:  2.0.0-rc.0 
    @vuepress/markdown:  2.0.0-rc.0 
    @vuepress/plugin-active-header-links:  2.0.0-rc.0 
    @vuepress/plugin-back-to-top:  2.0.0-rc.0 
    @vuepress/plugin-container:  2.0.0-rc.0 
    @vuepress/plugin-docsearch: Not Found
    @vuepress/plugin-external-link-icon:  2.0.0-rc.0 
    @vuepress/plugin-git:  2.0.0-rc.0 
    @vuepress/plugin-google-analytics: Not Found
    @vuepress/plugin-medium-zoom:  2.0.0-rc.0 
    @vuepress/plugin-nprogress:  2.0.0-rc.0 
    @vuepress/plugin-palette:  2.0.0-rc.0 
    @vuepress/plugin-prismjs:  2.0.0-rc.0 
    @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-rc.0 
    @vuepress/plugin-toc: Not Found
    @vuepress/shared:  2.0.0-rc.0 
    @vuepress/theme-default:  2.0.0-rc.0 
    @vuepress/utils:  2.0.0-rc.0 
    vue:  3.4.15 
    vue-loader: Not Found
    vue-router:  4.2.5 
    vuepress: ^2.0.0-rc.0 => 2.0.0-rc.0 
    vuepress-vite:  2.0.0-rc.0 
    vuepress-webpack: Not Found
meteorlxy commented 5 months ago

I might not get your point clearly, but I think you are actually asking a question. Then please move to the Discussions panel