Skip to content

Plugins

tommy351 edited this page Oct 11, 2012 · 110 revisions

Commands

  • Install

    npm install <plugin-name>
    
  • Update

    npm update
    
  • Uninstall

    npm uninstall <plugin-name>
    
  • List

    npm list
    

List

Generators

Generators generate static files.

Renderers

Renderers make Hexo support more template engines.

Writing a plugin

There're 3 types of plugins:

  • Generator: Generate static file
  • Helper: Tags used in article
  • Renderer: Support of other template engine

Generator

hexo.extend.generator.register(function(locals, render, callback){
  // code
});

Helper

hexo.extend.helper.register(tag, function(args, content){
  // code
}, end);

Renderer

hexo.extend.renderer.register(ext, output, function(file, content, [locals], [callback]){
  // code
}, sync);

Caution

Attention! This wiki is no longer maintained.

Please visit the official website. https://hexo.io/

Clone this wiki locally