rspress
rspress copied to clipboard
[Feature]: Reusable theme scalability support
What problem does this feature solve?
Currently (from the documentation) rspress only supports extensions that create theme folders in the current directory, and does not support loading theme extensions from npm packages, which prevents the community from sharing theme packages such as rspress-theme-xxx for the rspress ecosystem.
What does the proposed API look like?
The intended API should consist of two parts:
- New theme configuration items.
- support for loading theme components from npm packages.
import * as path from 'path';
import { defineConfig } from 'rspress/config';
export default defineConfig({
root: path.join(__dirname, 'docs'),
theme: 'rspress-theme-blog',
// should support extending types from theme package
themeConfig: { },
});
Some additional things: Themes should normally be a superset of plugins, so plugins in the theme should also be able to be loaded properly.
Nice features! That's what we are going to support. Thanks your feedback. We will design the theme npm package exports and support loading theme package in this month.
It's a big feature and we should also implement theme inheritance like https://vuepress.vuejs.org/theme/inheritance.html#theme-inheritance do.
May be it will be implemented in 2.0 refactor?