Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/njzjz/hexo-tag-injector

Inject scripts or stylesheets only for posts with tags.
https://github.com/njzjz/hexo-tag-injector

Last synced: about 1 month ago
JSON representation

Inject scripts or stylesheets only for posts with tags.

Awesome Lists containing this project

README

        

# hexo-tag-injector

Inject scripts or stylesheets only for posts with tags.

## Usage
```js
const css = hexo.extend.helper.get('css').bind(hexo);
const Injector = require("hexo-tag-injector")
const injector = new Injector(hexo);
hexo.extend.tag.register("some-tag", function(args){
var content = some_func();
return injector.mark(content);
}
injector.register("head_end", css("css/some_stylesheet.min.css"));
```