-
-
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
Allow local plugins #1670
Comments
+1 for Note that hexo can load simple scripts already: Implementation tip for load local plugin: |
Also, I don't like the way hexo using Added a poc: |
There are also several hexo plugins that in turn load modules ( |
The reason Hexo uses |
@tommy351 I know what module.exports = function (hexo) {
hexo.extend.renderer.register('commonjs_plugin');
}; Then there is no reason injecting Back to backward compatible issue, the loader can fall back to old behavior when plugin is not in CommonJS format, and that's what my poc trying to prove. |
You either DO NOT define Originally posted by @leesei in #1848 (comment) CC @hexojs/core |
I would find it very useful to be able to make small, local plugins, not tied to my
package.json
in any way. This would be similar to jekyll with supports custom local code in a_plugins
directory, as well as plugins loaded from gem.Ideal scenario:
plugins
array is standardized in_config.yml
plugins
directory is standardized as the place to put your local plugin code -- obeying all conventions of a standard pluginplugins
dir, secondarily byrequire
ing the plugin name -- this allows someone to override an npm plugin for easier development (maybe if they are developing it actively, and don't want to involve npm)Some of this duplicated hexojs/hexo-cli#174 but I think that is a much bigger request.
I would also find it preferable if, once standardized, a config.yml plugins array became the only way of loading plugins. The current package.json parsing approach seems very clever and "magical", and not in keeping with the practice of many other node apps I've encountered.
A PR to follow, this is actually pretty easy to implement, but I want to gauge interest first.
The text was updated successfully, but these errors were encountered: