-
-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
Feature Request: Install theme through npm install #2471
Comments
I think it is good idea. |
Great! So now I am thinking about the workflow to install and config a theme:
❔ Should we copy all files from the theme or is the Opinions welcomed! |
I was also thinking about the need to create a command to install a theme.
If you want to go in the direction of transforming themes into npm modules, then you would need to treat themes as imputables, and copy the whole theme configuration into the main _config.yml I'm not sure I like that idea, because I spent a lot of fun time tweaking my theme, and making it immutable would just remove all the fun, but it could probably be an alternative source of theme. |
Agree, theme should be configurable and easily modified. I do like the idea https://github.com/adamsiwiec/hexagon has implemented that, perhaps we can port it to hexo-cli. |
I just finished a prototype of themes as npm packages! It was fairly easy, but I learned lots of things on the way I did that with my personal site and my theme :) Here is an summary: First you need to exclude hexo-theme-xxx from the plugin list otherwise they will be loaded (and fail) Them I introduced a variable called Then you must move your "personal" configuration from the theme's Then you must transform your theme into an npm package: Then, as your theme cam be considered "non editable", you need to convert the "static" colors from the style files and move them to the configuration.
with:
And you need to add to your theme's configuration:
(I will do a PR to improve documentation) Then the issue is that hexo-renderer-stylus does not use either the theme's The last comment I have is that I'm also not fully satisfied with the variable I'm super satisfied with this new way of installing themes. |
@tomap Hexo considered all The first thing for us have to do is to exclude |
In order to simplify the config, we could first load theme from |
@SukkaW |
I don't know if you've seen, but I fixed this issue here: But indeed, we could change the theme names to something like you propose or |
BTW, the result is here: |
Maybe refer to vuepress‘s theme-inheritance, looking forward to this feature implementation. |
This is already in progress. Please join the discussion here #3890 :) |
I think this would be a good feature to give proper version control for themes.
Plugins can be installed into
node_modules
throughnpm install
, but there are issues with installing themes this way, e.g. the need to modify the_config.yml
and potentially other files from within the theme.💡 Perhaps one way to handle this simply treat the files in
themes\[my-theme]
as overrides to the original theme.Thoughts?
The text was updated successfully, but these errors were encountered: