-
Notifications
You must be signed in to change notification settings - Fork 4.7k
feat: register globally theme components (close #281) #345
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
feat: register globally theme components (close #281) #345
Conversation
For me, I prefer to put the components of my custom theme in the What about I don't know which solution is better, may need more discussions. |
Sure thing, we should hear about the general consensus which place to put the components 👍 |
I agree with @meteorlxy – |
Giving it some more thought, I agree it makes perfectly sense to have a dedicated I can make that change, if you feel like it's an adequate solution for everyone 👍 |
Thanks for this work! Consider this feature can be finished by a plugin. just hold it until our plugin is released. Not too long.😅 |
Regarding the path name, I would vote for either for Differentiating the folder name between I like to think about themes as a common |
Giving it some more thought, I agree it makes perfectly sense to have a dedicated globalComponents where only those ones are registered. I can make that change, if you feel like it's an adequate solution for everyone +1 |
It was decided to wait until the plugin API is released, to add this feature as a plugin then we will revisit this discussion and decide on which directory naming to follow 😉 |
1. Move global components registration to a single plugin 'vuepress-plugin-register-global-components' 2. Support register global theme components (`${themePath}/components`) (#345)
14d9013
to
c7c0cd9
Compare
c992e38
to
c2eaff3
Compare
0c3bc3a
to
cf1e6fc
Compare
bd69d41
to
903138e
Compare
3f79224
to
fb05066
Compare
6c3127f
to
71574f2
Compare
316e022
to
1284944
Compare
In 1.x, structure of a theme would be:
And those components under ref: https://v1.vuepress.vuejs.org/theme/writing-a-theme.html#directory-structure |
This pull request allows to register theme components globally, just like the components in
.vuepress/components
.It makes use of
options.themePath
to include all *.vue in acomponents
sub-folder to follow the existing logic.Closes #281