Skip to content

Commit

Permalink
complete the first release
Browse files Browse the repository at this point in the history
  • Loading branch information
patrick330602 committed Apr 17, 2018
1 parent 5d21765 commit 52fee43
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 17 deletions.
1 change: 1 addition & 0 deletions .gitignore
@@ -0,0 +1 @@
hexo-tag-color-block*
17 changes: 12 additions & 5 deletions README.md
@@ -1,5 +1,12 @@
# hexo-tag-color-block

Create Color Block Easily on Hexo

usage: `{% colorblock [color hex code] [width] %}`
# hexo-tag-color-block

Create Color Block Easily on Hexo

usage: `{% colorblock [color hex code] [width] %}`

example: `{% colorblock #f8dcf8 %}` will generate:
![example of #f8dcf8](example)

## License

MIT.
Binary file added example.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
24 changes: 12 additions & 12 deletions index.js
@@ -1,13 +1,13 @@
hexo.extend.tag.register('colorblock', function(args){
var config = hexo.config.colorblock || {};
config.width = config.width || 10;
var color = parseInt(args[0]);
var width = parseInt(args[1]) || config.width;
return '<svg width="'
+ width +'" height="'
+ width +'"><rect width="'
+ width + '" height="'
+ width + '" fill="'
+ color + '"/></svg>&nbsp;'
+color;
hexo.extend.tag.register('colorblock', function(args){
var config = hexo.config.colorblock || {};
config.width = config.width || 10;
var color = args[0];
var width = parseInt(args[1]) || config.width;
return '<svg width="'
+ width +'" height="'
+ width +'"><rect width="'
+ width + '" height="'
+ width + '" fill="'
+ color + '"/></svg>&nbsp;'
+color;
});

0 comments on commit 52fee43

Please sign in to comment.