Skip to content

Commit

Permalink
Merge 4806f7c into 00c6114
Browse files Browse the repository at this point in the history
  • Loading branch information
honjun committed Feb 1, 2019
2 parents 00c6114 + 4806f7c commit 4d68f6c
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
16 changes: 16 additions & 0 deletions lib/plugins/tag/bili.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
'use strict';

/**
* Bilibili tag
*
* Syntax:
* {% bili video_id %}
*/

function biliTag(args, content) {
var src = args[0];

return '<div style="position: relative; width: 100%; height: 0; padding-bottom: 75%;"><iframe src="' + src + '" scrolling="no" border="0" frameborder="no" framespacing="0" allowfullscreen="true" style="position: absolute; width: 100%; height: 100%; left: 0; top: 0;"></iframe></div>';
}

module.exports = biliTag;
2 changes: 2 additions & 0 deletions lib/plugins/tag/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,4 +51,6 @@ module.exports = ctx => {
tag.register('vimeo', require('./vimeo'));

tag.register('youtube', require('./youtube'));

tag.register('bili', require('./bili'));
};

0 comments on commit 4d68f6c

Please sign in to comment.