slidevjs / slidev

Presentation Slides for Developers
https://sli.dev
MIT License
33.49k stars 1.37k forks source link

Change path for layouts, components and etc. #1586

Open varadinov opened 6 months ago

varadinov commented 6 months ago

Is your feature request related to a problem? Please describe. I would like to be able to change the path where slidev looks for layouts, components and etc. I want to create a project with multiple presentations. Each presentation to be its own directory and I want to reuse common layouts and components.

Describe the solution you'd like I want to configure somewhere slidev to search for layouts and components in different path. config.file -> layouts_alternative_paths:

Describe alternatives you've considered There some alternative like symbolic link and git submodule. However, they have some issue are not the best option.

varadinov commented 6 months ago

I found the proper way to this. You can use the themes to deliver shared components and layouts - https://sli.dev/themes/write-a-theme The theme can be referenced locally with relative path - theme: ../slidev-theme-xxxx Then the custom layouts (e.g. mylayout.vue) from the theme are accessible with - layout: xxxx

I suppose it will be nice to have this in the documentation.