hexo
Version:
A fast, simple & powerful blog framework, powered by Node.js.
19 lines (15 loc) • 529 B
JavaScript
module.exports = function(path){
var args = Array.prototype.slice.call(arguments),
config = this.config || hexo.config,
root = config.root,
out = [];
args.forEach(function(path){
if (!Array.isArray(path)) path = [path];
path.forEach(function(item){
if (item.substr(item.length - 3, 3) !== '.js') item += '.js';
if (!/^([a-z]+:)?\/{1,2}/.test(item)) item = root + item;
out.push('<script type="text/javascript" src="' + item + '"></script>');
});
});
return out.join('\n');
};