Closed KrLite closed 1 week ago
I am considering adding <slot />
slot support for extensibility.
In fact, I am planning further theme refactoring, including features like extending slots and component overrides, as well as supporting more flexible page custom layouts.
When I initially created this theme, my goal was to incorporate as many desired features as possible, while keeping the configuration simple and flexible for users to focus on content creation. Consequently, I had to omit many more advanced extension supports.
No worries! The current appearances of the theme is good enough to provide an out-of-the-box experience. I will look forward to the future extending and overriding features.
Named slots and component overrides are now supported in the new version, but I haven't prepared the documentation yet. If you need them urgently, you can check Layout.vue to learn about all the supported named slots. @theme/xx
is consistent with @vuepress/theme-default
.
Thanks! That's surprisingly fast!
As the title says, VuePress default theme provides extendable components and layouts through slots (
<slot />
) and aliases (@theme/...
). Currently I found Plume doesn't provide such features, and all the components are hard-coded, which results in a low extendability.Although Plume makes most of its components perfect and pretty, there are indeed some demands to extend or modify Plume's components. For example, extend the
<BackToTop />
component to a circle stroked style like what in VuePress default theme. This could be done easily if the component has an alias and some slots.In practice, the template of the new
BackToTop.vue
might look like:...and, aliases will need to be defined as mentioned here.
If this feature is okay, I'm always happy to contribute in migrating all current components to support slots and aliases.