Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

A way to configure the directory for docs instead of the root folder #4384

Closed
4 tasks done
kaesar opened this issue Nov 25, 2024 · 2 comments
Closed
4 tasks done

A way to configure the directory for docs instead of the root folder #4384

kaesar opened this issue Nov 25, 2024 · 2 comments

Comments

@kaesar
Copy link

kaesar commented Nov 25, 2024

Is your feature request related to a problem? Please describe.

Currently, I have three small blogs due to different approaches. I have customized certain things in the theme design when downloading VitePress, for example, to include in these projects native web components that can be loaded as an html tag from a simple Markdown (.md) file, besides include TailwindCSS.
I am not interested in doing a Fork and would like to evaluate if it is possible to change the directory of the Vitepress documents (separating or decoupling the content of the mechanism) in order to have versatility and not having to copy in each project folder the theme and components (I mean, an srcDir different from root).

Describe the solution you'd like

One idea would be to allow the base directory of Vitepress to be different from the root, separating or decoupling the content of the theme or template (although I would understand if it is a matter of design).
What is wanted is to use the modified Vitepress theme on different blogs without having to copy it to each project (thinking in multi-project of content)

Describe alternatives you've considered

  1. I have tried to apply on each of the three Vitepress blogs with the custom theme ( just that it can lead to theme desynchronization).

  2. Another way is to have every blog under root folder and change srcDir in config.mjs according the blog selected.

  3. Using a symbolic link but eventualy some errors occurs cause it resolves another path (e.g. ../../path) and finally doesn't work.

Additional context

The project with native web components that can be use in Markdown (.md) is: https://github.com/kaesar/onmind-cui

Validations

@brc-dd
Copy link
Member

brc-dd commented Dec 18, 2024

Ah, not sure if I understood your problem correctly, but you can just import your shared theme and config?

- shared/
-       /theme/index.ts
-       /theme/...other stuff...
-       /config/index.ts
-       /config/...other stuff...
- blog1/
-      /.vitepress/theme/index.ts (export default from '/../shared/theme/index.js')

@kaesar
Copy link
Author

kaesar commented Dec 21, 2024

Yes, basically is about to share the theme. I will check this then.
Thank you, this entry could be closed.

@kaesar kaesar closed this as completed Dec 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants