hexo-tag-tweetable-quote
Advanced tools
Comparing version 1.0.0 to 1.0.1
88
index.js
@@ -8,4 +8,4 @@ /** | ||
// Strict mode. | ||
"use strict"; | ||
// Strict mode. | ||
"use strict"; | ||
@@ -20,8 +20,8 @@ // Package modules. | ||
hexo.config.tweetableQuote = assign({ | ||
quote_font_color : "#258fb8", | ||
quote_font_size : "1.7em", | ||
link_font_color : "#6e7b8d", | ||
link_font_size : "1.0em", | ||
via_twitter_account : "", | ||
related_twitter_accounts : "" | ||
quote_font_color: "#258fb8", | ||
quote_font_size: "1.7em", | ||
link_font_color: "#6e7b8d", | ||
link_font_size: "1.0em", | ||
via_twitter_account: "", | ||
related_twitter_accounts: "" | ||
}, hexo.config.tweetableQuote); | ||
@@ -33,42 +33,42 @@ | ||
let quote = args[0]; | ||
let author = args[1]; | ||
let hashtags = args[2]; | ||
let quote = args[0]; | ||
let author = args[1]; | ||
let hashtags = args[2]; | ||
let URLData = {}; | ||
URLData.text = quote + " - " + author; | ||
if(hexo.config.tweetableQuote.via_twitter_account){ | ||
URLData.via = hexo.config.tweetableQuote.via_twitter_account; | ||
} | ||
if(hexo.config.tweetableQuote.related_twitter_accounts){ | ||
URLData.related = hexo.config.tweetableQuote.related_twitter_accounts; | ||
} | ||
if(hashtags){ | ||
URLData.hashtags = hashtags; | ||
} | ||
if(this.permalink){ | ||
URLData.url = this.permalink; | ||
} | ||
let URLData = {}; | ||
URLData.text = quote + " - " + author; | ||
if (hexo.config.tweetableQuote.via_twitter_account) { | ||
URLData.via = hexo.config.tweetableQuote.via_twitter_account; | ||
} | ||
if (hexo.config.tweetableQuote.related_twitter_accounts) { | ||
URLData.related = hexo.config.tweetableQuote.related_twitter_accounts; | ||
} | ||
if (hashtags) { | ||
URLData.hashtags = hashtags; | ||
} | ||
if (this.permalink) { | ||
URLData.url = this.permalink; | ||
} | ||
let tweetURL = "https://twitter.com/intent/tweet?"+querystring.stringify(URLData); | ||
let tweetURL = "https://twitter.com/intent/tweet?" + querystring.stringify(URLData); | ||
const data = { | ||
"quote": quote, | ||
"author": author, | ||
"tweetURL":tweetURL, | ||
"quote_font_color":hexo.config.tweetableQuote.quote_font_color, | ||
"quote_font_size":hexo.config.tweetableQuote.quote_font_size, | ||
"link_font_size":hexo.config.tweetableQuote.link_font_size, | ||
"link_font_color":hexo.config.tweetableQuote.link_font_color | ||
}; | ||
const data = { | ||
"quote": quote, | ||
"author": author, | ||
"tweetURL": tweetURL, | ||
"quote_font_color": hexo.config.tweetableQuote.quote_font_color, | ||
"quote_font_size": hexo.config.tweetableQuote.quote_font_size, | ||
"link_font_size": hexo.config.tweetableQuote.link_font_size, | ||
"link_font_color": hexo.config.tweetableQuote.link_font_color | ||
}; | ||
return new Promise(function (resolve, reject) { | ||
nunjucks.render("tweetable-quote.njk", data, function (err, res) { | ||
if (err) { | ||
return reject(err); | ||
} | ||
resolve(res); | ||
}); | ||
}); | ||
return new Promise(function(resolve, reject) { | ||
nunjucks.render("tweetable-quote.njk", data, function(err, res) { | ||
if (err) { | ||
return reject(err); | ||
} | ||
resolve(res); | ||
}); | ||
}); | ||
},{async: true}); | ||
}, {async: true}); |
{ | ||
"name": "hexo-tag-tweetable-quote", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"description": "hexo tag plugin to add tweetable qoutes to posts and pages", | ||
@@ -31,5 +31,5 @@ "main": "index.js", | ||
"dependencies": { | ||
"nunjucks": "^3.0.0", | ||
"nunjucks": "^3.1.3", | ||
"object-assign": "^4.1.0" | ||
} | ||
} |
@@ -7,5 +7,3 @@ # hexo-tag-tweetable-quote for [Hexo](https://hexo.io) | ||
[![Build Status](https://travis-ci.org/iamchathu/hexo-tag-tweetable-quote.svg?branch=master)](https://travis-ci.org/iamchathu/hexo-tag-tweetable-quote) | ||
[![Dependency Status](https://gemnasium.com/badges/github.com/iamchathu/hexo-tag-tweetable-quote.svg)](https://gemnasium.com/github.com/iamchathu/hexo-tag-tweetable-quote) | ||
[![Code Climate](https://codeclimate.com/github/iamchathu/hexo-tag-tweetable-quote/badges/gpa.svg)](https://codeclimate.com/github/iamchathu/hexo-tag-tweetable-quote) | ||
[![bitHound Overall Score](https://www.bithound.io/github/iamchathu/hexo-tag-tweetable-quote/badges/score.svg)](https://www.bithound.io/github/iamchathu/hexo-tag-tweetable-quote) | ||
[![Codacy Badge](https://api.codacy.com/project/badge/Grade/b638099f4ae54d66ad048f7fddb4326c)](https://www.codacy.com/app/imchathu/hexo-tag-tweetable-quote?utm_source=github.com&utm_medium=referral&utm_content=iamchathu/hexo-tag-tweetable-quote&utm_campaign=badger) | ||
@@ -80,2 +78,4 @@ [![GitHub license](https://img.shields.io/badge/license-MIT-blue.svg)](https://raw.githubusercontent.com/iamchathu/hexo-tag-tweetable-quote/master/LICENSE) | ||
If you use this plugin on your site please be kind enough to put it in [wiki](https://github.com/iamchathu/hexo-tag-tweetable-quote/wiki) | ||
## Tested themes | ||
@@ -82,0 +82,0 @@ |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
59822
Updatednunjucks@^3.1.3