├── .npmignore
├── index.js
├── package.json
├── .gitignore
├── LICENSE
└── README.md
/.npmignore:
--------------------------------------------------------------------------------
1 | .git*
2 | .DS_Store
--------------------------------------------------------------------------------
/index.js:
--------------------------------------------------------------------------------
1 | /**
2 | * video tag
3 | *
4 | * Syntax:
5 | * {% video 'videoCode' %}
6 | *
7 | * Sample:
8 | * {% video '' %}
9 | *
10 | */
11 |
12 | hexo.extend.tag.register('video', function(args, content, options) {
13 |
14 | var videoCode = args[0];
15 |
16 | videoCode = videoCode.replace(/height\=\d*/, '');
17 | videoCode = videoCode.replace(/width\=\d*/, '');
18 | videoCode = videoCode.replace(/style/, '');
19 | videoCode = videoCode.replace(/(^\s*\')|(\'\s*$)/g, "");
20 |
21 | return '
' + videoCode + '
';
22 | });
23 |
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "hexo-tag-video",
3 | "version": "0.0.3",
4 | "description": "the tag plugin of Hexo to insert a video",
5 | "main": "index.js",
6 | "repository": {
7 | "type": "git",
8 | "url": "https://github.com/geekplux/hexo-tag-video.git"
9 | },
10 | "keywords": [
11 | "tag",
12 | "plugin",
13 | "hexo",
14 | "video"
15 | ],
16 | "author": {
17 | "name": "GeekPlux",
18 | "email": "geekplux@gmail.com",
19 | "url": "http://www.geekplux.com/"
20 | },
21 | "license": "MIT",
22 | "bugs": {
23 | "url": "https://github.com/geekplux/hexo-tag-video/issues"
24 | },
25 | "homepage": "https://github.com/geekplux/hexo-tag-video"
26 | }
27 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # Logs
2 | logs
3 | *.log
4 |
5 | # Runtime data
6 | pids
7 | *.pid
8 | *.seed
9 |
10 | # Directory for instrumented libs generated by jscoverage/JSCover
11 | lib-cov
12 |
13 | # Coverage directory used by tools like istanbul
14 | coverage
15 |
16 | # Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
17 | .grunt
18 |
19 | # Compiled binary addons (http://nodejs.org/api/addons.html)
20 | build/Release
21 |
22 | # Dependency directory
23 | # Commenting this out is preferred by some people, see
24 | # https://www.npmjs.org/doc/misc/npm-faq.html#should-i-check-my-node_modules-folder-into-git-
25 | node_modules
26 |
27 | # Users Environment Variables
28 | .lock-wscript
29 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | The MIT License (MIT)
2 |
3 | Copyright (c) 2015 GeekPlux
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
23 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # hexo-tag-video
2 |
3 | [![NPM Version][npm-image]][npm-url]
4 | [![NPM Downloads][downloads-image]][downloads-url]
5 |
6 | This is a tag plugin of Hexo to insert a video on your blog posts.
7 |
8 | If you insert each video `