diff --git a/index.js b/index.js index 9e2d3b4..a3ce7ee 100644 --- a/index.js +++ b/index.js @@ -55,9 +55,8 @@ hexo.extend.filter.register('after_post_render', function(data) { // {% dplayer key=value ... %} hexo.extend.tag.register('dplayer', function(args) { - let url, api, loop, autoplay, theme, pic, did, token, screenshot, lang, maximum, hotkey, preload; - var id = 'dplayer' + (counter++), - raw = '
'; + let url, api, loop, autoplay, theme, pic, did, token, screenshot, lang, maximum, hotkey, preload, width, height; + var id = 'dplayer' + (counter++); for (var i = 0; i < args.length; ++i) { var arg=args[i]; if(arg.split('=').length<2) @@ -114,9 +113,15 @@ hexo.extend.tag.register('dplayer', function(args) { case 'maximum': maximum = arg.slice(arg.indexOf("=")+1); break; + case 'width': + width = arg.slice(arg.indexOf("=")+1); + break; + case 'height': + height = arg.slice(arg.indexOf("=")+1); + break; } } - + var raw = '
'; if(url != undefined) raw += '